Skip to content

Python SDK for AI agent monitoring, LLM cost tracking, benchmarking, and more. Integrates with most LLMs and agent frameworks including CrewAI, Agno, OpenAI Agents SDK, Langchain, Autogen, AG2, and CamelAI

Docs overhaul (#226)

Howard Gilcf67191f13e0
diff --git a/docs/_snippets/snippet-example.mdx b/docs/_snippets/snippet-example.mdx
deleted file mode 100644
index 089334c5..00000000
--- a/docs/_snippets/snippet-example.mdx
+++ /dev/null
@@ -1,3 +0,0 @@
-## My Snippet
-
-<Info>This is an example of a reusable snippet</Info>
diff --git a/docs/img/banner.png b/docs/img/banner.png
deleted file mode 100644
index 9b390b6c..00000000
Binary files a/docs/img/banner.png and /dev/null differ
diff --git a/docs/img/logo.png b/docs/img/logo.png
deleted file mode 100644
index 52575743..00000000
Binary files a/docs/img/logo.png and /dev/null differ
diff --git a/docs/img/overview.png b/docs/img/overview.png
deleted file mode 100644
index a37b84e7..00000000
Binary files a/docs/img/overview.png and /dev/null differ
diff --git a/docs/img/replay.png b/docs/img/replay.png
deleted file mode 100644
index ffc0b8a6..00000000
Binary files a/docs/img/replay.png and /dev/null differ
diff --git a/docs/img/session.png b/docs/img/session.png
deleted file mode 100644
index c1f02580..00000000
Binary files a/docs/img/session.png and /dev/null differ
diff --git a/docs/mint.json b/docs/mint.json
index 52649055..3f797730 100644
--- a/docs/mint.json
+++ b/docs/mint.json
@@ -7,27 +7,49 @@
},
"favicon": "/favicon.png",
"colors": {
- "primary": "#9563FF",
- "light": "#AE87FF",
- "dark": "#0D001D",
+ "primary": "#a9bed4",
+ "light": "#D1E5F7",
+ "dark": "#2b3033",
"background": {
- "dark": "#090014"
+ "light": "#f5faff",
+ "dark": "#18191a"
},
"anchors": {
- "from": "#FF7F57",
- "to": "#9563FF"
+ "from": "#D1E5F7",
+ "to": "#a9bed4"
+
}
},
- "topbarLinks": [
+ "topbarCtaButton": {
+ "name": "Your Dashboard",
+ "url": "https://app.agentops.ai"
+ },
+ "topAnchor": {
+ "name": "Docs",
+ "icon": "lines-leaning"
+ },
+ "anchors": [
+ {
+ "name": "Your Dashboard",
+ "icon": "chart-tree-map",
+ "url": "https://app.agentops.ai"
+ },
+ {
+ "name": "Discord",
+ "icon": "discord",
+ "url": "https://discord.gg/UgJyyxx7uc"
+ },
+ {
+ "name": "GitHub",
+ "icon": "github",
+ "url": "https://github.com/AgentOps-AI"
+ },
{
- "name": "Support",
+ "name": "Call my Agent (Support)",
+ "icon": "headset",
"url": "mailto:[email protected]"
}
],
- "topbarCtaButton": {
- "name": "Dashboard",
- "url": "https://app.agentops.ai"
- },
"navigation": [
{
"group": "Getting Started",
@@ -38,37 +60,42 @@
]
},
{
- "group": "Details",
+ "group": "Concepts",
+ "pages": [
+ "v1/concepts/core-concepts",
+ "v1/concepts/decorators",
+ "v1/concepts/sessions",
+ "v1/concepts/events",
+ "v1/concepts/tags"
+ ]
+ },
+ {
+ "group": "Usage",
"pages": [
- "v1/details/core-concepts",
- "v1/details/sdk-reference",
- "v1/details/sessions",
- "v1/details/events",
- "v1/details/tags",
- "v1/details/decorators",
- "v1/details/recording-events",
- "v1/details/tracking-agents",
- "v1/details/tracking-llm-calls",
- "v1/details/more-models-with-litellm",
- "v1/details/environment-variables"
+ "v1/usage/sdk-reference",
+ "v1/usage/environment-variables",
+ "v1/usage/tracking-llm-calls",
+ "v1/usage/tracking-agents",
+ "v1/usage/recording-events"
]
},
{
"group": "Integrations",
"pages": [
"v1/integrations/crewai",
- "v1/integrations/cohere"
+ "v1/integrations/autogen",
+ "v1/integrations/cohere",
+ "v1/integrations/litellm"
]
},
{
"group": "Other Info",
- "pages": [
- "v1/details/host-env"
- ]
+ "pages": ["v1/concepts/host-env"]
}
],
"footerSocials": {
"twitter": "https://twitter.com/agentopsai",
+ "discord": "https://discord.gg/UgJyyxx7uc",
"github": "https://github.com/AgentOps-AI"
},
"analytics": {
@@ -76,5 +103,10 @@
"apiKey": "phc_BrY3H11IViWSoUJ0QFfjBx7kEwIJMT0PjBEXZQmddW",
"apiHost": "https://us.i.posthog.com"
}
+ },
+ "feedback": {
+ "thumbsRating": true,
+ "suggestEdit": true,
+ "raiseIssue": true
}
}
\ No newline at end of file
diff --git a/docs/snippets/supported-models.mdx b/docs/snippets/supported-models.mdx
new file mode 100644
index 00000000..390bc805
--- /dev/null
+++ b/docs/snippets/supported-models.mdx
@@ -0,0 +1,4 @@
+<Note>
+ At the time of writing, AgentOps offers first class support for `openai` and `cohere` models. However we support many
+ more models such as Llama, Mistral, Claude, and Gemini via LiteLLM. Visit our [LiteLLM docs](/v1/integrations/litellm) to learn more.
+</Note>
\ No newline at end of file
diff --git a/docs/v0/quickstart.mdx b/docs/v0/quickstart.mdx
index 9f0d0220..49147676 100644
--- a/docs/v0/quickstart.mdx
+++ b/docs/v0/quickstart.mdx
@@ -17,7 +17,7 @@ description: "Start using AgentOps in under 5 minutes"
import openai # Make sure openai is imported before instantiating an AgentOps client.
import agentops
-# Beginning of program's code (i.e. main.py, **init**.py)
+# Beginning of program (i.e. main.py, **init**.py)
ao_client = agentops.Client(<INSERT YOUR API KEY HERE>)
diff --git a/docs/v1/details/core-concepts.mdx b/docs/v1/concepts/core-concepts.mdx
similarity index 97%
rename from docs/v1/details/core-concepts.mdx
rename to docs/v1/concepts/core-concepts.mdx
index c3580340..31d4bb6c 100644
--- a/docs/v1/details/core-concepts.mdx
+++ b/docs/v1/concepts/core-concepts.mdx
@@ -1,5 +1,5 @@
---
-title: Core Concepts of AgentOps
+title: Core Concepts
description: An in-depth exploration of the foundational elements and operational dynamics of AgentOps, highlighting its architecture and constituent components.
---
@@ -11,7 +11,7 @@ The AgentOps SDK works to provide as much functionality with as little developer
- Auto-Instrumenting
- After calling `agentops.init()` we automatically look for installed LLM providers and auto-instrument their calls. This allows us to capture calls between your code and the provider to collect data for your dashboard.
- Decorators
- - With [Decorators](/v1/details/decorators), the SDK can add code to your existing functions and classes.
+ - With [Decorators](/v1/concepts/decorators), the SDK can add code to your existing functions and classes.
- Process monitoring
- The SDK establishes a couple process monitors that allow us to understand the state and health of your agents.
diff --git a/docs/v1/details/decorators.mdx b/docs/v1/concepts/decorators.mdx
similarity index 68%
rename from docs/v1/details/decorators.mdx
rename to docs/v1/concepts/decorators.mdx
index 0c7be9ea..ad475993 100644
--- a/docs/v1/details/decorators.mdx
+++ b/docs/v1/concepts/decorators.mdx
@@ -1,6 +1,6 @@
---
title: "Decorators"
-description: "Seemingly magic tools that can be added to functions and classes for easier instrumenting"
+description: "Seemingly magic tools that can be added to functions and classes for easier instrumenting."
---
> Decorators work by wrapping functions or classes that they are placed above. You've probably seen this before.
@@ -14,10 +14,10 @@ description: "Seemingly magic tools that can be added to functions and classes f
## `@track_agent()`
If your implementation uses Classes to denote Agents, this decorator enables automatic agent tracking.
-Learn more about tracking agents [here](/v1/details/tracking-agents).
+Learn more about tracking agents [here](/v1/usage/tracking-agents).
## `@track_function()`
-Sometimes your agent system will use functions that important to track as [`Actions`](/v1/events#actionevent).
+Sometimes your agent system will use functions that are important to track as [`Actions`](/v1/concepts/events/#actionevent).
Adding this decorator above any function will allow every instance of that function call to be tracked and displayed
-in your [Session](v1/details/sessions) Drill-Down on the dashboard.
+in your [Session](v1/concepts/sessions) Drill-Down on the dashboard.
diff --git a/docs/v1/details/events.mdx b/docs/v1/concepts/events.mdx
similarity index 94%
rename from docs/v1/details/events.mdx
rename to docs/v1/concepts/events.mdx
index 05e5e255..38d51b79 100644
--- a/docs/v1/details/events.mdx
+++ b/docs/v1/concepts/events.mdx
@@ -1,6 +1,6 @@
---
title: "Events"
-description: "Agent Event Types"
+description: "AgentOps currently supports four event types: ActionEvent, LLMEvent, ToolEvent, and ErrorEvent."
---
## Event Class
@@ -26,16 +26,18 @@ The `ActionEvent` is a generic event for recording events that do not fit into t
| logs | str | None | "Executed action successfully" | Logs generated during the action event |
| screenshot | str | None | "/path/to/screenshot.png" | Path to screenshot captured during the action event |
-An action event can be used the [same way as other events](./recording-events) but also with the `record_function`
+An action event can be used the [same way as other events](/v1/usage/recording-events) but also with the `record_function`
decorator.
-```python
+<CodeGroup>
+```python python
from agentops import record_function
@record_function()
def some_action(params):
return "some response"
```
+</CodeGroup>
This decorator will record an `ActionEvent` with the params and returns of the function as well as execution time.
@@ -65,7 +67,8 @@ The ToolEvent class is for recording calls to tools e.g. searchWeb, fetchFromDB.
The tool event should be created previous to running the tool in order to track the execution time.
-```python
+<CodeGroup>
+```python python
from agentops import ToolEvent, record
def scrape_website(url: str):
tool_event = ToolEvent(name='scrape_website', params={'url':url}) # the start timestamp is set when the obj is created
@@ -73,6 +76,7 @@ def scrape_website(url: str):
tool_event.returns = result # set result
record(tool_event)
```
+</CodeGroup>
## ErrorEvent
@@ -88,7 +92,8 @@ in execution, up to the developer.
| logs | str | None | "Error occurred at line 10" | Logs related to the error |
| timestamp | str | A timestamp when the ErrorEvent was instantiated | "2023-03-15T18:59:13Z" | Timestamp when the ErrorEvent was created |
-```python
+<CodeGroup>
+```python python
from agentops import ToolEvent, record, ErrorEvent
def scrape_website(url: str):
tool_event = ToolEvent(name='scrape_website', params={'url':url}) # the start timestamp is set when the obj is created
@@ -99,3 +104,4 @@ def scrape_website(url: str):
record(ErrorEvent(message=e, trigger_event=tool_event))
record(tool_event)
```
+</CodeGroup>
diff --git a/docs/v1/details/host-env.mdx b/docs/v1/concepts/host-env.mdx
similarity index 57%
rename from docs/v1/details/host-env.mdx
rename to docs/v1/concepts/host-env.mdx
index 6a5a9556..6be89111 100644
--- a/docs/v1/details/host-env.mdx
+++ b/docs/v1/concepts/host-env.mdx
@@ -23,16 +23,10 @@ and is never sold or shared.
## Opting-Out
-AgentOps users can opt out of certain environment data collection by setting an environment variable.
+AgentOps users can opt out of certain environment data collection by setting the following environment variable.
```
AGENTOPS_ENV_DATA_OPT_OUT=True
```
-Using an environment variable allows you to disable tracking of this data while developing on a local machine. You
-can enable it again when deploying in a production environment.
-
-Opting out is not recommended by AgentOps, as it reduces information used to debug in the agent development process,
-[but AgentOps respects our privacy](mailto:[email protected]) conscious users and has made opting out available.
-
-For more questions on privacy and data usage, please contact us on our official [Discord](https://discord.gg/UgJyyxx7uc).
\ No newline at end of file
+For more questions on privacy and data usage, please [send us an email](mailto:[email protected])
\ No newline at end of file
diff --git a/docs/v1/details/sessions.mdx b/docs/v1/concepts/sessions.mdx
similarity index 92%
rename from docs/v1/details/sessions.mdx
rename to docs/v1/concepts/sessions.mdx
index 754fbc8f..6f53eac8 100644
--- a/docs/v1/details/sessions.mdx
+++ b/docs/v1/concepts/sessions.mdx
@@ -34,11 +34,11 @@ Optionally, sessions may include:
When you call `agentops.init()`, a session is automatically started.
Calling `agentops.init(auto_start_session=False)` will initialize the AgentOps SDK but not start a session.
-To start a session later, call `agentops.start_session()` [(reference)](https://docs.agentops.ai/v1/details/sdk-reference#start-session)
+To start a session later, call `agentops.start_session()` [(reference)](/v1/usage/sdk-reference/#start-session)
## Ending a Session
If a process ends without any call to agentops, it will show in the dashboard as `Indeterminate`.
-To end with a state, call `agentops.end_session()` [(reference)](https://docs.agentops.ai/v1/details/sdk-reference#end-session)
+To end with a state, call `agentops.end_session()` [(reference)](/v1/usage/sdk-reference/#end-session)
## Inherited Sessions
When working with multiple agents running in different processes, it's possible to initialize AgentOps or start a session
@@ -49,7 +49,8 @@ with an existing session_id.
You can retrieve the current session_id by assigning the returned value from `init()` or `start_session()`
-```python
+<CodeGroup>
+```python python
import agentops
session_id = agentops.init()
# pass session_id to the other process
@@ -58,6 +59,7 @@ session_id = agentops.init()
session_id = retrieve_session_id()
agentops.init(inherited_session_id=<id>)
```
+</CodeGroup>
Both processes will now contribute data to the same session.
@@ -67,4 +69,4 @@ _More info for the curious_
Under the hood, `agentops.init()` sets up a `Client` object with various configuration options like your API key, worker thread options
for when to send out batches of events, etc. Whenever you start a new session, these configuration options will automatically
be applied. You can also apply different configuration options when you start a new session by passing in a
-[Configuration](https://docs.agentops.ai/v1/details/sdk-reference#configuration) object.
\ No newline at end of file
+[Configuration](/v1/usage/sdk-reference/#configuration) object.
\ No newline at end of file
diff --git a/docs/v1/details/tags.mdx b/docs/v1/concepts/tags.mdx
similarity index 63%
rename from docs/v1/details/tags.mdx
rename to docs/v1/concepts/tags.mdx
index 91e2795b..e3f405a8 100644
--- a/docs/v1/details/tags.mdx
+++ b/docs/v1/concepts/tags.mdx
@@ -1,38 +1,44 @@
---
title: Tags
-description: What are Tags and how to use them.
+description: 'Tags are a fantastic way to organize your Sessions based on data known by the developer but not by AgentOps.
+Ex: `paid-user`, `v3`, `recruiter-agent`'
---
-Tags are a fantastic way to organize your Sessions based on data known by the developer but not by AgentOps.
-Ex: `paid-user`, `v3`, `recruiter-agent`
+
# How to use Tags
-Tags belong to [Sessions](/v1/details/tags), but can be assigned in multiple ways.
+Tags belong to [Sessions](/v1/concepts/tags), but can be assigned in multiple ways.
## On `init()`
Passing tags into the `init` function will assign these tags to the `Session`
-```python
+<CodeGroup>
+```python python
agentops.init(tags=['test tag'])
```
+</CodeGroup>
## `set_tags([str])`
This will override any existing tags on the session and set them to the value passed into the function.
-```python
+<CodeGroup>
+```python python
agentops.set_tags(['test new tag'])
```
+</CodeGroup>
## `add_tags([str])`
This will append an array of tags to the Session's existing tags
-```python
+<CodeGroup>
+```python python
agentops.add_tags(['appended tag'])
```
+</CodeGroup>
# Sorting by tags
diff --git a/docs/v1/details/environment-variables.mdx b/docs/v1/details/environment-variables.mdx
deleted file mode 100644
index 34def78c..00000000
--- a/docs/v1/details/environment-variables.mdx
+++ /dev/null
@@ -1,24 +0,0 @@
----
-title: "Environment Variables"
-description: "Environment Variables that AgentOps will look for"
-mode: "wide"
----
-
-### Sample .env file
-
-```python .env
-# API KEY for using AgentOps. Find this in your settings page
-AGENTOPS_API_KEY=<YOUR API KEY>
-
-##########################################################
-# Only copy the following if you're going to override them
-
-# (OPTIONAL) Secondary API Key for simultaneously recording to a second project
-AGENTOPS_PARENT_KEY=<YOUR PARENT KEY>
-# (OPTIONAL) The AgentOps API endpoint. Defaults to https://api.agentops.ai
-AGENTOPS_API_ENDPOINT=https://api.agentops.ai
-# (OPTIONAL) Logging level. <DEBUG, INFO, CRITICAL>
-AGENTOPS_LOGGING_LEVEL=INFO
-# (OPTIONAL) Whether to opt out of recording environment data. <FALSE, TRUE>
-AGENTOPS_ENV_DATA_OPT_OUT=FALSE
-```
\ No newline at end of file
diff --git a/docs/v1/examples.mdx b/docs/v1/examples.mdx
index 44432abd..63d9d79f 100644
--- a/docs/v1/examples.mdx
+++ b/docs/v1/examples.mdx
@@ -7,10 +7,10 @@ mode: "wide"
## Explore our example code to see AgentOps in action!
<CardGroup cols={2}>
- <Card title="Basic Example" icon="square-code" href="https://github.com/AgentOps-AI/agentops-py/blob/main/examples/openai-gpt.ipynb">
+ <Card title="Simple Agent" icon="person-carry-box" iconType="solid" href="https://github.com/AgentOps-AI/agentops-py/blob/main/examples/openai-gpt.ipynb">
Jupyter Notebook with sample code that you can run! Start here!
</Card>
- <Card title="Multi-Agent Code Example" icon="object-group" href="https://github.com/AgentOps-AI/agentops-py/blob/main/examples/multi_agent_example.ipynb">
+ <Card title="Multi-Agent Code Example" icon="people-arrows" iconType="duotone" href="https://github.com/AgentOps-AI/agentops-py/blob/main/examples/multi_agent_example.ipynb">
Jupyter Notebook with a simple multi-agent design
</Card>
<Card title="LangChain Example" icon="link" href="https://github.com/AgentOps-AI/agentops-py/blob/main/examples/langchain_examples.ipynb">
@@ -24,11 +24,11 @@ mode: "wide"
## Video Guides
<CardGroup cols={2}>
- <Card title="Simple Agent" icon="object-group" href="https://www.loom.com/share/0e0d2986f3d644a58d1e186dc81cd8b1">
+ <Card title="Simple Agent" icon="person-carry-box" iconType="solid" href="https://www.loom.com/share/0e0d2986f3d644a58d1e186dc81cd8b1">
Add AgentOps to a simple chat completion
![thumbnail](https://cdn.loom.com/sessions/thumbnails/0e0d2986f3d644a58d1e186dc81cd8b1-with-play.gif)
</Card>
- <Card title="Multi-Agent" icon="link" href="https://www.loom.com/share/2a62fd70efe8423fb495946b09c2d8ac">
+ <Card title="Multi-Agent" icon="people-arrows" iconType="duotone" href="https://www.loom.com/share/2a62fd70efe8423fb495946b09c2d8ac">
Jupyter Notebook with a sample LangChain integration
![thumbnail](https://cdn.loom.com/sessions/thumbnails/2a62fd70efe8423fb495946b09c2d8ac-with-play.gif)
</Card>
@@ -36,4 +36,8 @@ mode: "wide"
CrewAI multi-agent framework with AgentOps support
![thumbnail](https://cdn.loom.com/sessions/thumbnails/cfcaaef8d4a14cc7a974843bda1076bf-1713568618224-with-play.gif)
</Card>
-</CardGroup>
\ No newline at end of file
+ <Card title="Cohere" icon="hill-rockslide" href="https://www.loom.com/share/679d65cc06f148299e8dffc459d053ab">
+ First class support for Command-R-Plus
+ ![thumbnail](https://cdn.loom.com/sessions/thumbnails/679d65cc06f148299e8dffc459d053ab-with-play.gif)
+ </Card>
+</CardGroup>
diff --git a/docs/v1/integrations/autogen.mdx b/docs/v1/integrations/autogen.mdx
new file mode 100644
index 00000000..058ea617
--- /dev/null
+++ b/docs/v1/integrations/autogen.mdx
@@ -0,0 +1,8 @@
+---
+title: Autogen
+description: "AgentOps provides first class support for Autogen"
+---
+
+<Note>
+Documentation for this integration is coming soon.
+</Note>
\ No newline at end of file
diff --git a/docs/v1/integrations/cohere.mdx b/docs/v1/integrations/cohere.mdx
index 7da43477..cf5d524d 100644
--- a/docs/v1/integrations/cohere.mdx
+++ b/docs/v1/integrations/cohere.mdx
@@ -1,82 +1,116 @@
---
title: Cohere
-description: "AgentOps's support for Cohere(>=5.4.0) is first class. This is a living integration, should you need any added functionality please message us on Discord!"
+description: "AgentOps provides first class support for Cohere"
---
-## Install the SDK
+<Note>
+This is a living integration. Should you need any added functionality message us on [Discord](https://discord.gg/UgJyyxx7uc)!
+</Note>
+
+<Card title="Cohere" icon="hill-rockslide" href="https://www.loom.com/share/679d65cc06f148299e8dffc459d053ab">
+ First class support for Command-R-Plus
+ ![thumbnail](https://cdn.loom.com/sessions/thumbnails/679d65cc06f148299e8dffc459d053ab-with-play.gif)
+</Card>
+
+<Steps>
+ <Step title="Install the AgentOps SDK">
+ <CodeGroup>
+ ```bash pip
+ pip install agentops
+ ```
+ ```bash poetry
+ poetry add agentops
+ ```
+ </CodeGroup>
+ <Check>[Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub while you're at it (you may be our 1,000th 😊)</Check>
+ </Step>
+ <Step title="Add 3 lines of code">
+ <CodeGroup>
+ ```python python
+ import agentops
+
+ # Beginning of program (i.e. main.py, __init__.py)
+ # IMPORTANT: Must be before calling `co = cohere.Client()`
+ agentops.init(<INSERT YOUR API KEY HERE>)
+ co = cohere.Client()
+ ...
+ # End of program (e.g. main.py)
+ agentops.end_session("Success") # Success|Fail|Indeterminate
+ ```
+ </CodeGroup>
+ <Warning>
+ Requires cohere>=5.4.0
+ </Warning>
+ <Check>
+ Instantiating the AgentOps client will automatically instrument Cohere, meaning you will be able to see all
+ of your sessions on the AgentOps Dashboard along with the full LLM chat histories, cost, token counts, etc.
+ </Check>
+ <Tip>
+ For more features see our [Usage](/v1/usage) section.
+ </Tip>
+ </Step>
+ <Step title="Set your API key">
+ Retrieve an API Key from your Settings > [Projects & API Keys](https://app.agentops.ai/settings/projects) page.
+ <Frame type="glass" caption="Settings > Projects & API Keys">
+ <img height="200" src="/images/api-keys.png" />
+ </Frame>
+ <Info>
+ API keys are tied to individual projects.<br></br>
+ A Default Project has been created for you, so just click Copy API Key
+ </Info>
+ Set this API Key in your [environment variables](/v1/usage/environment-variables)
+ ```python .env
+ AGENTOPS_API_KEY=<YOUR API KEY>
+ ```
+ </Step>
+ <Step title="Run your crew">
+ Execute your program and visit [app.agentops.ai/drilldown](https://app.agentops.ai/drilldown) to observe your Agents! 🕵️
+ <Tip>
+ After your run, AgentOps prints a clickable url to console linking directly to your session in the Dashboard
+ </Tip>
+ <div/>{/* Intentionally blank div for newline */}
+ <Frame type="glass" caption="Clickable link to session">
+ <img height="200" src="/images/link-to-session.gif" />
+ </Frame>
+ </Step>
+</Steps>
+
+## Full Examples
<CodeGroup>
-```bash pip
-pip install agentops
-```
-```bash poetry
-poetry add agentops
-```
-</CodeGroup>
+ ```python chat()
+ import cohere
+ import agentops
-## Get an API key
+ agentops.init(<INSERT YOUR API KEY HERE>)
-Retrieve an API Key from the Settings > [Projects & API Keys](https://app.agentops.ai/settings/projects) page.
+ co = cohere.Client()
-API keys are tied to individual projects.<br></br>
-A Default Project has been created for you, so just click <span style={{ padding: "5px 10px", backgroundColor: "black", color: "white", borderRadius: "5px"}}>Copy API Key</span>
+ chat = co.chat(
+ message="Is it pronounced ceaux-hear or co-hehray?"
+ )
-{/* TODO: Install Tailwind for this stuff */}
+ print(chat)
-<div
- style={{ backgroundColor: "#f0f0f0", padding: "20px", borderRadius: "10px" }}
->
- <img height="200" src="/images/api-keys.png" />
-</div>
+ agentops.end_session('Success')
+ ```
+ ```python chat_stream()
+ import cohere
+ import agentops
-## Using AgentOps with Cohere
+ agentops.init(<INSERT YOUR API KEY HERE>)
-<div style={{ color: "#880000" }}>Requires cohere>=5.4.0</div>
+ co = cohere.Client()
-Initialize the AgentOps client and automatically get analytics on every LLM call.
+ stream = co.chat_stream(
+ message="Write me a haiku about the synergies between Cohere and AgentOps"
+ )
-```python python
-import cohere
-import agentops
+ for event in stream:
+ if event.event_type == "text-generation":
+ print(event.text, end='')
-# Beginning of program's code (i.e. main.py, __init__.py)
-agentops.init(<INSERT YOUR API KEY HERE>)
-
-co = cohere.Client()
-
-chat = co.chat(
- message="Is it pronounced ceaux-hear or co-hehray?"
-)
-
-print(chat)
-
-agentops.end_session('Success')
-```
-
-```python python
-import cohere
-import agentops
-
-# Beginning of program's code (i.e. main.py, __init__.py)
-agentops.init(<INSERT YOUR API KEY HERE>)
-
-co = cohere.Client()
-
-stream = co.chat_stream(
- message="Write me a haiku about the synergies between Cohere and AgentOps"
-)
-
-for event in stream:
- if event.event_type == "text-generation":
- print(event.text, end='')
-
-agentops.end_session('Success')
-```
-
-### Explanation
-When openai has been imported, instantiating the AgentOps client will automatically
-instrument chat completions. You will be able to see all of your sessions on the AgentOps
-dashboard along with the full LLM chat histories, cost, token counts, etc.
-
-For more features see our Details section.
\ No newline at end of file
+ agentops.end_session('Success')
+ ```
+</CodeGroup>
\ No newline at end of file
diff --git a/docs/v1/integrations/crewai.mdx b/docs/v1/integrations/crewai.mdx
index 1cc2d61d..6a9dfb52 100644
--- a/docs/v1/integrations/crewai.mdx
+++ b/docs/v1/integrations/crewai.mdx
@@ -1,52 +1,101 @@
---
title: 'CrewAI'
-description: 'Using CrewAI with AgentOps'
+description: '[CrewAI](https://crewai.io) is a framework for easily building multi-agent applications.'
---
-## Overview
-[CrewAI](https://crewai.io) is a framework for easily building multi-agent applications.
-
AgentOps and CrewAI teamed up to make monitoring Crew agents dead simple.
-## Setup
-
-> 🚨 NOTE: At this time, Crew with AgentOps integration is in pre-release. In the interim, an official fork has been
-made available. After official support is released, this fork will be deprecated and developers will
-be encouraged to use the core Crew SDK.
-
-**Install crew from the AgentOps Fork:**
-
-<CodeGroup>
-```bash pip
-pip install git+https://github.com/AgentOps-AI/crewAI.git@main
-```
-```bash poetry
-poetry add git+https://github.com/AgentOps-AI/crewAI.git@main
-```
-</CodeGroup>
-
-## Using Crew
-Crew has comprehensive [documentation](https://docs.crewai.com) available as well as a great [Crew Quickstart](https://docs.crewai.com/how-to/Creating-a-Crew-and-kick-it-off/).
+<Card title="Crew.ai + AgentOps" icon="ship" href="https://www.loom.com/share/cfcaaef8d4a14cc7a974843bda1076bf">
+ CrewAI multi-agent framework with AgentOps support
+ ![thumbnail](https://cdn.loom.com/sessions/thumbnails/cfcaaef8d4a14cc7a974843bda1076bf-1713568618224-with-play.gif)
+</Card>
+Crew has comprehensive [documentation](https://docs.crewai.com) available as well as a great [quickstart](https://docs.crewai.com/how-to/Creating-a-Crew-and-kick-it-off/).
## Adding AgentOps to Crew agents
-Create a user API key here: https://app.agentops.ai/account
-
-Add your API key to your environment variables
-
-```
-AGENTOPS_API_KEY=<YOUR_AGENTOPS_API_KEY>
-```
+<Steps>
+ <Step title="Install the AgentOps SDK">
+ <CodeGroup>
+ ```bash pip
+ pip install agentops
+ ```
+ ```bash poetry
+ poetry add agentops
+ ```
+ </CodeGroup>
+ <Check>
+ [Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub while you're at it (you may be our 1,000th 😊)
+ </Check>
+ </Step>
+ <Step title="Install Crew from the AgentOps fork">
+ <Warning>
+ At this time, Crew with AgentOps integration is in pre-release. In the interim, an official fork has been
+ made available. After official support is released, this fork will be deprecated and developers will
+ be encouraged to use the core Crew SDK.
+ </Warning>
+ <CodeGroup>
+ ```bash pip
+ pip install git+https://github.com/AgentOps-AI/crewAI.git@main
+ ```
+ ```bash poetry
+ poetry add git+https://github.com/AgentOps-AI/crewAI.git@main
+ ```
+ </CodeGroup>
+ </Step>
+ <Step title="Add 3 lines of code">
+ 1. Before calling the `Crew()` constructor in your code, call `agentops.init()`
+ 2. At the end of your Crew run, call `agentops.end_session("Success")`
+ <CodeGroup>
+ ```python python
+ import agentops
-Before calling the constructor `Crew()` in your script, include these lines:
+ # Beginning of program (i.e. main.py, __init__.py)
+ # IMPORTANT: Must be before calling the `Crew()` constructor
+ agentops.init(<INSERT YOUR API KEY HERE>)
+ ...
+ # End of program (e.g. main.py)
+ agentops.end_session("Success") # Success|Fail|Indeterminate
+ ```
+ </CodeGroup>
+ <Check>
+ Instantiating the AgentOps client will automatically instrument Crew, meaning you will be able to see all
+ of your sessions on the AgentOps Dashboard along with the full LLM chat histories, cost, token counts, etc.
+ </Check>
+ <Tip>
+ For more features see our [Usage](/v1/usage) section.
+ </Tip>
+ </Step>
+ <Step title="Set your API key">
+ Retrieve an API Key from your Settings > [Projects & API Keys](https://app.agentops.ai/settings/projects) page.
+ <Frame type="glass" caption="Settings > Projects & API Keys">
+ <img height="200" src="/images/api-keys.png" />
+ </Frame>
+ <Info>
+ API keys are tied to individual projects.<br></br>
+ A Default Project has been created for you, so just click Copy API Key
+ </Info>
+ Set this API Key in your [environment variables](/v1/usage/environment-variables)
+ ```python .env
+ AGENTOPS_API_KEY=<YOUR API KEY>
+ ```
+ </Step>
+ <Step title="Run your crew">
+ Execute your program and visit [app.agentops.ai/drilldown](https://app.agentops.ai/drilldown) to observe your Crew! 🕵️
+ <Tip>
+ After your run, AgentOps prints a clickable url to console linking directly to your session in the Dashboard
+ </Tip>
+ <div/>{/* Intentionally blank div for newline */}
+ <Frame type="glass" caption="Clickable link to session">
+ <img height="200" src="/images/link-to-session.gif" />
+ </Frame>
+ </Step>
+</Steps>
-```python
-import agentops
-agentops.init()
-```
+## Crew + AgentOps Examples
-### Crew + AgentOps Examples
-- [Job Posting](https://github.com/Agentops-AI/crewAI-examples/tree/main/job-posting)
-- [Markdown Validator](https://github.com/Agentops-AI/crewAI-examples/tree/main/markdown_validator)
-- [Instagram Post](https://github.com/Agentops-AI/crewAI-examples/tree/main/instagram_post)
+<CardGroup cols={3}>
+ <Card title="Job Posting" icon="briefcase" href="https://github.com/Agentops-AI/crewAI-examples/tree/main/job-posting" />
+ <Card title="Instagram Post" icon="instagram" href="https://github.com/Agentops-AI/crewAI-examples/tree/main/instagram_post" />
+ <Card title="Markdown Validator" icon="markdown" href="https://github.com/Agentops-AI/crewAI-examples/tree/main/markdown_validator" />
+</CardGroup>
\ No newline at end of file
diff --git a/docs/v1/details/more-models-with-litellm.mdx b/docs/v1/integrations/litellm.mdx
similarity index 97%
rename from docs/v1/details/more-models-with-litellm.mdx
rename to docs/v1/integrations/litellm.mdx
index e692cdf4..0000cf59 100644
--- a/docs/v1/details/more-models-with-litellm.mdx
+++ b/docs/v1/integrations/litellm.mdx
@@ -1,5 +1,5 @@
---
-title: More Models with LiteLLM
+title: LiteLLM
description: "Call the latest models using the OpenAI format including:
Llama, Mistral, Claude, Gemini, Gemma, Dall-E, Whisper"
---
diff --git a/docs/v1/introduction.mdx b/docs/v1/introduction.mdx
index 291d7be1..af0b1319 100644
--- a/docs/v1/introduction.mdx
+++ b/docs/v1/introduction.mdx
@@ -8,12 +8,12 @@ mode: "wide"
# AgentOps is your new terminal
-<Card title="Terminals suck" icon="trash" iconType="solid" color="#CC0000">
+<Card title="Terminals suck" icon="trash" iconType="solid" color="#d6483e">
- • Lose track of what your agents did in between executions
- • Parsing through terminal output searching for LLM completions
- • Printing "tool called"
</Card>
-<Card title="AgentOps doesn't" icon="face-smile-halo" iconType="duotone" color="#00CC00">
+<Card title="AgentOps doesn't" icon="face-smile-halo" iconType="regular" color="#2bd600">
- • Visual dashboard so you can see what your agents did in human-readable format
- • LLM calls are magically recorded - prompt, completion, timestamps for each - with one line of code
- • Agents and their events (including tool calls) are recorded with one more line of code
diff --git a/docs/v1/quickstart.mdx b/docs/v1/quickstart.mdx
index 06cb096a..3247c469 100644
--- a/docs/v1/quickstart.mdx
+++ b/docs/v1/quickstart.mdx
@@ -2,9 +2,10 @@
title: "Quickstart"
description: "Start using AgentOps with just 2 lines of code"
---
+import SupportedModels from '/snippets/supported-models.mdx'
<Steps>
- <Step title="Install the SDK">
+ <Step title="Install the AgentOps SDK">
<CodeGroup>
```bash pip
pip install agentops
@@ -18,26 +19,24 @@ description: "Start using AgentOps with just 2 lines of code"
<Step title="Add 2 lines of code">
<CodeGroup>
```python python
- # IMPORTANT: Must be after 'import openai' or 'from crewai import Agent' etc
import agentops
- # Beginning of program's code (i.e. main.py, __init__.py)
+ # Beginning of program (i.e. main.py, __init__.py)
+ # IMPORTANT: Must be before any OpenAI, Cohere, Crew, etc constructors are called
+ # e.g. before client = OpenAI(...)
agentops.init(<INSERT YOUR API KEY HERE>)
```
</CodeGroup>
<Check>Just these two lines and you have magically tracked LLM calls!</Check>
<Tip>
- After the `openai`, `litellm`, or `cohere` packages have been imported, importing + instantiating the AgentOps client
- will automatically instrument them, meaning you will be able to see all of your sessions on the AgentOps
- DEBUGashboard along with the full LLM chat histories, cost, token counts, etc.
+ After the `openai`, `cohere`, or `litellm` packages have been imported, importing + instantiating the AgentOps client
+ will automatically instrument them, meaning you will be able to see all of your sessions on the AgentOps Dashboard
+ along with the full LLM chat histories, cost, token counts, etc.
</Tip>
-
+ <SupportedModels />
</Step>
- <Step title="Get an API key">
- Retrieve an API Key from the Settings > [Projects & API Keys](https://app.agentops.ai/settings/projects) page.
- <div/>{/* Intentionally blank div for newline */}
- Set this API Key in your [environment variables](/v1/details/environment-variables)
-
+ <Step title="Set your API key">
+ Retrieve an API Key from your Settings > [Projects & API Keys](https://app.agentops.ai/settings/projects) page.
<Frame type="glass" caption="Settings > Projects & API Keys">
<img height="200" src="/images/api-keys.png" />
</Frame>
@@ -46,7 +45,10 @@ description: "Start using AgentOps with just 2 lines of code"
API keys are tied to individual projects.<br></br>
A Default Project has been created for you, so just click Copy API Key
</Info>
- {/* TODO: Install Tailwind for this stuff */}
+ Set this API Key in your [environment variables](/v1/usage/environment-variables)
+ ```python .env
+ AGENTOPS_API_KEY=<YOUR API KEY>
+ ```
</Step>
<Step title="Run your agent">
Execute your program and visit [app.agentops.ai/drilldown](https://app.agentops.ai/drilldown) to observe your Agent! 🕵️
@@ -78,7 +80,7 @@ description: "Start using AgentOps with just 2 lines of code"
</Card>
<Card icon="robot" title="Track Agents">
- If you use specific named agents within your system, you can tie all downstream [Events](/v1/details/events) to a
+ If you use specific named agents within your system, you can tie all downstream [Events](/v1/concepts/events) to a
Named Agent with the `@track_agent` decorator.
```python python
# (track a named agent)
@@ -109,7 +111,7 @@ Here is the complete code from the sections above
import openai
import agentops
-# Beginning of program's code (i.e. main.py, __init__.py)
+# Beginning of program (i.e. main.py, __init__.py)
agentops.init(<INSERT YOUR API KEY HERE>)
# (record specific functions)
@@ -148,7 +150,7 @@ agentops.end_session('Success')
>
Record all of your other events the way AgentOps intends.
</Card>
- <Card title="Tracking Agents" icon="robot" href="/v1/details/tracking-agents">
+ <Card title="Tracking Agents" icon="robot" href="/v1/usage/tracking-agents">
Associate Events with specific named agents.
</Card>
</CardGroup>
\ No newline at end of file
diff --git a/docs/v1/usage/environment-variables.mdx b/docs/v1/usage/environment-variables.mdx
new file mode 100644
index 00000000..1b1e82c7
--- /dev/null
+++ b/docs/v1/usage/environment-variables.mdx
@@ -0,0 +1,27 @@
+---
+title: "Environment Variables"
+mode: "wide"
+---
+
+In AgentOps fashion, you only need to add one line of "code" to your `.env` file 😊
+
+```python .env
+AGENTOPS_API_KEY=<YOUR API KEY>
+```
+
+<Tip>
+Find your AgentOps API Key in your Settings > [Projects & API Keys](https://app.agentops.ai/settings/projects) page.
+</Tip>
+
+#### Optional settings:
+
+```python .env
+# Secondary API Key for simultaneously recording to a second project
+AGENTOPS_PARENT_KEY=<YOUR PARENT KEY>
+# The AgentOps API endpoint. Defaults to https://api.agentops.ai
+AGENTOPS_API_ENDPOINT=https://api.agentops.ai
+# Logging level. <DEBUG, INFO, CRITICAL>. Defaults to INFO
+AGENTOPS_LOGGING_LEVEL=INFO
+# Whether to opt out of recording environment data. <FALSE, TRUE>. Defaults to FALSE
+AGENTOPS_ENV_DATA_OPT_OUT=FALSE
+```
\ No newline at end of file
diff --git a/docs/v1/details/langchain-callback-handler.mdx b/docs/v1/usage/langchain-callback-handler.mdx
similarity index 100%
rename from docs/v1/details/langchain-callback-handler.mdx
rename to docs/v1/usage/langchain-callback-handler.mdx
diff --git a/docs/v1/details/recording-events.mdx b/docs/v1/usage/recording-events.mdx
similarity index 94%
rename from docs/v1/details/recording-events.mdx
rename to docs/v1/usage/recording-events.mdx
index 88c8a215..3a363964 100644
--- a/docs/v1/details/recording-events.mdx
+++ b/docs/v1/usage/recording-events.mdx
@@ -27,7 +27,7 @@ The decorator will record the function's parameters, returns, and the time durat
From this point, simply call the .record() method in the AgentOps client:
-Record any child of the [Event type](./events) or ErrorEvent.
+Record any child of the [Event type](/v1/concepts/events) or ErrorEvent.
```python python
from agentops import record, ActionEvent
diff --git a/docs/v1/details/sdk-reference.mdx b/docs/v1/usage/sdk-reference.mdx
similarity index 89%
rename from docs/v1/details/sdk-reference.mdx
rename to docs/v1/usage/sdk-reference.mdx
index ece2d7d9..3bd5fd57 100644
--- a/docs/v1/details/sdk-reference.mdx
+++ b/docs/v1/usage/sdk-reference.mdx
@@ -34,12 +34,12 @@ The first element of AgentOps is always calling .init()
### `start_session()`
-Start a new [Session](https://docs.agentops.ai/v1/details/sessions) for recording events.
+Start a new [Session](/v1/concepts/sessions) for recording events.
**Parameters**:
- `tags` (List[str], optional): Tags for the session.
-- `config` ([Configuration](https://docs.agentops.ai/v1/details/sdk-reference#configuration), optional): Client configuration object.
+- `config` ([Configuration](#configuration), optional): Client configuration object.
- `inherited_session_id` (str, optional): Session ID to continue from an existing session.
**Returns**:
@@ -112,8 +112,8 @@ Set the parent API key which has visibility over projects it is a parent of.
### `stop_instrumenting()`
-Stop instrumenting LLM calls. This is typically used by agent frameworks (i.e. [CrewAI](https://docs.agentops.ai/v1/integrations/crewai),
-[autogen](https://docs.agentops.ai/v1/integrations/autogen)) to stop using the AgentOps auto instrumentation of LLM libraries like OpenAI. This
+Stop instrumenting LLM calls. This is typically used by agent frameworks (i.e. [CrewAI](/v1/integrations/crewai),
+[autogen](/v1/integrations/autogen)) to stop using the AgentOps auto instrumentation of LLM libraries like OpenAI. This
allows these frameworks to use their own instrumenting or callback handler.
@@ -147,7 +147,7 @@ Stores the configuration settings for AgentOps clients.
### `LangchainCallbackHandler`
-[Reference](https://docs.agentops.ai/v1/details/langchain-callback-handler)
+[Reference](/v1/usage/langchain-callback-handler)
This callback handler is intended to be used as an option in place of AgentOps auto-instrumenting. This is only useful
when using Langchain as your LLM calling library.
\ No newline at end of file
diff --git a/docs/v1/details/tracking-agents.mdx b/docs/v1/usage/tracking-agents.mdx
similarity index 100%
rename from docs/v1/details/tracking-agents.mdx
rename to docs/v1/usage/tracking-agents.mdx
diff --git a/docs/v1/details/tracking-llm-calls.mdx b/docs/v1/usage/tracking-llm-calls.mdx
similarity index 100%
rename from docs/v1/details/tracking-llm-calls.mdx
rename to docs/v1/usage/tracking-llm-calls.mdx