Quickstart

Setup

Register and Login

At first go to https://auth.traceroot.ai/ to register or login. If you don’t have an account, you can register by clicking the Sign Up button: Register Then you can login with your registered email and password. Signin Then you can see the following page which means you have successfully logged in :) Loggedin

Get Token

You can get the token by navigating to the Connect page. Token

Install SDK

Then you can install the TraceRoot.AI SDK in your Python package by
pip install traceroot==0.0.4a5

Configure

Then you can configure the SDK by creating a .traceroot-config.yaml file
  • In the root of your GitHub repository if your package is not installed.
  • In the repository for the entry script to run your program if your package is installed.
The configuration file looks like the following:
token: "[YOUR-GENERATED-TOKEN-AT-PREVIOUS-STEP]"
service_name: "[YOUR-SERVICE-NAME]"
github_owner: "[YOUR-GITHUB-OWNER-NAME]"
github_repo_name: "[YOUR-GITHUB-REPO-NAME]"
github_commit_hash: "[YOUR-GITHUB-COMMIT-HASH]"
or you can initialize with the following in your entry file for a Python program:
import traceroot

traceroot.init(
    token="[YOUR-GENERATED-TOKEN-AT-PREVIOUS-STEP]",
    service_name="[YOUR-SERVICE-NAME]",
    github_owner="[YOUR-GITHUB-OWNER-NAME]",
    github_repo_name="[YOUR-GITHUB-REPO-NAME]",
    github_commit_hash="[YOUR-GITHUB-COMMIT-HASH]",
)
Notice that all github related information is optional. Then you can start tracing and logging by
logger = traceroot.get_logger()

@traceroot.trace()
def main():
    logger.info("This is an info message")
And run your program:
python your_program.py
All of the logging and tracing will be automatically tracked and pushed to TraceRoot.AI (demo) platform.

A Simple Example

TraceRoot.AI has been integrated with famous Python libraries like camel. You can easily track the AI agent’s tracing and logging by the following code:
git clone https://github.com/camel-ai/camel.git
cd camel
# Install camel

vim examples/debug/.traceroot-config.yaml
# Put your token to the file

python3 examples/debug/traceroot_example.py

Explore the Loggings and Tracings with AI Agents

You can explore the loggings in the TraceRoot.AI demo platform. Explore Logs You can also show the code with some context by clicking the Show Code button. Show Code Next is the most exciting part, you can ask AI agents to help you on anything you want with your code, loggings, tracings and more. Here is a simple example that ask to summarize the logs and corresponding code: Ask AI At last, you can also check the latency for each of your functions by clicking the Latency button. Latency