Quickstart
Start using AgentOps with just 2 lines of code
Install the AgentOps SDK
Add 2 lines of code
Make sure to call agentops.init
before calling any openai
, cohere
, crew
, etc models.
Get an AgentOps API key here
Set your API key as an .env
variable for easy access.
Run your agent
Execute your program and visit app.agentops.ai/drilldown to observe your Agent! 🕵️
Clickable link to session
More basic functionality
Decorate Operations
You can instrument functions inside your code with the @operation
decorator, which will create spans that track function execution, parameters, and return values. These operations will be displayed in your session visualization alongside LLM calls.
Track Agents
If you use specific named agents within your system, you can create agent spans that contain all downstream operations using the @agent
decorator.
Creating Sessions
Create a session to group all your agent operations by using the @session
decorator. Sessions serve as the root span for all operations.
Example Code
Here is the complete code from the sections above
Simple Code Example
Jupyter Notebook with sample code that you can run!
That’s all you need to get started! Check out the documentation below to see how you can record other operations. AgentOps is a lot more powerful this way!