Prerequisites
1. Install the Trajectory SDK
Install the Trajectory SDK using pip (project page at trajectoryevals):2. Get Your API Credentials
To use Trajectory AI, you’ll need to generate an API key from the dashboard and configure it in your environment.Step 1: Create an Account and Access Dashboard
First, create an account at trajectoryevals.com and access the dashboard.
Step 2: Navigate to API Keys
Once you’re in the dashboard, navigate to the API Keys section.
Step 3: Generate and Copy Your API Key
Click on Generate API Key to create a new API key, then copy it to your clipboard.
Step 4: Configure Environment Variables
Create a.env file in your project directory and add the following environment variables:
Note: TRAJECTORY_ORG_ID can be any name you choose to identify your organization. This is used to organize your projects and traces.
Configuration
Create aconfig.yaml file in your project directory with the following configuration:
Running the Mock Server
Start the mock server using the following command:Running Evaluations
Once the mock server is running, you can execute your evaluation script. Here’s an example evaluation script:run_workday_eval.py
Example Agent Implementation
Here’s an example Workday agent implementation that demonstrates how to use the Trajectory tracer:simple_workday_agent.py
Execute the Evaluation
Run your evaluation script with the config file:- Make sure the mock server is running before executing your evaluation script
- All traces and metrics will be automatically sent to your Trajectory dashboard
- Use the dashboard to analyze agent performance, debug issues, and improve your agent over time

