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

Introducing V2 Documentation with Comprehensive Updates (#938)

Dwij70b8929086ac
diff --git a/docs/images/external/google-adk/google-adk-logo.png b/docs/images/external/google-adk/google-adk-logo.png
new file mode 100644
index 00000000..9f967caa
Binary files /dev/null and b/docs/images/external/google-adk/google-adk-logo.png differ
diff --git a/docs/images/external/ibm/ibm-logo.svg b/docs/images/external/ibm/ibm-logo.svg
new file mode 100644
index 00000000..e109afbe
--- /dev/null
+++ b/docs/images/external/ibm/ibm-logo.svg
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Designed by Vexels.com - 2017 All Rights Reserved - https://vexels.com/terms-and-conditions/ -->
+
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="1200px" height="1200px" viewBox="0 0 1200 1200" enable-background="new 0 0 1200 1200" xml:space="preserve">
+<g>
+ <g>
+ <g>
+ <defs>
+ <path id="SVGID_1_" d="M552.971,598.824c58.429-53.542,51.129-86.661,51.129-86.661
+ c-3.41-100.778-104.913-101.596-104.913-101.596H308.256v78.391l50.454,0.818v220.552h-51.123v78.871h194.271
+ c95.423-2.435,100.778-89.581,100.778-89.581C607.991,640.211,552.971,598.824,552.971,598.824z M441.484,495.123h75.465v56.477
+ h-75.465V495.123z M518.41,707.891h-76.926v-62.319h76.926V707.891z"/>
+ </defs>
+ <clipPath id="SVGID_2_">
+ <use xlink:href="#SVGID_1_" overflow="visible"/>
+ </clipPath>
+ <g clip-path="url(#SVGID_2_)">
+ <rect x="50" y="737.811" fill="#FFFFFF" width="1048.275" height="22.709"/>
+ <rect x="50" y="759.453" width="1048.275" height="29.343"/>
+ <rect x="50" y="690.589" fill="#FFFFFF" width="1048.275" height="22.709"/>
+ <rect x="50" y="712.227" width="1048.275" height="29.338"/>
+ <rect x="50" y="639.427" fill="#FFFFFF" width="1048.275" height="22.715"/>
+ <rect x="50" y="661.07" width="1048.275" height="29.334"/>
+ <rect x="50" y="588.261" fill="#FFFFFF" width="1048.275" height="22.715"/>
+ <rect x="50" y="609.909" width="1048.275" height="29.337"/>
+ <rect x="50" y="537.1" fill="#FFFFFF" width="1048.275" height="22.724"/>
+ <rect x="50" y="558.748" width="1048.275" height="29.337"/>
+ <rect x="50" y="489.877" fill="#FFFFFF" width="1048.275" height="22.709"/>
+ <rect x="50" y="511.525" width="1048.275" height="29.337"/>
+ <rect x="50" y="438.716" fill="#FFFFFF" width="1048.275" height="22.725"/>
+ <rect x="50" y="460.358" width="1048.275" height="29.349"/>
+ <rect x="50" y="409.197" width="1048.275" height="29.349"/>
+ </g>
+ </g>
+ <g>
+ <defs>
+ <polygon id="SVGID_3_" points="624.062,489.285 624.062,410.41 769.639,410.41 832.93,580.82 893.788,411.384 1040.336,411.384
+ 1040.336,488.304 990.188,488.304 990.188,710.327 1040.336,710.327 1040.336,788.217 909.856,788.217 909.856,570.594
+ 832.93,787.743 755.026,570.111 755.026,788.217 623.084,788.217 623.084,709.346 675.178,709.346 675.178,489.775 "/>
+ </defs>
+ <clipPath id="SVGID_4_">
+ <use xlink:href="#SVGID_3_" overflow="visible"/>
+ </clipPath>
+ <g clip-path="url(#SVGID_4_)">
+ <rect x="50" y="737.811" fill="#FFFFFF" width="1048.275" height="22.709"/>
+ <rect x="50" y="759.453" width="1048.275" height="29.343"/>
+ <rect x="50" y="690.589" fill="#FFFFFF" width="1048.275" height="22.709"/>
+ <rect x="50" y="712.227" width="1048.275" height="29.338"/>
+ <rect x="50" y="639.427" fill="#FFFFFF" width="1048.275" height="22.715"/>
+ <rect x="50" y="661.07" width="1048.275" height="29.334"/>
+ <rect x="50" y="588.261" fill="#FFFFFF" width="1048.275" height="22.715"/>
+ <rect x="50" y="609.909" width="1048.275" height="29.337"/>
+ <rect x="50" y="537.1" fill="#FFFFFF" width="1048.275" height="22.724"/>
+ <rect x="50" y="558.748" width="1048.275" height="29.337"/>
+ <rect x="50" y="489.877" fill="#FFFFFF" width="1048.275" height="22.709"/>
+ <rect x="50" y="511.525" width="1048.275" height="29.337"/>
+ <rect x="50" y="438.716" fill="#FFFFFF" width="1048.275" height="22.725"/>
+ <rect x="50" y="460.358" width="1048.275" height="29.349"/>
+ <rect x="50" y="409.197" width="1048.275" height="29.349"/>
+ </g>
+ </g>
+ <g>
+ <defs>
+ <polygon id="SVGID_5_" points="94.851,788.217 94.851,709.697 147.571,709.697 147.571,489.1 94.106,489.1 94.106,411.7
+ 280.31,411.7 280.31,487.966 229.461,487.966 229.461,710.078 281.061,710.078 281.061,787.838 "/>
+ </defs>
+ <clipPath id="SVGID_6_">
+ <use xlink:href="#SVGID_5_" overflow="visible"/>
+ </clipPath>
+ <g clip-path="url(#SVGID_6_)">
+ <rect x="50" y="737.811" fill="#FFFFFF" width="1048.275" height="22.709"/>
+ <rect x="50" y="759.453" width="1048.275" height="29.343"/>
+ <rect x="50" y="690.589" fill="#FFFFFF" width="1048.275" height="22.709"/>
+ <rect x="50" y="712.227" width="1048.275" height="29.338"/>
+ <rect x="50" y="639.427" fill="#FFFFFF" width="1048.275" height="22.715"/>
+ <rect x="50" y="661.07" width="1048.275" height="29.334"/>
+ <rect x="50" y="588.261" fill="#FFFFFF" width="1048.275" height="22.715"/>
+ <rect x="50" y="609.909" width="1048.275" height="29.337"/>
+ <rect x="50" y="537.1" fill="#FFFFFF" width="1048.275" height="22.724"/>
+ <rect x="50" y="558.748" width="1048.275" height="29.337"/>
+ <rect x="50" y="489.877" fill="#FFFFFF" width="1048.275" height="22.709"/>
+ <rect x="50" y="511.525" width="1048.275" height="29.337"/>
+ <rect x="50" y="438.716" fill="#FFFFFF" width="1048.275" height="22.725"/>
+ <rect x="50" y="460.358" width="1048.275" height="29.349"/>
+ <rect x="50" y="409.197" width="1048.275" height="29.349"/>
+ </g>
+ </g>
+ </g>
+ <g>
+ <path d="M1107.072,790.802c-23.677,0-42.931-19.258-42.931-42.931c0-23.673,19.255-42.931,42.931-42.931
+ c23.657,0,42.928,19.258,42.928,42.931C1150,771.545,1130.729,790.802,1107.072,790.802z M1107.072,712.03
+ c-19.777,0-35.848,16.08-35.848,35.841c0,19.761,16.071,35.841,35.848,35.841c19.751,0,35.832-16.08,35.832-35.841
+ C1142.904,728.111,1126.823,712.03,1107.072,712.03z"/>
+ <g>
+ <path d="M1090.434,771.583V726.07h20.178c4.059,0,7.141,0.401,9.249,1.223c2.12,0.818,3.801,2.254,5.062,4.329
+ c1.264,2.073,1.901,4.362,1.901,6.864c0,3.225-1.054,5.953-3.13,8.162c-2.095,2.21-5.326,3.623-9.694,4.232
+ c1.585,0.758,2.802,1.512,3.635,2.26c1.754,1.614,3.422,3.636,4.995,6.056l7.924,12.388h-7.586l-6.021-9.468
+ c-1.757-2.734-3.206-4.82-4.346-6.285c-1.143-1.442-2.158-2.451-3.059-3.034c-0.898-0.573-1.814-0.974-2.751-1.216
+ c-0.678-0.147-1.799-0.213-3.349-0.213h-6.978v20.216H1090.434z M1096.464,746.152h12.932c2.766,0,4.919-0.287,6.469-0.863
+ c1.55-0.557,2.734-1.477,3.54-2.721c0.805-1.258,1.206-2.611,1.206-4.082c0-2.152-0.783-3.929-2.34-5.32
+ c-1.566-1.376-4.04-2.069-7.411-2.069h-14.396V746.152z"/>
+ </g>
+ </g>
+</g>
+</svg>
diff --git a/docs/mint.json b/docs/mint.json
index 0e51d862..3c40b208 100644
--- a/docs/mint.json
+++ b/docs/mint.json
@@ -60,19 +60,26 @@
"url": "https://agentops.ai/contact"
}
],
+ "versions": [
+ "v2",
+ "v1",
+ "v0"
+ ],
"navigation": [
{
"group": "",
"pages": [
"v1/introduction"
- ]
+ ],
+ "version": "v1"
},
{
"group": "Getting Started",
"pages": [
"v1/quickstart",
"v1/examples/examples"
- ]
+ ],
+ "version": "v1"
},
{
"group": "Concepts",
@@ -82,7 +89,8 @@
"v1/concepts/sessions",
"v1/concepts/events",
"v1/concepts/tags"
- ]
+ ],
+ "version": "v1"
},
{
"group": "Integrations",
@@ -109,7 +117,8 @@
"v1/integrations/swarmzero",
"v1/integrations/taskweaver",
"v1/integrations/xai"
- ]
+ ],
+ "version": "v1"
},
{
"group": "Usage",
@@ -121,11 +130,72 @@
"v1/usage/tracking-agents",
"v1/usage/recording-operations",
"v1/usage/multiple-sessions"
- ]
+ ],
+ "version": "v1"
+ },
+ {
+ "group": "Other Info",
+ "pages": ["v1/concepts/host-env"],
+ "version": "v1"
+ },
+ {
+ "group": "",
+ "pages": [
+ "v2/introduction"
+ ],
+ "version": "v2"
+ },
+ {
+ "group": "Getting Started",
+ "pages": [
+ "v2/quickstart",
+ "v2/examples/examples"
+ ],
+ "version": "v2"
+ },
+ {
+ "group": "Concepts",
+ "pages": [
+ "v2/concepts/core-concepts",
+ "v2/concepts/decorators",
+ "v2/concepts/sessions",
+ "v2/concepts/spans",
+ "v2/concepts/tags"
+ ],
+ "version": "v2"
+ },
+ {
+ "group": "Integrations",
+ "pages": [
+ "v2/integrations/anthropic",
+ "v2/integrations/autogen",
+ "v2/integrations/crewai",
+ "v2/integrations/google_adk",
+ "v2/integrations/gemini",
+ "v2/integrations/langchain",
+ "v2/integrations/litellm",
+ "v2/integrations/openai",
+ "v2/integrations/agentssdk",
+ "v2/integrations/ibm_watsonx_ai"
+ ],
+ "version": "v2"
+ },
+ {
+ "group": "Usage",
+ "pages": [
+ "v2/usage/dashboard-info",
+ "v2/usage/sdk-reference",
+ "v2/usage/advanced-configuration",
+ "v2/usage/tracking-llm-calls",
+ "v2/usage/tracking-agents",
+ "v2/usage/recording-operations"
+ ],
+ "version": "v2"
},
{
"group": "Other Info",
- "pages": ["v1/concepts/host-env"]
+ "pages": ["v2/concepts/host-env"],
+ "version": "v2"
}
],
"footerSocials": {
diff --git a/docs/v2/concepts/core-concepts.mdx b/docs/v2/concepts/core-concepts.mdx
new file mode 100644
index 00000000..b5823afc
--- /dev/null
+++ b/docs/v2/concepts/core-concepts.mdx
@@ -0,0 +1,180 @@
+---
+title: 'Core Concepts'
+description: 'Understanding the fundamental concepts of AgentOps'
+---
+
+# The AgentOps SDK Architecture
+
+AgentOps is designed to provide comprehensive monitoring and analytics for AI agent workflows with minimal implementation effort. The SDK follows these key design principles:
+
+## Automated Instrumentation
+
+After calling `agentops.init()`, the SDK automatically identifies installed LLM providers and instruments their API calls. This allows AgentOps to capture interactions between your code and the LLM providers to collect data for your dashboard without requiring manual instrumentation for every call.
+
+## Declarative Tracing with Decorators
+
+The [decorators](/v2/concepts/decorators) system allows you to add tracing to your existing functions and classes with minimal code changes. Decorators create hierarchical spans that provide a structured view of your agent's operations for monitoring and analysis.
+
+## OpenTelemetry Foundation
+
+AgentOps is built on [OpenTelemetry](https://opentelemetry.io/), a widely-adopted standard for observability instrumentation. This provides a robust and standardized approach to collecting, processing, and exporting telemetry data.
+
+# Sessions
+
+A [Session](/v2/concepts/sessions) represents a single user interaction with your agent. When you initialize AgentOps using the `init` function, a session is automatically created for you:
+
+```python
+import agentops
+
+# Initialize AgentOps with automatic session creation
+agentops.init(api_key="YOUR_API_KEY")
+```
+
+By default, all events and API calls will be associated with this session. For more advanced use cases, you can control session creation manually:
+
+```python
+# Initialize without auto-starting a session
+agentops.init(api_key="YOUR_API_KEY", auto_start_session=False)
+
+# Later, manually start a session when needed
+agentops.start_session(tags=["customer-query"])
+```
+
+# Span Hierarchy
+
+In AgentOps, activities are organized into a hierarchical structure of spans:
+
+- **SESSION**: The root container for all activities in a single execution of your workflow
+- **AGENT**: Represents an autonomous entity with specialized capabilities
+- **WORKFLOW**: A logical grouping of related operations
+- **OPERATION/TASK**: A specific task or function performed by an agent
+- **LLM**: An interaction with a language model
+- **TOOL**: The use of a tool or API by an agent
+
+This hierarchy creates a complete trace of your agent's execution:
+
+```
+SESSION
+ ├── AGENT
+ │ ├── OPERATION/TASK
+ │ │ ├── LLM
+ │ │ └── TOOL
+ │ └── WORKFLOW
+ │ └── OPERATION/TASK
+ └── LLM (unattributed to a specific agent)
+```
+
+# Agents
+
+An **Agent** represents a component in your application that performs tasks. You can create and track agents using the `@agent` decorator:
+
+```python
+from agentops.sdk.decorators import agent, operation
+
+@agent(name="customer_service")
+class CustomerServiceAgent:
+ @operation
+ def answer_query(self, query):
+ # Agent logic here
+ pass
+```
+
+# LLM Events
+
+AgentOps automatically tracks LLM API calls from supported providers, collecting valuable information like:
+
+- **Model**: The specific model used (e.g., "gpt-4", "claude-3-opus")
+- **Provider**: The LLM provider (e.g., "OpenAI", "Anthropic")
+- **Prompt Tokens**: Number of tokens in the input
+- **Completion Tokens**: Number of tokens in the output
+- **Cost**: The estimated cost of the interaction
+- **Messages**: The prompt and completion content
+
+```python
+import agentops
+from openai import OpenAI
+
+# Initialize AgentOps
+agentops.init(api_key="YOUR_API_KEY")
+
+# Initialize the OpenAI client
+client = OpenAI()
+
+# This LLM call is automatically tracked
+response = client.chat.completions.create(
+ model="gpt-4",
+ messages=[{"role": "user", "content": "What's the capital of France?"}]
+)
+```
+
+# Tags
+
+[Tags](/v2/concepts/tags) help you organize and filter your sessions. You can add tags when initializing AgentOps or when starting a session:
+
+```python
+# Add tags when initializing
+agentops.init(api_key="YOUR_API_KEY", tags=["production", "web-app"])
+
+# Or when manually starting a session
+agentops.start_session(tags=["customer-service", "tier-1"])
+```
+
+# Host Environment
+
+AgentOps automatically collects basic [information](/v2/concepts/host-env) about the environment where your agent is running:
+
+- **Operating System**: The OS type and version
+- **Python Version**: The version of Python being used
+- **Hostname**: The name of the host machine (anonymized)
+- **SDK Version**: The version of the AgentOps SDK being used
+
+# Dashboard Views
+
+The AgentOps dashboard provides several ways to visualize and analyze your agent's performance:
+
+- **Session List**: Overview of all sessions with filtering options
+- **Timeline View**: Chronological display of spans showing duration and relationships
+- **Tree View**: Hierarchical representation of spans showing parent-child relationships
+- **Message View**: Detailed view of LLM interactions with prompt and completion content
+- **Analytics**: Aggregated metrics across sessions and operations
+
+# Putting It All Together
+
+A typical implementation looks like this:
+
+```python
+import agentops
+from openai import OpenAI
+from agentops.sdk.decorators import agent, operation
+
+# Initialize AgentOps
+agentops.init(api_key="YOUR_API_KEY", tags=["production"])
+
+# Define an agent
+@agent(name="assistant")
+class AssistantAgent:
+ def __init__(self):
+ self.client = OpenAI()
+
+ @operation
+ def answer_question(self, question):
+ # This LLM call will be automatically tracked and associated with this agent
+ response = self.client.chat.completions.create(
+ model="gpt-4",
+ messages=[{"role": "user", "content": question}]
+ )
+ return response.choices[0].message.content
+
+def workflow():
+ # Use the agent
+ assistant = AssistantAgent()
+ answer = assistant.answer_question("What's the capital of France?")
+ print(answer)
+
+workflow()
+# Session is automatically tracked until application terminates
+```
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
\ No newline at end of file
diff --git a/docs/v2/concepts/decorators.mdx b/docs/v2/concepts/decorators.mdx
new file mode 100644
index 00000000..36206a94
--- /dev/null
+++ b/docs/v2/concepts/decorators.mdx
@@ -0,0 +1,318 @@
+---
+title: 'Decorators'
+description: 'Use decorators to track activities in your agent system'
+---
+## Available Decorators
+
+AgentOps provides the following decorators:
+
+| Decorator | Purpose | Creates |
+|-----------|---------|---------|
+| `@session` | Track an entire user interaction | SESSION span |
+| `@agent` | Track agent classes and their lifecycle | AGENT span |
+| `@operation` | Track discrete operations performed by agents | OPERATION span |
+| `@workflow` | Track a sequence of operations | WORKFLOW span |
+| `@task` | Track smaller units of work (similar to operations) | TASK span |
+
+## Decorator Hierarchy
+
+The decorators create spans that form a hierarchy:
+
+```
+SESSION
+ ├── AGENT
+ │ ├── OPERATION or TASK
+ │ │ ├── LLM
+ │ │ └── TOOL
+ │ └── WORKFLOW
+ │ └── OPERATION or TASK
+ └── AGENT
+ └── OPERATION or TASK
+```
+
+## Using Decorators
+
+### @session
+
+The `@session` decorator tracks an entire user interaction from start to finish:
+
+```python
+from agentops.sdk.decorators import session
+import agentops
+
+# Initialize AgentOps
+agentops.init(api_key="YOUR_API_KEY")
+
+@session
+def answer_question(question):
+ # Create and use agents
+ weather_agent = WeatherAgent()
+ result = weather_agent.get_forecast(question)
+
+ # Return the final result
+ return result
+```
+
+Each `@session` function call creates a new session span that contains all the agents, operations, and workflows used during that interaction.
+
+### @agent
+
+The `@agent` decorator instruments a class to track its lifecycle and operations:
+
+```python
+from agentops.sdk.decorators import agent, operation
+import agentops
+
+# Initialize AgentOps
+agentops.init(api_key="YOUR_API_KEY")
+
+@agent
+class WeatherAgent:
+ def __init__(self):
+ self.api_key = "weather_api_key"
+
+ @operation
+ def get_forecast(self, location):
+ # Get weather data
+ return f"The weather in {location} is sunny."
+
+def check_weather(city):
+ weather_agent = WeatherAgent()
+ forecast = weather_agent.get_forecast(city)
+ return forecast
+
+weather_info = check_weather("San Francisco")
+```
+
+When an agent-decorated class is instantiated within a session, an AGENT span is created automatically.
+
+### @operation
+
+The `@operation` decorator tracks discrete functions performed by an agent:
+
+```python
+from agentops.sdk.decorators import agent, operation
+import agentops
+
+# Initialize AgentOps
+agentops.init(api_key="YOUR_API_KEY")
+
+@agent
+class MathAgent:
+ @operation
+ def add(self, a, b):
+ return a + b
+
+ @operation
+ def multiply(self, a, b):
+ return a * b
+
+def calculate(x, y):
+ math_agent = MathAgent()
+ sum_result = math_agent.add(x, y)
+ product_result = math_agent.multiply(x, y)
+ return {"sum": sum_result, "product": product_result}
+
+results = calculate(5, 3)
+```
+
+Operations represent the smallest meaningful units of work in your agent system. Each operation creates an OPERATION span with:
+- Inputs (function arguments)
+- Output (return value)
+- Duration
+- Success/failure status
+
+### @workflow
+
+The `@workflow` decorator tracks a sequence of operations that work together:
+
+```python
+from agentops.sdk.decorators import agent, operation, workflow
+import agentops
+
+# Initialize AgentOps
+agentops.init(api_key="YOUR_API_KEY")
+
+@agent
+class TravelAgent:
+ def __init__(self):
+ self.flight_api = FlightAPI()
+ self.hotel_api = HotelAPI()
+
+ @workflow
+ def plan_trip(self, destination, dates):
+ # This workflow contains multiple operations
+ flights = self.find_flights(destination, dates)
+ hotels = self.find_hotels(destination, dates)
+
+ return {
+ "flights": flights,
+ "hotels": hotels
+ }
+
+ @operation
+ def find_flights(self, destination, dates):
+ return self.flight_api.search(destination, dates)
+
+ @operation
+ def find_hotels(self, destination, dates):
+ return self.hotel_api.search(destination, dates)
+```
+
+Workflows help you organize related operations and see their collective performance.
+
+### @task
+
+The `@task` decorator is similar to `@operation` but can be used for smaller units of work:
+
+```python
+from agentops.sdk.decorators import agent, task
+import agentops
+
+# Initialize AgentOps
+agentops.init(api_key="YOUR_API_KEY")
+
+@agent
+class DataProcessor:
+ @task
+ def normalize_data(self, data):
+ # Normalize the data
+ return [x / sum(data) for x in data]
+
+ @task
+ def filter_outliers(self, data, threshold=3):
+ # Filter outliers
+ mean = sum(data) / len(data)
+ std_dev = (sum((x - mean) ** 2 for x in data) / len(data)) ** 0.5
+
+ return [x for x in data if abs(x - mean) <= threshold * std_dev]
+```
+
+The `@task` and `@operation` decorators function identically (they are aliases in the codebase), and you can choose the one that best fits your semantic needs.
+
+## Decorator Attributes
+
+You can pass additional attributes to decorators:
+
+```python
+from agentops.sdk.decorators import agent, operation
+import agentops
+
+# Initialize AgentOps
+agentops.init(api_key="YOUR_API_KEY")
+
+@agent(name="custom_agent_name", attributes={"version": "1.0"})
+class CustomAgent:
+ @operation(name="custom_operation", attributes={"importance": "high"})
+ def process(self, data):
+ return data
+```
+
+Common attributes include:
+
+| Attribute | Description | Example |
+|-----------|-------------|---------|
+| `name` | Custom name for the span | `name="weather_forecast"` |
+| `attributes` | Dictionary of custom attributes | `attributes={"model": "gpt-4"}` |
+
+## Complete Example
+
+Here's a complete example using all the decorators together:
+
+```python
+from agentops.sdk.decorators import session, agent, operation, workflow, task
+import agentops
+
+# Initialize AgentOps
+agentops.init(api_key="YOUR_API_KEY")
+
+@session
+def assist_user(query):
+ # Create the main assistant
+ assistant = Assistant()
+
+ # Process the query
+ return assistant.process_query(query)
+
+@agent
+class Assistant:
+ def __init__(self):
+ pass
+
+ @workflow
+ def process_query(self, query):
+ research_agent = ResearchAgent()
+ writing_agent = WritingAgent()
+
+ # Research phase
+ research = research_agent.gather_information(query)
+
+ # Writing phase
+ response = writing_agent.generate_response(query, research)
+
+ return response
+
+@agent
+class ResearchAgent:
+ @operation
+ def gather_information(self, query):
+ # Perform web search
+ search_results = self.search(query)
+
+ # Analyze results
+ return self.analyze_results(search_results)
+
+ @task
+ def search(self, query):
+ # Simulate web search
+ return [f"Result for {query}", f"Another result for {query}"]
+
+ @task
+ def analyze_results(self, results):
+ # Analyze search results
+ return {"summary": "Analysis of " + ", ".join(results)}
+
+@agent
+class WritingAgent:
+ @operation
+ def generate_response(self, query, research):
+ # Generate a response based on the research
+ return f"Answer to '{query}' based on: {research['summary']}"
+
+assist_user("What is the capital of France?")
+```
+
+In this example:
+1. The `@session` decorator wraps the entire interaction
+2. The `@agent` decorator defines multiple agent classes
+3. The `@workflow` decorator creates a workflow that coordinates agents
+4. The `@operation` and `@task` decorators track individual operations
+5. All spans are properly nested in the hierarchy
+
+Note that LLM and TOOL spans are automatically created when you use compatible LLM libraries or tool integrations.
+
+## Best Practices
+
+- **Use @session for top-level functions** that represent complete user interactions
+- **Apply @agent to classes** that represent distinct components of your system
+- **Use @operation for significant functions** that represent complete units of work
+- **Use @task for smaller functions** that are part of larger operations
+- **Apply @workflow to methods** that coordinate multiple operations
+- **Keep decorator nesting consistent** with the logical hierarchy of your code
+- **Add custom attributes** to provide additional context for analysis
+- **Use meaningful names** for all decorated components
+
+## Dashboard Visualization
+
+In the AgentOps dashboard, decorators create spans that appear in:
+
+1. **Timeline View**: Shows the execution sequence and duration
+2. **Hierarchy View**: Displays the parent-child relationships
+3. **Detail Panels**: Shows inputs, outputs, and attributes
+4. **Performance Metrics**: Tracks execution times and success rates
+
+This visualization helps you understand the flow and performance of your agent system.
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
\ No newline at end of file
diff --git a/docs/v2/concepts/host-env.mdx b/docs/v2/concepts/host-env.mdx
new file mode 100644
index 00000000..04f14c62
--- /dev/null
+++ b/docs/v2/concepts/host-env.mdx
@@ -0,0 +1,46 @@
+---
+title: 'Host Environment'
+description: 'Automatically collected information about the environment where your agent runs'
+---
+## Collected Information
+
+The following information is automatically collected:
+
+- **Operating System**: The OS type and version (e.g., "Linux", "Windows", "macOS")
+- **Python Version**: The version of Python being used
+- **Hostname**: The name of the host machine (anonymized)
+- **AgentOps SDK Version**: The version of the AgentOps SDK being used
+- **Process ID**: The ID of the process running the agent
+
+## Usage in Analytics
+
+Host environment information enables:
+
+- Identifying environment-specific issues
+- Tracking performance across different platforms
+- Ensuring compatibility with specific OS versions
+- Monitoring SDK version adoption
+
+## Privacy Considerations
+
+AgentOps is designed with privacy in mind:
+
+- No personally identifiable information is collected
+- Hostnames are anonymized
+- No network scanning or detailed system analysis is performed
+- Only the minimum necessary information for debugging is gathered
+
+## Disabling Host Environment Collection
+
+If needed, you can disable host environment collection when initializing AgentOps:
+
+```python
+import agentops
+
+# Disable host environment collection
+agentops.init(api_key="YOUR_API_KEY", collect_host_env=False)
+```
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
diff --git a/docs/v2/concepts/sessions.mdx b/docs/v2/concepts/sessions.mdx
new file mode 100644
index 00000000..b2eae78f
--- /dev/null
+++ b/docs/v2/concepts/sessions.mdx
@@ -0,0 +1,92 @@
+---
+title: 'Sessions'
+description: 'Effectively manage sessions in your agent workflow'
+---
+## Automatic Session Management
+
+The simplest way to create and manage sessions is to use the `init` function with automatic session management:
+
+```python
+import agentops
+
+# Initialize with automatic session creation (default)
+agentops.init(api_key="YOUR_API_KEY", tags=["production"])
+```
+
+This approach:
+- Creates a session automatically when you initialize the SDK
+- Tracks all events in the context of this session
+- Manages the session throughout the lifecycle of your application
+
+## Manual Session Creation
+
+For more control, you can disable automatic session creation and start sessions manually:
+
+```python
+import agentops
+
+# Initialize without auto-starting a session
+agentops.init(api_key="YOUR_API_KEY", auto_start_session=False)
+
+# Later, manually start a session when needed
+agentops.start_session(tags=["customer-query", "high-priority"])
+```
+
+Manual session management is useful when:
+- You want to control exactly when session tracking begins
+- You need to associate different sessions with different sets of tags
+- Your application has distinct workflows that should be tracked separately
+
+## Using the Session Decorator
+
+As an alternative to the methods above, you can use the `@session` decorator to create a session for a specific function:
+
+```python
+from agentops.sdk.decorators import session
+
+@session
+def process_customer_data(customer_id):
+ # This entire function execution will be tracked as a session
+ return analyze_data(customer_id)
+```
+
+## Session State
+
+Every session has an associated state that includes:
+
+- **Session ID**: A unique identifier
+- **Start Time**: When the session began
+- **Tags**: Labels associated with the session
+- **Events**: All events recorded during the session
+
+This state is automatically managed by AgentOps and synchronized with the dashboard.
+
+## Session Context
+
+Sessions create a context for all event recording. When an event is recorded:
+
+1. It's associated with the current active session
+2. It's automatically included in the session's timeline
+3. It inherits the session's tags for filtering and analysis
+
+## Viewing Sessions in the Dashboard
+
+The AgentOps dashboard provides several views for analyzing your sessions:
+
+1. **Session List**: Overview of all sessions with filtering options
+2. **Session Details**: In-depth view of a single session
+3. **Timeline View**: Chronological display of all events in a session
+4. **Tree View**: Hierarchical representation of agents, operations, and events
+5. **Analytics**: Aggregated metrics across sessions
+
+## Best Practices
+
+- **Start sessions at logical boundaries** in your application workflow
+- **Use descriptive session names** to easily identify them in the dashboard
+- **Apply consistent tags** to group related sessions
+- **Use fewer, longer sessions** rather than many short ones for better analysis
+- **Use automatic session management** unless you have specific needs for manual control
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
diff --git a/docs/v2/concepts/spans.mdx b/docs/v2/concepts/spans.mdx
new file mode 100644
index 00000000..f08e30bc
--- /dev/null
+++ b/docs/v2/concepts/spans.mdx
@@ -0,0 +1,143 @@
+---
+title: 'Spans'
+description: 'Understanding the different types of spans in AgentOps'
+---
+## Core Span Types
+
+AgentOps organizes all spans with specific kinds:
+
+| Span Kind | Description |
+|-----------|-------------|
+| `SESSION` | The root container for all activities in a single execution of your workflow |
+| `AGENT` | Represents an autonomous entity with specialized capabilities |
+| `WORKFLOW` | A logical grouping of related operations |
+| `OPERATION` | A specific task or function performed by an agent |
+| `TASK` | Alias for OPERATION, used interchangeably |
+| `LLM` | An interaction with a language model |
+| `TOOL` | The use of a tool or API by an agent |
+
+## Span Hierarchy
+
+Spans in AgentOps are organized hierarchically:
+
+```
+SESSION
+ ├── AGENT
+ │ ├── OPERATION/TASK
+ │ │ ├── LLM
+ │ │ └── TOOL
+ │ └── WORKFLOW
+ │ └── OPERATION/TASK
+ └── LLM (unattributed to a specific agent)
+```
+
+Every span exists within the context of a session, and most spans (other than the session itself) have a parent span that provides context.
+
+## Span Attributes
+
+All spans in AgentOps include:
+
+- **ID**: A unique identifier
+- **Name**: A descriptive name
+- **Kind**: The type of span (SESSION, AGENT, etc.)
+- **Start Time**: When the span began
+- **End Time**: When the span completed
+- **Status**: Success or error status
+- **Attributes**: Key-value pairs with additional metadata
+
+Different span types have specialized attributes:
+
+### LLM Spans
+
+LLM spans track interactions with large language models and include:
+
+- **Model**: The specific model used (e.g., "gpt-4", "claude-3-opus")
+- **Provider**: The LLM provider (e.g., "OpenAI", "Anthropic")
+- **Prompt Tokens**: Number of tokens in the input
+- **Completion Tokens**: Number of tokens in the output
+- **Cost**: The estimated cost of the interaction
+- **Messages**: The prompt and completion content
+
+### Tool Spans
+
+Tool spans track the use of tools or APIs and include:
+
+- **Tool Name**: The name of the tool used
+- **Input**: The data provided to the tool
+- **Output**: The result returned by the tool
+- **Duration**: How long the tool operation took
+
+### Operation/Task Spans
+
+Operation spans track specific functions or tasks:
+
+- **Operation Type**: The kind of operation performed
+- **Parameters**: Input parameters to the operation
+- **Result**: The output of the operation
+- **Duration**: How long the operation took
+
+## Creating Spans
+
+There are several ways to create spans in AgentOps:
+
+### Using Decorators
+
+The recommended way to create spans is using decorators:
+
+```python
+from agentops.sdk.decorators import agent, operation, session, workflow, task
+
+@session
+def my_workflow():
+ agent_instance = MyAgent()
+ return agent_instance.perform_task()
+
+@agent
+class MyAgent:
+ @operation
+ def perform_task(self):
+ # Perform the task
+ return result
+```
+
+### Automatic Instrumentation
+
+AgentOps automatically instruments LLM API calls from supported providers when `auto_instrument=True` (the default):
+
+```python
+import agentops
+from openai import OpenAI
+
+# Initialize AgentOps
+agentops.init(api_key="YOUR_API_KEY")
+
+# Initialize the OpenAI client
+client = OpenAI()
+
+# This LLM call will be automatically tracked
+response = client.chat.completions.create(
+ model="gpt-4",
+ messages=[{"role": "user", "content": "Hello!"}]
+)
+```
+
+## Viewing Spans in the Dashboard
+
+All recorded spans are visible in the AgentOps dashboard:
+
+1. **Timeline View**: Shows the sequence and duration of spans
+2. **Tree View**: Displays the hierarchical relationship between spans
+3. **Details Panel**: Provides in-depth information about each span
+4. **Analytics**: Aggregates statistics across spans
+
+## Best Practices
+
+- Use descriptive names for spans to make them easily identifiable
+- Create a logical hierarchy with sessions, agents, and operations
+- Record relevant parameters and results for better debugging
+- Use consistent naming conventions for span types
+- Track costs and token usage to monitor resource consumption
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
\ No newline at end of file
diff --git a/docs/v2/concepts/tags.mdx b/docs/v2/concepts/tags.mdx
new file mode 100644
index 00000000..40ea2bbd
--- /dev/null
+++ b/docs/v2/concepts/tags.mdx
@@ -0,0 +1,91 @@
+---
+title: 'Tags'
+description: 'Organize and filter your sessions with customizable tags'
+---
+## Adding Tags
+
+You can add tags when initializing AgentOps, which is the most common approach:
+
+```python
+import agentops
+
+# Initialize AgentOps with tags
+agentops.init(
+ api_key="YOUR_API_KEY",
+ tags=["production", "customer-service", "gpt-4"]
+)
+```
+
+Alternatively, when using manual session creation:
+
+```python
+# Initialize without auto-starting a session
+agentops.init(api_key="YOUR_API_KEY", auto_start_session=False)
+
+# Later start a session with specific tags
+agentops.start_session(tags=["development", "testing", "claude-3"])
+```
+
+## Tag Use Cases
+
+Tags can be used for various purposes:
+
+### Environment Identification
+
+Tag sessions based on their environment:
+
+```python
+tags=["production"] # or ["development", "staging", "testing"]
+```
+
+### Feature Tracking
+
+Tag sessions related to specific features or components:
+
+```python
+tags=["search-functionality", "user-authentication", "content-generation"]
+```
+
+### User Segmentation
+
+Tag sessions based on user characteristics:
+
+```python
+tags=["premium-user", "new-user", "enterprise-customer"]
+```
+
+### Experiment Tracking
+
+Tag sessions as part of specific experiments:
+
+```python
+tags=["experiment-123", "control-group", "variant-A"]
+```
+
+### Model Identification
+
+Tag sessions with the models being used:
+
+```python
+tags=["gpt-4", "claude-3-opus", "mistral-large"]
+```
+
+## Viewing Tagged Sessions
+
+In the AgentOps dashboard:
+
+1. Use the tag filter to select specific tags
+2. Combine multiple tags to refine your view
+3. Save filtered views for quick access
+
+## Best Practices
+
+- Use a consistent naming convention for tags
+- Include both broad categories and specific identifiers
+- Avoid using too many tags per session (3-5 is typically sufficient)
+- Consider using hierarchical tag structures (e.g., "env:production", "model:gpt-4")
+- Update your tagging strategy as your application evolves
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
\ No newline at end of file
diff --git a/docs/v2/examples/examples.mdx b/docs/v2/examples/examples.mdx
new file mode 100644
index 00000000..b36f990d
--- /dev/null
+++ b/docs/v2/examples/examples.mdx
@@ -0,0 +1,127 @@
+---
+title: 'Integration Examples'
+description: 'Examples of AgentOps with various integrations'
+mode: "wide"
+---
+
+## Explore our integration examples to see AgentOps in action!
+
+### Integration Examples
+
+<CardGroup cols={2}>
+ <Card title="Multi-Agent" icon="robot" href="/v2/examples/multi_agent">
+ Tracking operations from multiple different agents
+ </Card>
+
+ <Card title="OpenAI Assistants" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/openai/openai-logomark.png?raw=true" alt="OpenAI Assistants" />} iconType="image" href="/v2/examples/openai_assistants">
+ Observe OpenAI Assistants with AgentOps
+ </Card>
+
+ <Card title="Simple Agent" icon="microchip-ai" iconType="solid" href="/v2/examples/simple_agent">
+ Basic usage with OpenAI API, perfect for getting started
+ </Card>
+
+ <Card title="OpenAI Agents SDK" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/openai/openai-logomark.png?raw=true" alt="OpenAI Agents SDK" />} iconType="image" href="/v2/integrations/agentssdk">
+ Monitor multi-agent workflows with handoffs and tool usage
+ </Card>
+</CardGroup>
+
+### Other Integrations Documentation
+
+<CardGroup cols={2}>
+ <Card title="Anthropic" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/anthropic/anthropic_icon_slate.png?raw=true" alt="Anthropic" />} iconType="image" href="/v2/integrations/anthropic">
+ Track observations from Claude, Haiku and Sonnet series of models
+ </Card>
+
+ <Card title="Autogen" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/autogen/ag2.svg?raw=true" alt="Autogen"/>} iconType="image" href="/v2/integrations/autogen">
+ Autogen/AG2 multi-agent conversible workflow with tool usage
+ </Card>
+
+ <Card title="CrewAI" icon="ship" href="/v2/integrations/crewai">
+ CrewAI multi-agent framework with AgentOps support
+ </Card>
+
+ <Card title="Gemini" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/deepmind/gemini-logo.png?raw=true" alt="Gemini" />} iconType="image" href="/v2/integrations/gemini">
+ Explore Google DeepMind's Gemini with observation via AgentOps
+ </Card>
+
+ <Card title="Google ADK" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/google-adk/google-adk-logo.png?raw=true" alt="Google" />} iconType="image" href="/v2/integrations/google_adk">
+ Track and analyze your Google Agent Development Kit (ADK) AI agents
+ </Card>
+
+ <Card title="IBM Watsonx.ai" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/ibm/ibm-logo.svg?raw=true" alt="IBM" />} iconType="image" href="/v2/integrations/ibm_watsonx_ai">
+ Track and analyze your IBM Watsonx.ai model interactions
+ </Card>
+
+ <Card title="LangChain" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/langchain/langchain-logo.svg?raw=true" alt="LangChain" />} iconType="image" href="/v2/integrations/langchain">
+ First-class support for LangChain agents and chains
+ </Card>
+
+ <Card title="LiteLLM" icon="train-tram" href="/v2/integrations/litellm">
+ Unified interface for multiple LLM providers
+ </Card>
+
+ <Card title="OpenAI" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/openai/openai-logomark.png?raw=true" alt="OpenAI" />} iconType="image" href="/v2/integrations/openai">
+ First class support for GPT family of models
+ </Card>
+
+ <Card title="OpenAI Agents SDK" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/openai/openai-logomark.png?raw=true" alt="OpenAI Agents SDK" />} iconType="image" href="/v2/integrations/agentssdk">
+ Monitor OpenAI Agents SDK multi-agent workflows with handoffs
+ </Card>
+</CardGroup>
+
+## Video Guides
+
+<CardGroup cols={2}>
+ <Card title="AgentOps x CrewAI" icon="film" iconType="solid">
+ Learn how to monitor CrewAI applications with AgentOps
+ <iframe
+ width="280"
+ height="158"
+ src="https://www.youtube.com/embed/sF_bgRuRa3s"
+ title="YouTube video player"
+ frameborder="0"
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
+ allowfullscreen
+ ></iframe>
+ </Card>
+
+ <Card title="AgentOps x Anthropic" icon="film" iconType="solid">
+ Learn how to monitor applications that use the Anthropic SDK directly with AgentOps
+ <iframe
+ width="280"
+ height="158"
+ src="https://www.youtube.com/embed/Yx2Crpbms7I"
+ title="YouTube video player"
+ frameborder="0"
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
+ allowfullscreen
+ ></iframe>
+ </Card>
+
+ <Card title="AgentOps x OpenAI" icon="film" iconType="solid">
+ Learn how to monitor applications that use the OpenAI SDK directly with AgentOps
+ <iframe
+ width="280"
+ height="158"
+ src="https://www.youtube.com/embed/R0K9Qi2dBwM"
+ title="YouTube video player"
+ frameborder="0"
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
+ allowfullscreen
+ ></iframe>
+ </Card>
+
+ <Card title="Crew.ai" 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>
+</CardGroup>
+
+<script type="module" src="/scripts/github_stars.js" />
+
+<script type="module" src="/scripts/scroll-img-fadein-animation.js" />
+
+<script type="module" src="/scripts/button_heartbeat_animation.js" />
+
+<script type="module" src="/scripts/adjust_api_dynamically.js" />
\ No newline at end of file
diff --git a/docs/v2/examples/langchain.mdx b/docs/v2/examples/langchain.mdx
new file mode 100644
index 00000000..a6f16449
--- /dev/null
+++ b/docs/v2/examples/langchain.mdx
@@ -0,0 +1,140 @@
+---
+title: 'LangChain Example'
+description: 'Using the LangChain Callback Handler'
+mode: "wide"
+---
+_View Notebook on <a href={'https://github.com/AgentOps-AI/agentops/blob/main/examples/langchain_examples.ipynb'} target={'_blank'}>Github</a>_
+
+
+{/* SOURCE_FILE: examples/langchain_examples/langchain_examples.ipynb */}
+
+# AgentOps Langchain Agent Implementation
+
+Using AgentOps monitoring with Langchain is simple. We've created a LangchainCallbackHandler that will do all of the heavy lifting!
+
+First let's install the required packages
+
+
+```python
+%pip install langchain==0.2.9
+%pip install langchain_openai
+%pip install -U agentops
+%pip install -U python-dotenv
+```
+
+Then import them
+
+
+```python
+import os
+from langchain_openai import ChatOpenAI
+from langchain.agents import tool, AgentExecutor, create_openai_tools_agent
+from dotenv import load_dotenv
+from langchain_core.prompts import ChatPromptTemplate
+```
+
+The only difference with using AgentOps is that we'll also import this special Callback Handler
+
+
+```python
+from agentops.integration.callbacks.langchain import LangchainCallbackHandler
+```
+
+Next, we'll set our API keys. There are several ways to do this, the code below is just the most foolproof way for the purposes of this notebook. It accounts for both users who use environment variables and those who just want to set the API Key here in this notebook.
+
+[Get an AgentOps API key](https://agentops.ai/settings/projects)
+
+1. Create an environment variable in a .env file or other method. By default, the AgentOps `init()` function will look for an environment variable named `AGENTOPS_API_KEY`. Or...
+
+2. Replace `<your_agentops_key>` below and pass in the optional `api_key` parameter to the AgentOps `init(api_key=...)` function. Remember not to commit your API key to a public repo!
+
+
+```python
+load_dotenv()
+AGENTOPS_API_KEY = os.environ.get("AGENTOPS_API_KEY")
+OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY")
+```
+
+This is where AgentOps comes into play. Before creating our LLM instance via Langchain, first we'll create an instance of the AO LangchainCallbackHandler. After the handler is initialized, a session will be recorded automatically.
+
+Pass in your API key, and optionally any tags to describe this session for easier lookup in the AO dashboard.
+
+
+
+```python
+agentops_handler = LangchainCallbackHandler(
+ api_key=AGENTOPS_API_KEY, tags=["Langchain Example"]
+)
+
+llm = ChatOpenAI(
+ openai_api_key=OPENAI_API_KEY, callbacks=[agentops_handler], model="gpt-3.5-turbo"
+)
+
+# You must pass in a callback handler to record your agent
+llm.callbacks = [agentops_handler]
+
+prompt = ChatPromptTemplate.from_messages(
+ [
+ ("system", "You are a helpful assistant. Respond only in Spanish."),
+ ("human", "{input}"),
+ # Placeholders fill up a **list** of messages
+ ("placeholder", "{agent_scratchpad}"),
+ # ("tool_names", "find_movie")
+ ]
+)
+```
+
+Agents generally use tools. Let's define a simple tool here. Tool usage is also recorded.
+
+
+```python
+@tool
+def find_movie(genre: str) -> str:
+ """Find available movies"""
+ if genre == "drama":
+ return "Dune 2"
+ else:
+ return "Pineapple Express"
+
+
+tools = [find_movie]
+```
+
+For each tool, you need to also add the callback handler
+
+
+```python
+for t in tools:
+ t.callbacks = [agentops_handler]
+```
+
+Add the tools to our LLM
+
+
+```python
+llm_with_tools = llm.bind_tools([find_movie])
+```
+
+Finally, let's create our agent! Pass in the callback handler to the agent, and all the actions will be recorded in the AO Dashboard
+
+
+```python
+agent = create_openai_tools_agent(llm, tools, prompt)
+agent_executor = AgentExecutor(agent=agent, tools=tools)
+```
+
+
+```python
+agent_executor.invoke(
+ {"input": "What comedies are playing?"}, config={"callback": [agentops_handler]}
+)
+```
+
+## Check your session
+Finally, check your run on [AgentOps](https://app.agentops.ai)
+
+Now if we look in the AgentOps dashboard, you will see a session recorded with the LLM calls and tool usage.
+
+## Langchain v0 Example
+
+This langchain version is out of date and support is being deprecated. You can find the example notebook [here](https://github.com/agentops-ai/agentops/blob/main/examples/langchain_examples/langchain_v0_example.ipynb).
diff --git a/docs/v2/examples/multi_agent.mdx b/docs/v2/examples/multi_agent.mdx
new file mode 100644
index 00000000..497a534d
--- /dev/null
+++ b/docs/v2/examples/multi_agent.mdx
@@ -0,0 +1,147 @@
+---
+title: 'Multi-Agent Example'
+description: 'How to track operations from multiple different agents'
+mode: "wide"
+---
+_View Notebook on <a href={'https://github.com/AgentOps-AI/agentops/blob/main/examples/multi_agent_example.ipynb'} target={'_blank'}>Github</a>_
+
+# Multi-Agent Support
+This is an example implementation of tracking operations from two separate agents
+
+## Installation
+
+<CodeGroup>
+ ```bash pip
+ pip install -U openai agentops
+ ```
+ ```bash poetry
+ poetry add openai agentops
+ ```
+</CodeGroup>
+
+## Setup
+
+Import the necessary libraries:
+
+```python
+import agentops
+from agentops.sdk.decorators import agent, operation
+from openai import OpenAI
+import os
+from dotenv import load_dotenv
+from IPython.display import display, Markdown
+```
+
+Set up your API keys:
+
+```python
+load_dotenv()
+OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") or "<your_openai_key>"
+AGENTOPS_API_KEY = os.getenv("AGENTOPS_API_KEY") or "<your_agentops_key>"
+```
+
+Initialize AgentOps at the beginning of your application:
+
+```python
+agentops.init(AGENTOPS_API_KEY, tags=["multi-agent-example"])
+openai_client = OpenAI(api_key=OPENAI_API_KEY)
+```
+
+## Creating Multiple Agents
+
+Now let's create a few agents using the `@agent` decorator:
+
+```python
+@agent(name="qa")
+class QaAgent:
+ def __init__(self):
+ pass
+
+ @operation
+ def completion(self, prompt: str):
+ res = openai_client.chat.completions.create(
+ model="gpt-3.5-turbo",
+ messages=[
+ {
+ "role": "system",
+ "content": "You are a qa engineer and only output python code, no markdown tags.",
+ },
+ {"role": "user", "content": prompt},
+ ],
+ temperature=0.5,
+ )
+ return res.choices[0].message.content
+
+
+@agent(name="engineer")
+class EngineerAgent:
+ def __init__(self):
+ pass
+
+ @operation
+ def completion(self, prompt: str):
+ res = openai_client.chat.completions.create(
+ model="gpt-3.5-turbo",
+ messages=[
+ {
+ "role": "system",
+ "content": "You are a software engineer and only output python code, no markdown tags.",
+ },
+ {"role": "user", "content": prompt},
+ ],
+ temperature=0.5,
+ )
+ return res.choices[0].message.content
+```
+
+Instantiate your agents:
+
+```python
+def get_qa_response(prompt):
+ qa = QaAgent()
+ return qa.completion(prompt)
+
+def get_engineer_response(prompt):
+ engineer = EngineerAgent()
+ return engineer.completion(prompt)
+```
+
+## Using Different Agents
+
+Now we can use these agents to complete different tasks. Any LLM calls that go through these classes will be tagged as agent calls in AgentOps.
+
+```python
+# Get code from the engineer
+generated_func = get_engineer_response("python function to test prime number")
+display(Markdown("```python\n" + generated_func + "\n```"))
+
+# Get a test from the QA agent
+generated_test = get_qa_response(
+ "Write a python unit test that test the following function: \n " + generated_func
+)
+display(Markdown("```python\n" + generated_test + "\n```"))
+```
+
+## Default Agent Behavior
+
+If we make an LLM call outside of the context of a tracked agent, it gets assigned to the Default Agent.
+
+```python
+# This will be assigned to the Default Agent
+res = openai_client.chat.completions.create(
+ model="gpt-3.5-turbo",
+ messages=[
+ {"role": "system", "content": "You are not a tracked agent"},
+ {"role": "user", "content": "Say hello"},
+ ],
+)
+print(res.choices[0].message.content)
+```
+
+## Further Reading
+
+Check out other advanced examples like [OpenAI Assistants](/v2/examples/openai_assistants) integration.
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
\ No newline at end of file
diff --git a/docs/v2/examples/openai_assistants.mdx b/docs/v2/examples/openai_assistants.mdx
new file mode 100644
index 00000000..5f65a701
--- /dev/null
+++ b/docs/v2/examples/openai_assistants.mdx
@@ -0,0 +1,293 @@
+---
+title: 'OpenAI Assistants Example'
+description: 'Learn how to use OpenAI Assistants API with AgentOps'
+mode: "wide"
+---
+_View Notebook on <a href={'https://github.com/AgentOps-AI/agentops/blob/main/examples/openai_examples/openai_assistants_example.ipynb'} target={'_blank'}>Github</a>_
+
+# Assistants API with AgentOps
+
+This guide shows how to monitor and track OpenAI's Assistants API using AgentOps. The Assistants API is a stateful evolution of the Chat Completions API for creating assistant-like experiences with powerful tools like Code Interpreter and Retrieval.
+
+![Assistants API Diagram](https://github.com/AgentOps-AI/agentops/blob/main/examples/openai_examples/images/assistants_overview_diagram.png)
+
+## Installation
+
+<CodeGroup>
+ ```bash pip
+ pip install -U openai agentops
+ ```
+ ```bash poetry
+ poetry add openai agentops
+ ```
+</CodeGroup>
+
+## Setup
+
+Import the necessary libraries:
+
+```python
+from openai import OpenAI
+import agentops
+from dotenv import load_dotenv
+import os
+import json
+import time
+
+# Helper function for displaying JSON
+def show_json(obj):
+ display(json.loads(obj.model_dump_json()))
+```
+
+Set up your API keys:
+
+```python
+load_dotenv()
+AGENTOPS_API_KEY = os.getenv("AGENTOPS_API_KEY") or "<your_agentops_key>"
+OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") or "<your_openai_key>"
+```
+
+Initialize AgentOps at the beginning of your application:
+
+```python
+# Initialize AgentOps with tags
+agentops.init(api_key=AGENTOPS_API_KEY, tags=["openai", "assistants"])
+
+# Initialize OpenAI client
+client = OpenAI(api_key=OPENAI_API_KEY)
+```
+
+## Creating an Assistant
+
+Create a Math Tutor assistant:
+
+```python
+assistant = client.beta.assistants.create(
+ name="Math Tutor",
+ instructions="You are a personal math tutor. Answer questions briefly, in a sentence or less.",
+ model="gpt-4o-mini",
+)
+show_json(assistant)
+```
+
+## Working with Threads
+
+Create a new thread to hold the conversation:
+
+```python
+thread = client.beta.threads.create()
+show_json(thread)
+```
+
+Add a message to the thread:
+
+```python
+message = client.beta.threads.messages.create(
+ thread_id=thread.id,
+ role="user",
+ content="I need to solve the equation `3x + 11 = 14`. Can you help me?",
+)
+show_json(message)
+```
+
+## Running an Assistant
+
+Create a Run to get a completion from the Assistant:
+
+```python
+run = client.beta.threads.runs.create(
+ thread_id=thread.id,
+ assistant_id=assistant.id,
+)
+show_json(run)
+```
+
+Wait for the Run to complete:
+
+```python
+def wait_on_run(run, thread):
+ while run.status == "queued" or run.status == "in_progress":
+ run = client.beta.threads.runs.retrieve(
+ thread_id=thread.id,
+ run_id=run.id,
+ )
+ time.sleep(0.5)
+ return run
+
+run = wait_on_run(run, thread)
+show_json(run)
+```
+
+## Retrieving Messages
+
+List the messages in the thread:
+
+```python
+messages = client.beta.threads.messages.list(thread_id=thread.id)
+show_json(messages)
+```
+
+Continue the conversation with a follow-up question:
+
+```python
+# Create a message to append to our thread
+message = client.beta.threads.messages.create(
+ thread_id=thread.id, role="user", content="Could you explain this to me?"
+)
+
+# Execute our run
+run = client.beta.threads.runs.create(
+ thread_id=thread.id,
+ assistant_id=assistant.id,
+)
+
+# Wait for completion
+wait_on_run(run, thread)
+
+# Retrieve all the messages added after our last user message
+messages = client.beta.threads.messages.list(
+ thread_id=thread.id, order="asc", after=message.id
+)
+show_json(messages)
+```
+
+## Complete Example Function
+
+Here's a practical example of implementing Assistants API with helper functions:
+
+```python
+def submit_message(assistant_id, thread, user_message):
+ client.beta.threads.messages.create(
+ thread_id=thread.id, role="user", content=user_message
+ )
+ return client.beta.threads.runs.create(
+ thread_id=thread.id,
+ assistant_id=assistant_id,
+ )
+
+def get_response(thread):
+ return client.beta.threads.messages.list(thread_id=thread.id, order="asc")
+
+def create_thread_and_run(assistant_id, user_input):
+ thread = client.beta.threads.create()
+ run = submit_message(assistant_id, thread, user_input)
+ return thread, run
+
+def pretty_print(messages):
+ print("# Messages")
+ for m in messages:
+ print(f"{m.role}: {m.content[0].text.value}")
+ print()
+```
+
+## Using Tools with Assistants
+
+### Code Interpreter
+
+Enable Code Interpreter for your Assistant:
+
+```python
+assistant = client.beta.assistants.update(
+ assistant.id,
+ tools=[{"type": "code_interpreter"}],
+)
+show_json(assistant)
+```
+
+Test it with a coding task:
+
+```python
+thread, run = create_thread_and_run(
+ assistant.id,
+ "Generate the first 20 fibonacci numbers with code."
+)
+run = wait_on_run(run, thread)
+pretty_print(get_response(thread))
+```
+
+### Function Calling
+
+Define a custom function for your Assistant:
+
+```python
+function_json = {
+ "name": "display_quiz",
+ "description": "Displays a quiz to the student, and returns the student's response.",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "title": {"type": "string"},
+ "questions": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "question_text": {"type": "string"},
+ "question_type": {
+ "type": "string",
+ "enum": ["MULTIPLE_CHOICE", "FREE_RESPONSE"],
+ },
+ "choices": {"type": "array", "items": {"type": "string"}},
+ },
+ "required": ["question_text"],
+ },
+ },
+ },
+ "required": ["title", "questions"],
+ },
+}
+
+assistant = client.beta.assistants.update(
+ assistant.id,
+ tools=[
+ {"type": "code_interpreter"},
+ {"type": "function", "function": function_json},
+ ],
+)
+```
+
+Implement the function on your end:
+
+```python
+def display_quiz(title, questions):
+ print("Quiz:", title)
+ print()
+ responses = []
+
+ for q in questions:
+ print(q["question_text"])
+ response = ""
+
+ # If multiple choice, print options
+ if q["question_type"] == "MULTIPLE_CHOICE":
+ for i, choice in enumerate(q["choices"]):
+ print(f"{i}. {choice}")
+ response = "a" # Mock response
+
+ # Otherwise, just get response
+ elif q["question_type"] == "FREE_RESPONSE":
+ response = "I don't know." # Mock response
+
+ responses.append(response)
+ print()
+
+ return responses
+```
+
+## Ending the Session
+
+End the AgentOps session when done:
+
+```python
+agentops.end_session(end_state="Success")
+```
+
+## Further Reading
+
+Check out more advanced examples like [Multi-Agent](/v2/examples/multi_agent) integration.
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+
+
diff --git a/docs/v2/examples/simple_agent.mdx b/docs/v2/examples/simple_agent.mdx
new file mode 100644
index 00000000..e2e37f0f
--- /dev/null
+++ b/docs/v2/examples/simple_agent.mdx
@@ -0,0 +1,108 @@
+---
+title: 'Simple Agent Example'
+description: 'Most basic usage with OpenAI API'
+mode: "wide"
+---
+_View Notebook on <a href={'https://github.com/AgentOps-AI/agentops/blob/main/examples/openai-gpt.ipynb'} target={'_blank'}>Github</a>_
+
+# AgentOps Basic Monitoring
+This is an example of how to use the AgentOps library for basic Agent monitoring with OpenAI's GPT
+
+## Installation
+
+<CodeGroup>
+ ```bash pip
+ pip install -U openai agentops
+ ```
+ ```bash poetry
+ poetry add openai agentops
+ ```
+</CodeGroup>
+
+## Setup
+
+Import the necessary libraries:
+
+```python
+from openai import OpenAI
+import agentops
+import os
+from dotenv import load_dotenv
+```
+
+Set up your API keys:
+
+```python
+load_dotenv()
+OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") or "<your_openai_key>"
+AGENTOPS_API_KEY = os.getenv("AGENTOPS_API_KEY") or "<your_agentops_key>"
+```
+
+Initialize AgentOps at the beginning of your application:
+
+```python
+# Initialize OpenAI client
+openai = OpenAI(api_key=OPENAI_API_KEY)
+
+# Initialize AgentOps with tags
+agentops.init(AGENTOPS_API_KEY, tags=["openai-gpt-example"])
+```
+
+## Single Completion Example
+
+Now just use OpenAI as you would normally!
+
+```python
+message = [{"role": "user", "content": "Write a 12 word poem about secret agents."}]
+response = openai.chat.completions.create(
+ model="gpt-3.5-turbo", messages=message, temperature=0.5, stream=False
+)
+print(response.choices[0].message.content)
+```
+
+Sessions are automatically managed by AgentOps. When your program exits, the session will be properly closed.
+
+## Tracking Custom Events
+
+You can track custom operations using decorators:
+
+```python
+from agentops.sdk.decorators import operation
+
+@operation(name="add numbers")
+def add(x, y):
+ return x + y
+
+result = add(2, 4)
+print(f"Result: {result}")
+```
+
+You can also create operations for more complex tracking:
+
+```python
+from agentops.sdk.decorators import operation
+
+@operation(name="check greeting")
+def check_greeting():
+ message = [{"role": "user", "content": "Hello"}]
+ response = openai.chat.completions.create(
+ model="gpt-3.5-turbo", messages=message, temperature=0.5
+ )
+
+ print(response.choices[0].message.content)
+
+ if "hello" in str(response.choices[0].message.content).lower():
+ return "Greeting detected"
+ return "No greeting detected"
+
+result = check_greeting()
+print(f"Greeting check: {result}")
+```
+
+## Further Reading
+
+Check out more advanced examples like [Multi-Agent](/v2/examples/multi_agent) or [OpenAI Assistants](/v2/examples/openai_assistants) integration.
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
\ No newline at end of file
diff --git a/docs/v2/img/chart-waterfall.png b/docs/v2/img/chart-waterfall.png
new file mode 100644
index 00000000..caa553a7
Binary files /dev/null and b/docs/v2/img/chart-waterfall.png differ
diff --git a/docs/v2/img/discord.png b/docs/v2/img/discord.png
new file mode 100644
index 00000000..e886e8da
Binary files /dev/null and b/docs/v2/img/discord.png differ
diff --git a/docs/v2/img/docs-icons/chat.png b/docs/v2/img/docs-icons/chat.png
new file mode 100644
index 00000000..c12465c7
Binary files /dev/null and b/docs/v2/img/docs-icons/chat.png differ
diff --git a/docs/v2/img/docs-icons/claude.png b/docs/v2/img/docs-icons/claude.png
new file mode 100644
index 00000000..abd83edd
Binary files /dev/null and b/docs/v2/img/docs-icons/claude.png differ
diff --git a/docs/v2/img/docs-icons/crew-banner.png b/docs/v2/img/docs-icons/crew-banner.png
new file mode 100644
index 00000000..ebe8a004
Binary files /dev/null and b/docs/v2/img/docs-icons/crew-banner.png differ
diff --git a/docs/v2/img/docs-icons/crew.png b/docs/v2/img/docs-icons/crew.png
new file mode 100644
index 00000000..bc50c6bf
Binary files /dev/null and b/docs/v2/img/docs-icons/crew.png differ
diff --git a/docs/v2/integrations/agentssdk.mdx b/docs/v2/integrations/agentssdk.mdx
new file mode 100644
index 00000000..f5233239
--- /dev/null
+++ b/docs/v2/integrations/agentssdk.mdx
@@ -0,0 +1,195 @@
+---
+title: OpenAI Agents SDK
+description: 'AgentOps and OpenAI Agents SDK integration for powerful multi-agent workflow monitoring.'
+---
+
+import CodeTooltip from '/snippets/add-code-tooltip.mdx'
+import EnvTooltip from '/snippets/add-env-tooltip.mdx'
+
+<Check>[Give us a star](https://github.com/AgentOps-AI/agentops) to bookmark on GitHub, save for later 🖇️)</Check>
+
+[OpenAI Agents SDK](https://github.com/openai/agentsdk_prototype) is a lightweight yet powerful framework for building multi-agent workflows. The SDK provides a comprehensive set of tools for creating, managing, and monitoring agent-based applications.
+
+{/* <Frame type="glass" caption="OpenAI Agents Tracing UI">
+ <img height="400" src="/images/openai-agents-tracing-ui.png" />
+</Frame> */}
+
+## Core Concepts
+
+- **Agents**: LLMs configured with instructions, tools, guardrails, and handoffs
+- **Handoffs**: Allow agents to transfer control to other agents for specific tasks
+- **Guardrails**: Configurable safety checks for input and output validation
+- **Tracing**: Built-in tracking of agent runs, allowing you to view, debug and optimize your workflows
+
+<Steps>
+ <Step title="Install the AgentOps SDK">
+ <CodeGroup>
+ ```bash pip
+ pip install agentops
+ ```
+ ```bash poetry
+ poetry add agentops
+ ```
+ </CodeGroup>
+ </Step>
+ <Step title="Install OpenAI Agents SDK">
+ <CodeGroup>
+ ```bash pip
+ pip install openai-agents
+ ```
+ ```bash poetry
+ poetry add openai-agents
+ ```
+ </CodeGroup>
+ <Tip>
+ This will be updated to a PyPI link when the package is officially released.
+ </Tip>
+ </Step>
+ <Step title="Add 2 lines of code">
+ <CodeTooltip/>
+ <CodeGroup>
+ ```python python
+ import agentops
+ agentops.init(<INSERT YOUR API KEY HERE>)
+ ```
+ </CodeGroup>
+ <EnvTooltip />
+ <CodeGroup>
+ ```python .env
+ AGENTOPS_API_KEY=<YOUR API KEY>
+ OPENAI_API_KEY=<YOUR OPENAI API KEY>
+ ```
+ </CodeGroup>
+ Read more about environment variables in [Advanced Configuration](/v2/usage/advanced-configuration)
+ </Step>
+ <Step title="Run your agents">
+ Execute your program and visit [app.agentops.ai/traces](https://app.agentops.ai/traces) 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="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/link-to-session.gif?raw=true" />
+ </Frame>
+ </Step>
+</Steps>
+
+## Hello World Example
+
+```python
+from agents import Agent, Runner
+import agentops
+
+# Initialize AgentOps
+agentops.init()
+
+agent = Agent(name="Assistant", instructions="You are a helpful assistant")
+
+result = Runner.run_sync(agent, "Write a haiku about recursion in programming.")
+print(result.final_output)
+
+# Output:
+# Code within the code,
+# Functions calling themselves,
+# Infinite loop's dance.
+```
+
+## Handoffs Example
+
+```python
+from agents import Agent, Runner
+import asyncio
+import agentops
+
+# Initialize AgentOps
+agentops.init()
+
+spanish_agent = Agent(
+ name="Spanish agent",
+ instructions="You only speak Spanish.",
+)
+
+english_agent = Agent(
+ name="English agent",
+ instructions="You only speak English",
+)
+
+triage_agent = Agent(
+ name="Triage agent",
+ instructions="Handoff to the appropriate agent based on the language of the request.",
+ handoffs=[spanish_agent, english_agent],
+)
+
+
+async def main():
+ result = await Runner.run(triage_agent, input="Hola, ¿cómo estás?")
+ print(result.final_output)
+ # ¡Hola! Estoy bien, gracias por preguntar. ¿Y tú, cómo estás?
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+## Functions Example
+
+```python
+import asyncio
+from agents import Agent, Runner, function_tool
+import agentops
+
+# Initialize AgentOps
+agentops.init()
+
+@function_tool
+def get_weather(city: str) -> str:
+ return f"The weather in {city} is sunny."
+
+
+agent = Agent(
+ name="Hello world",
+ instructions="You are a helpful agent.",
+ tools=[get_weather],
+)
+
+
+async def main():
+ result = await Runner.run(agent, input="What's the weather in Tokyo?")
+ print(result.final_output)
+ # The weather in Tokyo is sunny.
+
+
+if __name__ == "__main__":
+ asyncio.run(main())
+```
+
+## The Agent Loop
+
+When you call `Runner.run()`, the SDK runs a loop until it gets a final output:
+
+1. The LLM is called using the model and settings on the agent, along with the message history.
+2. The LLM returns a response, which may include tool calls.
+3. If the response has a final output, the loop ends and returns it.
+4. If the response has a handoff, the agent is set to the new agent and the loop continues from step 1.
+5. Tool calls are processed (if any) and tool response messages are appended. Then the loop continues from step 1.
+
+You can use the `max_turns` parameter to limit the number of loop executions.
+
+## Final Output
+
+Final output is the last thing the agent produces in the loop:
+
+- If you set an `output_type` on the agent, the final output is when the LLM returns something of that type using structured outputs.
+- If there's no `output_type` (i.e., plain text responses), then the first LLM response without any tool calls or handoffs is considered the final output.
+
+<CardGroup cols={3}>
+ <Card title="Basic Agent" icon="robot" href="https://github.com/openai/agentsdk_prototype/tree/main/examples/basic" />
+ <Card title="Multi-Agent" icon="users" href="https://github.com/openai/agentsdk_prototype/tree/main/examples/multi_agent" />
+ <Card title="Tool Usage" icon="toolbox" href="https://github.com/openai/agentsdk_prototype/tree/main/examples/tools" />
+</CardGroup>
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="css" src="/styles/styles.css"></script>
+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>
\ No newline at end of file
diff --git a/docs/v2/integrations/anthropic.mdx b/docs/v2/integrations/anthropic.mdx
new file mode 100644
index 00000000..e80ed48e
--- /dev/null
+++ b/docs/v2/integrations/anthropic.mdx
@@ -0,0 +1,201 @@
+---
+title: Anthropic
+description: "Track and analyze your Anthropic API calls with AgentOps"
+---
+
+import CodeTooltip from '/snippets/add-code-tooltip.mdx'
+import EnvTooltip from '/snippets/add-env-tooltip.mdx'
+
+AgentOps provides seamless integration with [Anthropic's Python SDK](https://github.com/anthropics/anthropic-sdk-python), allowing you to track and analyze all your Claude model interactions automatically.
+
+## Installation
+
+<CodeTooltip />
+
+ <CodeGroup>
+ ```bash pip
+ pip install agentops anthropic
+ ```
+ ```bash poetry
+ poetry add agentops anthropic
+ ```
+ </CodeGroup>
+
+## Usage
+
+Initialize AgentOps at the beginning of your application to automatically track all Anthropic API calls:
+
+ <CodeGroup>
+```python Basic Usage
+import agentops
+import anthropic
+
+# Initialize AgentOps
+agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Create Anthropic client
+client = anthropic.Anthropic(api_key="<YOUR_ANTHROPIC_API_KEY>")
+
+# Make a completion request - AgentOps will track it automatically
+message = client.messages.create(
+ model="claude-3-opus-20240229",
+ max_tokens=1000,
+ messages=[
+ {"role": "user", "content": "What is artificial intelligence?"}
+ ]
+)
+
+print(message.content[0].text)
+ ```
+ </CodeGroup>
+
+## Advanced Examples
+
+### Streaming Example
+
+AgentOps automatically tracks streaming completions:
+
+ <CodeGroup>
+```python Streaming Example
+import agentops
+import anthropic
+
+# Initialize AgentOps
+ agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Create Anthropic client
+client = anthropic.Anthropic(api_key="<YOUR_ANTHROPIC_API_KEY>")
+
+# Make a streaming request
+with client.messages.stream(
+ model="claude-3-haiku-20240307",
+ max_tokens=1000,
+ messages=[
+ {"role": "user", "content": "Write a short poem about artificial intelligence."}
+ ]
+) as stream:
+ for text in stream.text_stream:
+ print(text, end="", flush=True)
+ print() # Add a newline at the end
+ ```
+ </CodeGroup>
+
+### System Prompt Example
+
+AgentOps tracks interactions with system prompts:
+
+ <CodeGroup>
+```python System Prompt
+import agentops
+import anthropic
+
+# Initialize AgentOps
+agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Create Anthropic client
+client = anthropic.Anthropic(api_key="<YOUR_ANTHROPIC_API_KEY>")
+
+# Make a request with a system prompt
+message = client.messages.create(
+ model="claude-3-sonnet-20240229",
+ max_tokens=1000,
+ system="You are a helpful AI assistant with expertise in science and technology. Keep your answers concise and accurate.",
+ messages=[
+ {"role": "user", "content": "Explain quantum computing in simple terms."}
+ ]
+)
+
+print(message.content[0].text)
+ ```
+ </CodeGroup>
+
+### Tool Use Example
+
+AgentOps tracks tool use with Claude:
+
+<CodeGroup>
+```python Tool Use
+import agentops
+import anthropic
+import json
+from datetime import datetime
+
+# Initialize AgentOps
+ agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Create Anthropic client
+client = anthropic.Anthropic(api_key="<YOUR_ANTHROPIC_API_KEY>")
+
+# Define tools
+tools = [
+ {
+ "name": "get_current_time",
+ "description": "Get the current date and time",
+ "input_schema": {},
+ }
+]
+
+def get_current_time():
+ return {"current_time": datetime.now().isoformat()}
+
+# Make a request with tools
+ message = client.messages.create(
+ model="claude-3-opus-20240229",
+ max_tokens=1000,
+ tools=tools,
+ messages=[
+ {"role": "user", "content": "What time is it now?"}
+ ]
+ )
+
+# Handle tool use
+if message.content[0].type == "tool_use":
+ tool_use = message.content[0].tool_use
+ tool_name = tool_use.name
+
+ if tool_name == "get_current_time":
+ tool_response = get_current_time()
+
+ # Continue the conversation with the tool response
+ second_message = client.messages.create(
+ model="claude-3-opus-20240229",
+ max_tokens=1000,
+ messages=[
+ {"role": "user", "content": "What time is it now?"},
+ {"role": "assistant", "content": [
+ {"type": "tool_use", "tool_use": {
+ "name": "get_current_time",
+ "input": {}
+ }}
+ ]},
+ {"role": "user", "content": [
+ {"type": "tool_result", "tool_result": {
+ "tool_name": "get_current_time",
+ "content": json.dumps(tool_response)
+ }}
+ ]}
+ ]
+ )
+
+ print(second_message.content[0].text)
+else:
+ print(message.content[0].text)
+```
+</CodeGroup>
+
+## Environment Variables
+
+<EnvTooltip />
+<CodeGroup>
+ ```python .env
+ AGENTOPS_API_KEY=<YOUR API KEY>
+ ANTHROPIC_API_KEY=<YOUR ANTHROPIC API KEY>
+ ```
+</CodeGroup>
+
+Read more about environment variables in [Advanced Configuration](/v2/usage/advanced-configuration)
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="css" src="/styles/styles.css"></script>
diff --git a/docs/v2/integrations/autogen.mdx b/docs/v2/integrations/autogen.mdx
new file mode 100644
index 00000000..a8bf137b
--- /dev/null
+++ b/docs/v2/integrations/autogen.mdx
@@ -0,0 +1,159 @@
+---
+title: AutoGen
+description: "Track and analyze your AutoGen agents with AgentOps"
+---
+
+import CodeTooltip from '/snippets/add-code-tooltip.mdx'
+import EnvTooltip from '/snippets/add-env-tooltip.mdx'
+
+## Installation
+
+<CodeGroup>
+ ```bash pip
+ pip install agentops pyautogen
+ ```
+ ```bash poetry
+ poetry add agentops pyautogen
+ ```
+</CodeGroup>
+
+## Usage
+
+Initialize AgentOps at the beginning of your application to automatically track all AutoGen agent interactions:
+
+<CodeGroup>
+```python Python
+import agentops
+import autogen
+
+# Initialize AgentOps
+agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Configure your AutoGen agents
+config_list = [
+ {
+ "model": "gpt-4",
+ "api_key": "<YOUR_OPENAI_API_KEY>"
+ }
+]
+
+llm_config = {
+ "config_list": config_list,
+ "timeout": 60,
+}
+
+# Create AutoGen agents
+assistant = autogen.AssistantAgent(
+ name="assistant",
+ llm_config=llm_config,
+ system_message="You are a helpful AI assistant."
+)
+
+user_proxy = autogen.UserProxyAgent(
+ name="user_proxy",
+ human_input_mode="TERMINATE",
+ max_consecutive_auto_reply=10,
+ is_termination_msg=lambda x: x.get("content", "").rstrip().endswith("TERMINATE"),
+ code_execution_config={"last_n_messages": 3, "work_dir": "coding"},
+)
+
+# Initiate a conversation
+user_proxy.initiate_chat(
+ assistant,
+ message="How can I implement a basic web scraper in Python?"
+)
+
+# All agent interactions are automatically tracked by AgentOps
+```
+</CodeGroup>
+
+## Multi-Agent Conversation Example
+
+AgentOps tracks interactions across multiple AutoGen agents:
+
+<CodeGroup>
+```python Python
+import agentops
+import autogen
+
+# Initialize AgentOps
+agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Configure LLM
+config_list = [
+ {
+ "model": "gpt-4",
+ "api_key": "<YOUR_OPENAI_API_KEY>"
+ }
+]
+
+llm_config = {
+ "config_list": config_list,
+ "timeout": A 60,
+}
+
+# Create a team of agents
+researcher = autogen.AssistantAgent(
+ name="researcher",
+ llm_config=llm_config,
+ system_message="You are a researcher who specializes in finding accurate information."
+)
+
+coder = autogen.AssistantAgent(
+ name="coder",
+ llm_config=llm_config,
+ system_message="You are an expert programmer who writes clean, efficient code."
+)
+
+critic = autogen.AssistantAgent(
+ name="critic",
+ llm_config=llm_config,
+ system_message="You review solutions and provide constructive feedback."
+)
+
+user_proxy = autogen.UserProxyAgent(
+ name="user_proxy",
+ human_input_mode="TERMINATE",
+ max_consecutive_auto_reply=10,
+ is_termination_msg=lambda x: x.get("content", "").rstrip().endswith("TERMINATE"),
+ code_execution_config={"last_n_messages": 3, "work_dir": "coding"},
+)
+
+# Create a group chat
+groupchat = autogen.GroupChat(
+ agents=[user_proxy, researcher, coder, critic],
+ messages=[],
+ max_round=12
+)
+
+manager = autogen.GroupChatManager(
+ groupchat=groupchat,
+ llm_config=llm_config
+)
+
+# Initiate the group chat
+user_proxy.initiate_chat(
+ manager,
+ message="Create a Python program to analyze sentiment from Twitter data."
+)
+
+# All agent interactions across the group chat are automatically tracked by AgentOps
+```
+</CodeGroup>
+
+## Environment Variables
+
+<EnvTooltip />
+<CodeGroup>
+ ```python .env
+ AGENTOPS_API_KEY=<YOUR API KEY>
+ OPENAI_API_KEY=<YOUR OPENAI API KEY>
+ ```
+</CodeGroup>
+
+Read more about environment variables in [Advanced Configuration](/v2/usage/advanced-configuration)
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="css" src="/styles/styles.css"></script>
diff --git a/docs/v2/integrations/crewai.mdx b/docs/v2/integrations/crewai.mdx
new file mode 100644
index 00000000..8b519869
--- /dev/null
+++ b/docs/v2/integrations/crewai.mdx
@@ -0,0 +1,98 @@
+---
+title: 'CrewAI'
+description: 'AgentOps and CrewAI teamed up to make monitoring Crew agents dead simple.'
+---
+
+import CodeTooltip from '/snippets/add-code-tooltip.mdx'
+import EnvTooltip from '/snippets/add-env-tooltip.mdx'
+
+[CrewAI](https://www.crewai.com/) is a framework for easily building multi-agent applications. 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/) guide.
+
+<Steps>
+ <Step title="Install the AgentOps SDK">
+ <CodeGroup>
+ ```bash pip
+ pip install agentops crewai
+ ```
+ ```bash poetry
+ poetry add agentops crewai
+ ```
+ </CodeGroup>
+ </Step>
+ <Step title="Add AgentOps to your code">
+ <CodeTooltip/>
+ <CodeGroup>
+ ```python python
+ import agentops
+ from crewai import Agent, Task, Crew, LLM
+ import os
+ from dotenv import load_dotenv
+
+ # Load environment variables
+ load_dotenv()
+ OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") or "YOUR_OPENAI_API_KEY"
+ AGENTOPS_API_KEY = os.getenv("AGENTOPS_API_KEY") or "YOUR_AGENTOPS_API_KEY"
+
+ # Initialize AgentOps at the start of your application
+ agentops.init(AGENTOPS_API_KEY)
+
+ # Set up your CrewAI elements as you normally would
+ # AgentOps will automatically track all interactions
+ llm = LLM(model="openai/gpt-4o", api_key=OPENAI_API_KEY)
+
+ researcher = Agent(
+ role="Researcher",
+ goal="Find accurate information about a topic",
+ backstory="You're an expert researcher with keen attention to detail",
+ llm=llm
+ )
+
+ research_task = Task(
+ description="Research the latest developments in quantum computing",
+ expected_output="A comprehensive report on the latest breakthroughs in quantum computing, including advancements in quantum algorithms, hardware, and potential applications.",
+ agent=researcher
+ )
+
+ crew = Crew(
+ agents=[researcher],
+ tasks=[research_task],
+ verbose=True
+ )
+
+ # Run the crew - AgentOps will track everything
+ result = crew.kickoff()
+ ```
+ </CodeGroup>
+ <EnvTooltip />
+ <CodeGroup>
+ ```python .env
+ AGENTOPS_API_KEY=<YOUR API KEY>
+ ```
+ </CodeGroup>
+ Read more about environment variables in [Advanced Configuration](/v2/usage/advanced-configuration)
+ </Step>
+ <Step title="Run your crew">
+ Execute your program and visit [app.agentops.ai/traces](https://app.agentops.ai/traces) 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="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/link-to-session.gif?raw=true" />
+ </Frame>
+ </Step>
+</Steps>
+
+## Crew + AgentOps Examples
+
+<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>
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="css" src="/styles/styles.css"></script>
+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>
diff --git a/docs/v2/integrations/gemini.mdx b/docs/v2/integrations/gemini.mdx
new file mode 100644
index 00000000..ace6e6d3
--- /dev/null
+++ b/docs/v2/integrations/gemini.mdx
@@ -0,0 +1,208 @@
+---
+title: Google Generative AI (Gemini)
+description: "Monitor and analyze your Google Gemini API calls with AgentOps"
+---
+
+import CodeTooltip from '/snippets/add-code-tooltip.mdx'
+import EnvTooltip from '/snippets/add-env-tooltip.mdx'
+
+AgentOps provides seamless integration with [Google's Generative AI API](https://ai.google.dev/), allowing you to monitor and analyze all your Gemini model interactions automatically.
+
+## Installation
+
+<CodeGroup>
+ ```bash pip
+ pip install agentops google-genai
+ ```
+ ```bash poetry
+ poetry add agentops google-genai
+ ```
+</CodeGroup>
+
+## Usage
+
+Initialize AgentOps at the beginning of your application to automatically track all Gemini API calls:
+
+<CodeGroup>
+```python Python
+import agentops
+from google import genai
+
+# Initialize AgentOps
+agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Create a client for Gemini Developer API
+client = genai.Client(api_key="YOUR_GEMINI_API_KEY")
+
+# Generate content with a model
+response = client.models.generate_content(
+ model='gemini-2.0-flash-001',
+ contents='What is AI observability?'
+)
+
+print(response.text)
+
+# All Gemini API calls are automatically tracked by AgentOps
+```
+</CodeGroup>
+
+## Alternative Client Setup
+
+You can also set up the client using environment variables or with Vertex AI:
+
+<CodeGroup>
+```python Using Environment Variables
+import agentops
+from google import genai
+
+# Initialize AgentOps
+agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Set GOOGLE_API_KEY environment variable before running
+# export GOOGLE_API_KEY='your-api-key'
+client = genai.Client()
+
+# Generate content
+response = client.models.generate_content(
+ model='gemini-2.0-flash-001',
+ contents='What is AI observability?'
+)
+
+print(response.text)
+```
+
+```python Vertex AI
+import agentops
+from google import genai
+
+# Initialize AgentOps
+agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Using Vertex AI
+client = genai.Client(
+ vertexai=True,
+ project='your-project-id',
+ location='us-central1'
+)
+
+# Generate content
+response = client.models.generate_content(
+ model='gemini-2.0-flash-001',
+ contents='What is AI observability?'
+)
+
+print(response.text)
+```
+</CodeGroup>
+
+## System Instructions and Settings
+
+You can customize the model behavior with system instructions and other settings:
+
+<CodeGroup>
+```python With System Instructions
+import agentops
+from google import genai
+from google.genai import types
+
+# Initialize AgentOps
+agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Create a client
+client = genai.Client(api_key="YOUR_GEMINI_API_KEY")
+
+# Generate content with system instructions
+response = client.models.generate_content(
+ model='gemini-2.0-flash-001',
+ contents='Write a short poem',
+ config=types.GenerateContentConfig(
+ system_instruction='You are a professional poet who specializes in sonnets',
+ max_output_tokens=200,
+ temperature=0.7,
+ ),
+)
+
+print(response.text)
+```
+</CodeGroup>
+
+## Streaming Example
+
+AgentOps also supports tracking streaming requests with Gemini:
+
+<CodeGroup>
+```python Streaming
+import agentops
+from google import genai
+
+# Initialize AgentOps
+agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Create a client
+client = genai.Client(api_key="YOUR_GEMINI_API_KEY")
+
+# Generate streaming content
+for chunk in client.models.generate_content(
+ model='gemini-2.0-flash-001',
+ contents='Explain quantum computing in simple terms.',
+ stream=True
+):
+ print(chunk.text, end="", flush=True)
+
+# All streaming requests are automatically tracked by AgentOps
+```
+</CodeGroup>
+
+## Chat Example
+
+<CodeGroup>
+```python Chat
+import agentops
+from google import genai
+
+# Initialize AgentOps
+agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Create a client
+client = genai.Client(api_key="YOUR_GEMINI_API_KEY")
+
+# Start a chat session
+chat = client.chats.create(model='gemini-2.0-flash-001')
+
+# Send messages and get responses
+response = chat.send_message('Hello, how can you help me with AI development?')
+print(response.text)
+
+# Continue the conversation
+response = chat.send_message('What are the best practices for prompt engineering?')
+print(response.text)
+
+# All chat interactions are automatically tracked by AgentOps
+```
+</CodeGroup>
+
+## Environment Variables
+
+<EnvTooltip />
+<CodeGroup>
+ ```python .env
+ AGENTOPS_API_KEY=<YOUR API KEY>
+ GOOGLE_API_KEY=<YOUR GEMINI API KEY>
+
+ # For Vertex AI
+ # GOOGLE_GENAI_USE_VERTEXAI=true
+ # GOOGLE_CLOUD_PROJECT=your-project-id
+ # GOOGLE_CLOUD_LOCATION=us-central1
+ ```
+</CodeGroup>
+
+Read more about environment variables in [Advanced Configuration](/v2/usage/advanced-configuration)
+
+## Additional Resources
+
+For more information on using the Google Gen AI SDK, refer to the [official documentation](https://googleapis.github.io/python-genai/).
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="css" src="/styles/styles.css"></script>
\ No newline at end of file
diff --git a/docs/v2/integrations/google_adk.mdx b/docs/v2/integrations/google_adk.mdx
new file mode 100644
index 00000000..9978d78d
--- /dev/null
+++ b/docs/v2/integrations/google_adk.mdx
@@ -0,0 +1,115 @@
+---
+title: Google ADK
+description: "Track and analyze your Google Agent Development Kit (ADK) AI agents with AgentOps"
+---
+
+import CodeTooltip from '/snippets/add-code-tooltip.mdx'
+import EnvTooltip from '/snippets/add-env-tooltip.mdx'
+
+AgentOps provides seamless integration with [Google Agent Development Kit (ADK)](https://google.github.io/adk-docs/), allowing you to track and analyze all your ADK agent interactions automatically.
+
+## Installation
+
+<CodeTooltip />
+
+ <CodeGroup>
+ ```bash pip
+ pip install agentops google-adk
+ ```
+ ```bash poetry
+ poetry add agentops google-adk
+ ```
+ </CodeGroup>
+
+## Basic Usage
+
+Initialize AgentOps at the beginning of your application to automatically track all Google ADK agent interactions:
+
+ <CodeGroup>
+```python Basic Usage
+import asyncio
+import uuid
+import os
+from google.genai import types
+
+import agentops
+from google.adk.agents import Agent
+from google.adk.runners import InMemoryRunner
+from google.adk.agents.run_config import RunConfig, StreamingMode
+
+# Initialize AgentOps
+agentops.init(api_key="<INSERT YOUR API KEY HERE>")
+
+# Create a simple agent with no tools
+agent = Agent(
+ name="simple_agent",
+ model="gemini-1.5-flash",
+ instruction="You are a helpful assistant that provides clear and concise answers.",
+)
+
+# Create a runner
+runner = InMemoryRunner(
+ agent=agent,
+ app_name="simple-example",
+)
+
+# Setup session
+user_id = f"user-{uuid.uuid4().hex[:8]}"
+session_id = f"session-{uuid.uuid4().hex[:8]}"
+runner.session_service.create_session(
+ app_name="simple-example",
+ user_id=user_id,
+ session_id=session_id,
+)
+
+# Run the agent with a user message
+async def run_agent():
+ message = "What are three benefits of artificial intelligence?"
+
+ content = types.Content(
+ role="user",
+ parts=[types.Part(text=message)],
+ )
+
+ run_config = RunConfig(
+ streaming_mode=StreamingMode.NONE,
+ )
+
+ async for event in runner.run_async(
+ user_id=user_id,
+ session_id=session_id,
+ new_message=content,
+ run_config=run_config,
+ ):
+ if hasattr(event, 'content') and event.content and event.content.parts:
+ for part in event.content.parts:
+ if hasattr(part, 'text') and part.text:
+ print(part.text)
+
+# Run the agent
+asyncio.run(run_agent())
+ ```
+ </CodeGroup>
+
+## Environment Variables
+
+<EnvTooltip />
+<CodeGroup>
+ ```python .env
+ AGENTOPS_API_KEY=<YOUR API KEY>
+ GOOGLE_API_KEY=<YOUR GOOGLE API KEY>
+ ```
+</CodeGroup>
+
+Read more about environment variables in [Advanced Configuration](/v2/usage/advanced-configuration)
+
+## Additional Resources
+
+- [Google ADK Documentation](https://google.github.io/adk-docs/)
+- [Google ADK GitHub Repository](https://github.com/google/adk-docs)
+- [Google ADK Quickstart Guide](https://google.github.io/adk-docs/get-started/quickstart/)
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="css" src="/styles/styles.css"></script>
\ No newline at end of file
diff --git a/docs/v2/integrations/ibm_watsonx_ai.mdx b/docs/v2/integrations/ibm_watsonx_ai.mdx
new file mode 100644
index 00000000..656c5e05
--- /dev/null
+++ b/docs/v2/integrations/ibm_watsonx_ai.mdx
@@ -0,0 +1,297 @@
+---
+title: IBM Watsonx.ai
+description: "Track and analyze your IBM Watsonx.ai API calls with AgentOps"
+---
+
+import CodeTooltip from '/snippets/add-code-tooltip.mdx'
+import EnvTooltip from '/snippets/add-env-tooltip.mdx'
+
+AgentOps provides seamless integration with [IBM Watsonx.ai Python SDK](https://ibm.github.io/watsonx-ai-python-sdk/), allowing you to track and analyze all your Watsonx.ai model interactions automatically.
+
+## Installation
+
+<CodeTooltip />
+
+ <CodeGroup>
+ ```bash pip
+ pip install agentops ibm-watsonx-ai
+ ```
+ ```bash poetry
+ poetry add agentops ibm-watsonx-ai
+ ```
+ </CodeGroup>
+
+## Basic Usage
+
+Initialize AgentOps at the beginning of your application to automatically track all IBM Watsonx.ai API calls:
+
+ <CodeGroup>
+```python Basic Usage
+import agentops
+from ibm_watsonx_ai import Credentials
+from ibm_watsonx_ai.foundation_models import ModelInference
+
+# Initialize AgentOps
+agentops.init(api_key="<INSERT YOUR API KEY HERE>")
+
+# Initialize credentials
+credentials = Credentials(
+ url="<YOUR_IBM_URL>",
+ api_key="<YOUR_IBM_API_KEY>",
+)
+
+# Project ID
+project_id = "<YOUR_PROJECT_ID>"
+
+# Create a model instance
+model = ModelInference(
+ model_id="meta-llama/llama-3-3-70b-instruct",
+ credentials=credentials,
+ project_id=project_id
+)
+
+# Make a completion request - AgentOps will track it automatically
+response = model.generate_text("What is artificial intelligence?")
+print(f"Generated Text:\n{response}")
+
+# Don't forget to close connection when done
+model.close_persistent_connection()
+ ```
+ </CodeGroup>
+
+## Chat Completion Example
+
+Using the Watsonx.ai SDK for chat-based interactions:
+
+ <CodeGroup>
+```python Chat Example
+import agentops
+from ibm_watsonx_ai import Credentials
+from ibm_watsonx_ai.foundation_models import ModelInference
+
+# Initialize AgentOps
+agentops.init(api_key="<INSERT YOUR API KEY HERE>")
+
+# Initialize credentials
+credentials = Credentials(
+ url="<YOUR_IBM_URL>",
+ api_key="<YOUR_IBM_API_KEY>",
+)
+
+# Project ID
+project_id = "<YOUR_PROJECT_ID>"
+
+# Create model for chat
+chat_model = ModelInference(
+ model_id="meta-llama/llama-3-3-70b-instruct",
+ credentials=credentials,
+ project_id=project_id
+)
+
+# Format messages for chat method
+messages = [
+ {"role": "system", "content": "You are a helpful AI assistant."},
+ {"role": "user", "content": "What are the three laws of robotics?"}
+]
+
+# Get chat response
+chat_response = chat_model.chat(messages)
+print(f"Chat Response:\n{chat_response['choices'][0]['message']['content']}")
+
+# Close connection
+chat_model.close_persistent_connection()
+ ```
+ </CodeGroup>
+
+## Advanced Examples
+
+### Streaming Example
+
+AgentOps automatically tracks streaming completions:
+
+ <CodeGroup>
+```python Streaming Example
+import agentops
+from ibm_watsonx_ai import Credentials
+from ibm_watsonx_ai.foundation_models import ModelInference
+
+# Initialize AgentOps
+agentops.init(api_key="<INSERT YOUR API KEY HERE>")
+
+# Initialize credentials
+credentials = Credentials(
+ url="<YOUR_IBM_URL>",
+ api_key="<YOUR_IBM_API_KEY>",
+)
+
+project_id = "<YOUR_PROJECT_ID>"
+
+# Create model for streaming
+model = ModelInference(
+ model_id="google/flan-ul2",
+ credentials=credentials,
+ project_id=project_id
+)
+
+# Text streaming
+stream_response = model.generate_text_stream(
+ prompt="Write a short poem about artificial intelligence."
+)
+
+print("Streaming Response:")
+for chunk in stream_response:
+ if isinstance(chunk, str):
+ print(chunk, end="", flush=True)
+
+# Close connection
+model.close_persistent_connection()
+ ```
+ </CodeGroup>
+
+### Chat Streaming Example
+
+Stream responses from chat-based models:
+
+ <CodeGroup>
+```python Chat Streaming
+import agentops
+from ibm_watsonx_ai import Credentials
+from ibm_watsonx_ai.foundation_models import ModelInference
+
+# Initialize AgentOps
+agentops.init(api_key="<INSERT YOUR API KEY HERE>")
+
+# Initialize credentials
+credentials = Credentials(
+ url="<YOUR_IBM_URL>",
+ api_key="<YOUR_IBM_API_KEY>",
+)
+
+project_id = "<YOUR_PROJECT_ID>"
+
+# Create model for chat streaming
+chat_model = ModelInference(
+ model_id="meta-llama/llama-3-3-70b-instruct",
+ credentials=credentials,
+ project_id=project_id
+)
+
+# Format messages for chat method
+chat_messages = [
+ {"role": "system", "content": "You are a concise assistant."},
+ {"role": "user", "content": "Explain the concept of photosynthesis in one sentence."}
+]
+
+# Get streaming chat response
+chat_stream = chat_model.chat_stream(messages=chat_messages)
+
+print("Chat Stream Response:")
+for chunk in chat_stream:
+ if chunk and 'choices' in chunk and chunk['choices']:
+ delta = chunk['choices'][0].get('delta', {})
+ content = delta.get('content')
+ if content:
+ print(content, end="", flush=True)
+
+# Close connection
+chat_model.close_persistent_connection()
+ ```
+ </CodeGroup>
+
+### With Parameters Example
+
+Using the Watsonx.ai SDK with specific generation parameters:
+
+ <CodeGroup>
+```python With Parameters
+import agentops
+from ibm_watsonx_ai import Credentials
+from ibm_watsonx_ai.foundation_models import ModelInference
+from ibm_watsonx_ai.foundation_models.schema import TextGenParameters
+
+# Initialize AgentOps
+agentops.init(api_key="<INSERT YOUR API KEY HERE>")
+
+# Initialize credentials
+credentials = Credentials(
+ url="<YOUR_IBM_URL>",
+ api_key="<YOUR_IBM_API_KEY>",
+)
+
+project_id = "<YOUR_PROJECT_ID>"
+
+# Create model with parameters
+model = ModelInference(
+ model_id="google/flan-ul2",
+ credentials=credentials,
+ project_id=project_id,
+ params=TextGenParameters(
+ decoding_method="sample",
+ max_new_tokens=100,
+ min_new_tokens=10,
+ temperature=0.7,
+ top_p=0.9,
+ top_k=50,
+ repetition_penalty=1.2,
+ random_seed=42
+ )
+)
+
+# Generate text
+response = model.generate_text("Explain quantum computing in simple terms.")
+print(f"Response:\n{response}")
+
+# Close connection
+model.close_persistent_connection()
+ ```
+ </CodeGroup>
+
+### Tokenization Example
+
+Tokenize text with the Watsonx.ai SDK:
+
+ <CodeGroup>
+```python Tokenization
+import agentops
+from ibm_watsonx_ai import Credentials
+from ibm_watsonx_ai.foundation_models import ModelInference
+
+# Initialize AgentOps
+agentops.init(api_key="<INSERT YOUR API KEY HERE>")
+
+# Initialize credentials
+credentials = Credentials(
+ url="<YOUR_IBM_URL>",
+ api_key="<YOUR_IBM_API_KEY>",
+)
+
+project_id = "<YOUR_PROJECT_ID>"
+
+# Create model
+model = ModelInference(
+ model_id="google/flan-ul2",
+ credentials=credentials,
+ project_id=project_id
+)
+
+# Tokenize text
+text_to_tokenize = "Hello, how are you today?"
+tokens = model.tokenize(text_to_tokenize)
+print(f"Tokenization Result:\n{tokens}")
+
+# Close connection
+model.close_persistent_connection()
+ ```
+ </CodeGroup>
+
+Read more about environment variables in [Advanced Configuration](/v2/usage/advanced-configuration)
+
+## Additional Resources
+
+- [IBM Watsonx.ai Python SDK Documentation](https://ibm.github.io/watsonx-ai-python-sdk/)
+- [IBM Watsonx.ai Models](http://ibm.com/products/watsonx-ai/foundation-models)
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="css" src="/styles/styles.css"></script>
\ No newline at end of file
diff --git a/docs/v2/integrations/langchain.mdx b/docs/v2/integrations/langchain.mdx
new file mode 100644
index 00000000..e9ea799a
--- /dev/null
+++ b/docs/v2/integrations/langchain.mdx
@@ -0,0 +1,115 @@
+---
+title: LangChain
+description: "Track your LangChain agents with AgentOps"
+---
+
+import CodeTooltip from '/snippets/add-code-tooltip.mdx'
+import EnvTooltip from '/snippets/add-env-tooltip.mdx'
+
+[LangChain](https://python.langchain.com/docs/tutorials/) is a framework for developing applications powered by language models. AgentOps automatically tracks your LangChain agents by simply initializing the SDK at the beginning of your application.
+
+## Adding AgentOps to LangChain applications
+
+<Steps>
+ <Step title="Install the AgentOps SDK and the additional LangChain dependencies">
+ <CodeGroup>
+ ```bash pip
+ pip install agentops langchain langchain-community
+ ```
+ ```bash poetry
+ poetry add agentops langchain langchain-community
+ ```
+ </CodeGroup>
+ <Check>[Give us a star](https://github.com/AgentOps-AI/agentops) on GitHub while you're at it (you may be our <span id="stars-text">3,000th</span> 😊)</Check>
+ </Step>
+ <Step title="Set up your import statements">
+ Import the following LangChain and AgentOps dependencies
+ <CodeGroup>
+ ```python python
+ import os
+ from langchain_community.chat_models import ChatOpenAI
+ from langchain.agents import initialize_agent, AgentType
+ from langchain.tools import DuckDuckGoSearchRun
+ from agentops.integration.callbacks.langchain import LangchainCallbackHandler
+ ```
+ </CodeGroup>
+ </Step>
+ <Step title="Set up your LangChain handler to make the calls">
+ <Tip>
+ Note that you don't need to set up a separate agentops.init() call, as the LangChain callback handler will automatically initialize the AgentOps client for you.
+ </Tip>
+ Set up your LangChain agent with the AgentOps callback handler, and AgentOps will automatically record your LangChain sessions.
+ <CodeGroup>
+ ```python python
+ handler = LangchainCallbackHandler(api_key=AGENTOPS_API_KEY, tags=['LangChain Example'])
+
+ # Define tools for the agent
+ search_tool = DuckDuckGoSearchRun()
+ tools = [search_tool]
+
+ llm = ChatOpenAI(openai_api_key=OPENAI_API_KEY,
+ callbacks=[handler],
+ model='gpt-3.5-turbo')
+
+ agent = initialize_agent(tools,
+ llm,
+ agent=AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION,
+ verbose=True,
+ callbacks=[handler], # You must pass in a callback handler to record your agent
+ handle_parsing_errors=True)
+ ```
+ </CodeGroup>
+ <EnvTooltip />
+ <CodeGroup>
+ ```python .env
+ AGENTOPS_API_KEY=<YOUR API KEY>
+ ```
+ </CodeGroup>
+ Read more about environment variables in [Advanced Configuration](/v1/usage/advanced-configuration)
+ </Step>
+ <Step title="Run your agent">
+ Execute your program and visit [app.agentops.ai/traces](https://app.agentops.ai/traces) to observe your LangChain Agent! 🕵️
+ <Tip>
+ After your run, AgentOps prints a clickable URL to the 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="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/link-to-session.gif?raw=true" />
+ </Frame>
+ </Step>
+</Steps>
+
+## Full Examples
+
+<CodeGroup>
+ ```python python
+ import os
+ from langchain_community.chat_models import ChatOpenAI
+ from langchain.agents import initialize_agent, AgentType
+ from langchain.tools import DuckDuckGoSearchRun
+ from agentops.integration.callbacks.langchain import LangchainCallbackHandler
+
+ handler = LangchainCallbackHandler(api_key=AGENTOPS_API_KEY, tags=['LangChain Example'])
+
+ # Define tools for the agent
+ search_tool = DuckDuckGoSearchRun()
+ tools = [search_tool]
+
+ llm = ChatOpenAI(openai_api_key=OPENAI_API_KEY,
+ callbacks=[handler],
+ model='gpt-3.5-turbo')
+
+ agent = initialize_agent(tools,
+ llm,
+ agent=AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION,
+ verbose=True,
+ callbacks=[handler], # You must pass in a callback handler to record your agent
+ handle_parsing_errors=True)
+ ```
+</CodeGroup>
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="css" src="/styles/styles.css"></script>
+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>
diff --git a/docs/v2/integrations/litellm.mdx b/docs/v2/integrations/litellm.mdx
new file mode 100644
index 00000000..e5320312
--- /dev/null
+++ b/docs/v2/integrations/litellm.mdx
@@ -0,0 +1,176 @@
+---
+title: LiteLLM
+description: "Track and analyze your LiteLLM calls across multiple providers with AgentOps"
+---
+
+import CodeTooltip from '/snippets/add-code-tooltip.mdx'
+import EnvTooltip from '/snippets/add-env-tooltip.mdx'
+
+AgentOps provides seamless integration with [LiteLLM](https://github.com/BerriAI/litellm), allowing you to automatically track all your LLM API calls across different providers through a unified interface.
+
+## Installation
+
+<CodeGroup>
+ ```bash pip
+ pip install agentops litellm
+ ```
+ ```bash poetry
+ poetry add agentops litellm
+ ```
+</CodeGroup>
+
+## Usage
+
+The simplest way to integrate AgentOps with LiteLLM is to set up the success_callback:
+
+<CodeGroup>
+```python Simple Integration
+import litellm
+
+# Configure LiteLLM to use AgentOps
+litellm.success_callback = ["agentops"]
+
+# Make completion requests with LiteLLM
+response = litellm.completion(
+ model="gpt-3.5-turbo",
+ messages=[{"role": "user", "content": "Hello, how are you?"}]
+)
+
+print(response.choices[0].message.content)
+
+# All LiteLLM API calls are automatically tracked by AgentOps
+```
+</CodeGroup>
+
+You can also initialize AgentOps separately for additional configuration:
+
+<CodeGroup>
+```python With AgentOps Init
+import agentops
+from litellm import completion
+
+# Initialize AgentOps
+agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Configure LiteLLM to use AgentOps
+litellm.success_callback = ["agentops"]
+
+# Make completion requests with LiteLLM
+response = completion(
+ model="gpt-3.5-turbo",
+ messages=[{"role": "user", "content": "Hello, how are you?"}]
+)
+
+print(response.choices[0].message.content)
+
+# All LiteLLM API calls are automatically tracked by AgentOps
+```
+</CodeGroup>
+
+## Using the LiteLLM Client
+
+<CodeGroup>
+```python Python
+import litellm
+from litellm import LiteLLM
+
+# Configure LiteLLM to use AgentOps
+litellm.success_callback = ["agentops"]
+
+# Create a LiteLLM client
+client = LiteLLM()
+
+# Make a completion request
+response = client.completion(
+ model="anthropic/claude-3-opus-20240229",
+ messages=[{"role": "user", "content": "What are the benefits of using LiteLLM?"}]
+)
+
+print(response.choices[0].message.content)
+
+# All client requests are automatically tracked by AgentOps
+```
+</CodeGroup>
+
+## Streaming Example
+
+AgentOps also tracks streaming requests with LiteLLM:
+
+<CodeGroup>
+```python Python
+import litellm
+from litellm import completion
+
+# Configure LiteLLM to use AgentOps
+litellm.success_callback = ["agentops"]
+
+# Make a streaming completion request
+response = completion(
+ model="gpt-4",
+ messages=[{"role": "user", "content": "Write a short poem about AI."}],
+ stream=True
+)
+
+# Process the streaming response
+for chunk in response:
+ if chunk.choices[0].delta.content:
+ print(chunk.choices[0].delta.content, end="", flush=True)
+
+# All streaming requests are automatically tracked by AgentOps
+```
+</CodeGroup>
+
+## Multi-Provider Example
+
+One of LiteLLM's key features is the ability to switch between providers easily:
+
+<CodeGroup>
+```python Python
+import litellm
+from litellm import completion
+
+# Configure LiteLLM to use AgentOps
+litellm.success_callback = ["agentops"]
+
+# OpenAI request
+openai_response = completion(
+ model="gpt-4",
+ messages=[{"role": "user", "content": "What are the advantages of GPT-4?"}]
+)
+
+print("OpenAI Response:", openai_response.choices[0].message.content)
+
+# Anthropic request using the same interface
+anthropic_response = completion(
+ model="anthropic/claude-3-opus-20240229",
+ messages=[{"role": "user", "content": "What are the advantages of Claude?"}]
+)
+
+print("Anthropic Response:", anthropic_response.choices[0].message.content)
+
+# All requests across different providers are automatically tracked by AgentOps
+```
+</CodeGroup>
+
+## Environment Variables
+
+<EnvTooltip />
+<CodeGroup>
+ ```python .env
+ AGENTOPS_API_KEY=<YOUR API KEY>
+ OPENAI_API_KEY=<YOUR OPENAI API KEY>
+ ANTHROPIC_API_KEY=<YOUR ANTHROPIC API KEY>
+ # Add any other provider API keys you need
+ ```
+</CodeGroup>
+
+Read more about environment variables in [Advanced Configuration](/v2/usage/advanced-configuration)
+
+## Additional Resources
+
+For more information on integrating AgentOps with LiteLLM, refer to the [LiteLLM documentation on AgentOps integration](https://docs.litellm.ai/docs/observability/agentops_integration).
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="css" src="/styles/styles.css"></script>
diff --git a/docs/v2/integrations/openai.mdx b/docs/v2/integrations/openai.mdx
new file mode 100644
index 00000000..f48793b1
--- /dev/null
+++ b/docs/v2/integrations/openai.mdx
@@ -0,0 +1,194 @@
+---
+title: OpenAI
+description: "Track and analyze your OpenAI API calls with AgentOps"
+---
+
+import CodeTooltip from '/snippets/add-code-tooltip.mdx'
+import EnvTooltip from '/snippets/add-env-tooltip.mdx'
+
+AgentOps seamlessly integrates with [OpenAI's Python SDK](https://github.com/openai/openai-python), allowing you to track and analyze all your OpenAI API calls automatically.
+
+## Installation
+
+<CodeTooltip />
+
+ <CodeGroup>
+ ```bash pip
+ pip install agentops openai
+ ```
+ ```bash poetry
+ poetry add agentops openai
+ ```
+ </CodeGroup>
+
+## Usage
+
+Initialize AgentOps at the beginning of your application to automatically track all OpenAI API calls:
+
+ <CodeGroup>
+```python Basic Usage
+ import agentops
+ from openai import OpenAI
+
+# Initialize AgentOps
+ agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Create OpenAI client
+client = OpenAI(api_key="<YOUR_OPENAI_API_KEY>")
+
+# Make API calls as usual - AgentOps will track them automatically
+response = client.chat.completions.create(
+ model="gpt-4",
+ messages=[
+ {"role": "system", "content": "You are a helpful assistant."},
+ {"role": "user", "content": "What is the capital of France?"}
+ ]
+)
+
+print(response.choices[0].message.content)
+ ```
+ </CodeGroup>
+
+## Advanced Examples
+
+### Streaming Completions
+
+AgentOps automatically tracks streaming completions:
+
+<CodeGroup>
+```python Streaming Example
+import agentops
+ from openai import OpenAI
+
+# Initialize AgentOps
+ agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Create OpenAI client
+ client = OpenAI()
+
+# Make a streaming API call
+stream = client.chat.completions.create(
+ model="gpt-4",
+ messages=[
+ {"role": "system", "content": "You are a helpful assistant."},
+ {"role": "user", "content": "Write a short poem about AI."}
+ ],
+ stream=True
+)
+
+# Process the streaming response
+for chunk in stream:
+ if chunk.choices[0].delta.content is not None:
+ print(chunk.choices[0].delta.content, end="")
+ ```
+</CodeGroup>
+
+### Function Calling
+
+AgentOps tracks function-calling conversations with OpenAI models:
+
+<CodeGroup>
+```python Function Calling
+import agentops
+import json
+ from openai import OpenAI
+
+# Initialize AgentOps
+ agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Create OpenAI client
+ client = OpenAI()
+
+# Define functions
+tools = [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA",
+ }
+ },
+ "required": ["location"],
+ },
+ },
+ }
+]
+
+# Function implementation
+def get_weather(location):
+ return json.dumps({"location": location, "temperature": "72", "unit": "fahrenheit", "forecast": ["sunny", "windy"]})
+
+# Make a function call API request
+response = client.chat.completions.create(
+ model="gpt-4",
+ messages=[
+ {"role": "system", "content": "You are a helpful weather assistant."},
+ {"role": "user", "content": "What's the weather like in Boston?"}
+ ],
+ tools=tools,
+ tool_choice="auto"
+)
+
+# Process response
+response_message = response.choices[0].message
+tool_calls = response_message.tool_calls
+
+if tool_calls:
+ # Handle tool calls
+ messages = [
+ {"role": "system", "content": "You are a helpful weather assistant."},
+ {"role": "user", "content": "What's the weather like in Boston?"},
+ response_message
+ ]
+
+ # Process each tool call
+ for tool_call in tool_calls:
+ function_name = tool_call.function.name
+ function_args = json.loads(tool_call.function.arguments)
+
+ if function_name == "get_weather":
+ function_response = get_weather(function_args.get("location"))
+
+ messages.append(
+ {
+ "tool_call_id": tool_call.id,
+ "role": "tool",
+ "name": function_name,
+ "content": function_response,
+ }
+ )
+
+ # Get a new response from the model
+ second_response = client.chat.completions.create(
+ model="gpt-4",
+ messages=messages,
+ )
+
+ print(second_response.choices[0].message.content)
+else:
+ print(response_message.content)
+```
+</CodeGroup>
+
+## Environment Variables
+
+<EnvTooltip />
+<CodeGroup>
+ ```python .env
+ AGENTOPS_API_KEY=<YOUR API KEY>
+ OPENAI_API_KEY=<YOUR OPENAI API KEY>
+ ```
+</CodeGroup>
+
+Read more about environment variables in [Advanced Configuration](/v2/usage/advanced-configuration)
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="css" src="/styles/styles.css"></script>
diff --git a/docs/v2/integrations/openai_assistants.mdx b/docs/v2/integrations/openai_assistants.mdx
new file mode 100644
index 00000000..9b21a3d4
--- /dev/null
+++ b/docs/v2/integrations/openai_assistants.mdx
@@ -0,0 +1,173 @@
+---
+title: OpenAI Assistants
+description: "Track and analyze your OpenAI Assistants API calls with AgentOps"
+---
+
+import CodeTooltip from '/snippets/add-code-tooltip.mdx'
+import EnvTooltip from '/snippets/add-env-tooltip.mdx'
+
+AgentOps provides seamless integration with [OpenAI's Assistants API](https://platform.openai.com/docs/assistants/overview), allowing you to track and analyze all your Assistants interactions automatically.
+
+## Installation
+
+<CodeTooltip />
+
+<CodeGroup>
+ ```bash pip
+ pip install agentops openai
+ ```
+ ```bash poetry
+ poetry add agentops openai
+ ```
+</CodeGroup>
+
+## Usage
+
+Initialize AgentOps at the beginning of your application to automatically track all Assistants API calls:
+
+<CodeGroup>
+```python Python
+import agentops
+from openai import OpenAI
+
+# Initialize AgentOps
+agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Create OpenAI client
+client = OpenAI()
+
+# Create an Assistant
+assistant = client.beta.assistants.create(
+ name="Math Tutor",
+ instructions="You are a personal math tutor. Write and run code to answer math questions.",
+ tools=[{"type": "code_interpreter"}],
+ model="gpt-4-turbo"
+)
+
+# Create a Thread
+thread = client.beta.threads.create()
+
+# Add a Message to the Thread
+message = client.beta.threads.messages.create(
+ thread_id=thread.id,
+ role="user",
+ content="I need to solve the equation 3x + 11 = 14. Can you help me?"
+)
+
+# Run the Assistant
+run = client.beta.threads.runs.create(
+ thread_id=thread.id,
+ assistant_id=assistant.id
+)
+
+# Wait for the Run to complete
+from time import sleep
+while run.status in ["queued", "in_progress"]:
+ sleep(1)
+ run = client.beta.threads.runs.retrieve(
+ thread_id=thread.id,
+ run_id=run.id
+ )
+
+# Get the Assistant's messages
+messages = client.beta.threads.messages.list(
+ thread_id=thread.id
+)
+
+# Print the last message from the assistant
+for message in messages.data:
+ if message.role == "assistant":
+ print(message.content[0].text.value)
+ break
+
+# All Assistants API calls are automatically tracked by AgentOps
+```
+</CodeGroup>
+
+## File Upload Example
+
+AgentOps tracks file uploads and interactions with the Assistants API:
+
+<CodeGroup>
+```python File Upload Example
+import agentops
+from openai import OpenAI
+import os
+
+# Initialize AgentOps
+agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Create OpenAI client
+client = OpenAI()
+
+# Upload a file
+file_path = "data.csv" # Replace with the path to your file
+with open(file_path, "rb") as file:
+ file_object = client.files.create(
+ file=file,
+ purpose="assistants"
+ )
+
+# Create an Assistant with the file
+assistant = client.beta.assistants.create(
+ name="Data Analyst",
+ instructions="You are a data analysis assistant. Analyze the provided CSV files and answer questions about the data.",
+ tools=[{"type": "code_interpreter"}],
+ model="gpt-4-turbo"
+)
+
+# Create a Thread with the file
+thread = client.beta.threads.create()
+
+# Add a File to the Thread
+message = client.beta.threads.messages.create(
+ thread_id=thread.id,
+ role="user",
+ content="Please analyze this CSV file and give me a summary of the data.",
+ file_ids=[file_object.id]
+)
+
+# Run the Assistant
+run = client.beta.threads.runs.create(
+ thread_id=thread.id,
+ assistant_id=assistant.id
+)
+
+# Wait for the Run to complete
+from time import sleep
+while run.status in ["queued", "in_progress"]:
+ sleep(2)
+ run = client.beta.threads.runs.retrieve(
+ thread_id=thread.id,
+ run_id=run.id
+ )
+
+# Get the Assistant's messages
+messages = client.beta.threads.messages.list(
+ thread_id=thread.id
+)
+
+# Print the last message from the assistant
+for message in messages.data:
+ if message.role == "assistant":
+ print(message.content[0].text.value)
+ break
+```
+</CodeGroup>
+
+## Environment Variables
+
+<EnvTooltip />
+<CodeGroup>
+ ```python .env
+ AGENTOPS_API_KEY=<YOUR API KEY>
+ OPENAI_API_KEY=<YOUR OPENAI API KEY>
+ ```
+</CodeGroup>
+
+Read more about environment variables in [Advanced Configuration](/v2/usage/advanced-configuration)
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="css" src="/styles/styles.css"></script>
\ No newline at end of file
diff --git a/docs/v2/introduction.mdx b/docs/v2/introduction.mdx
new file mode 100644
index 00000000..f0209711
--- /dev/null
+++ b/docs/v2/introduction.mdx
@@ -0,0 +1,87 @@
+---
+title: "Introduction"
+description: "AgentOps is the developer favorite platform for testing, debugging, and deploying AI agents and LLM apps."
+mode: "wide"
+---
+
+## Integrate with developer favorite agent frameworks
+
+<CardGroup cols={2}>
+ <Card title="OpenAI Agents SDK" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/openai/openai-logomark.png?raw=true" alt="OpenAI Agents SDK" />} iconType="image" href="/v2/integrations/agentssdk" />
+ <Card title="OpenAI" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/openai/openai-logomark.png?raw=true" alt="OpenAI" />} iconType="image" href="/v2/integrations/openai" />
+ <Card title="CrewAI" icon="ship" href="/v2/integrations/crewai" />
+ <Card title="Autogen" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/autogen/ag2.svg?raw=true" alt="Autogen"/>} iconType="image" href="/v2/integrations/autogen" />
+ <Card title="Anthropic" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/anthropic/anthropic_icon_slate.png?raw=true" alt="Anthropic" />} iconType="image" href="/v2/integrations/anthropic" />
+ <Card title="LangChain" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/langchain/langchain-logo.svg?raw=true" alt="LangChain" />} iconType="image" href="/v2/integrations/langchain" />
+ <Card title="LiteLLM" icon="train-tram" href="/v2/integrations/litellm" />
+</CardGroup>
+
+Observability and monitoring for your AI agents and LLM apps. And we do it all in just two lines of code...
+<CodeGroup>
+ ```python python
+ import agentops
+ agentops.init(<INSERT YOUR API KEY HERE>)
+ ```
+</CodeGroup>
+... that logs everything back to your AgentOps Dashboard.
+
+That's it! AgentOps will automatically instrument your code and start tracking sessions.
+
+Need more control? You can disable automatic session creation and manage sessions explicitly:
+
+<CodeGroup>
+ ```python python
+ import agentops
+ agentops.init(<INSERT YOUR API KEY HERE>, auto_start_session=False)
+
+ # Later, when you're ready to start a session:
+ agentops.start_session("my-workflow-session")
+
+ # Your code here
+ # ...
+
+ # Sessions automatically end when your program exits
+ ```
+</CodeGroup>
+
+## The AgentOps Dashboard
+
+<Check>[Give us a star](https://github.com/AgentOps-AI/agentops) to bookmark on GitHub, save for later 🖇️)</Check>
+
+With just two lines of code, you can free yourself from the chains of the terminal and, instead, visualize your agents' behavior
+in your AgentOps Dashboard. After setting up AgentOps, each execution of your program is recorded as a session and the above
+data is automatically recorded for you.
+
+The examples below were captured with two lines of code.
+
+### Session Drilldown
+Here you will find a list of all of your previously recorded sessions and useful data about each such as total execution time.
+You also get helpful debugging info such as any SDK versions you were on if you're building on a supported agent framework like Crew or AutoGen.
+LLM calls are presented as a familiar chat history view, and charts give you a breakdown of the types of events that were called and how long they took.
+
+<Frame type="glass" caption="Session Summary">
+ <img height="200" src="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/session-summary.gif?raw=true" />
+</Frame>
+
+Find any past sessions from your Session Drawer.
+<Frame type="glass" caption="Session Drawer">
+ <img height="250" src="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/session-drawer.gif?raw=true" />
+</Frame>
+
+Most powerful of all is the Session Waterfall. On the left, a time visualization of all your LLM calls, Action events, Tool calls, and Errors.
+On the right, specific details about the event you've selected on the waterfall. For instance the exact prompt and completion for a given LLM call.
+Most of which has been automatically recorded for you.
+
+<Frame type="glass" caption="Session Waterfall">
+ <img height="200" src="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/session-waterfall.gif?raw=true" />
+</Frame>
+
+
+### Session Overview
+View a meta-analysis of all of your sessions in a single view.
+<Frame type="glass" caption="Session Overview">
+ <img height="200" src="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/overview.png?raw=true" />
+</Frame>
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>
diff --git a/docs/v2/quickstart.mdx b/docs/v2/quickstart.mdx
new file mode 100644
index 00000000..ef912d4e
--- /dev/null
+++ b/docs/v2/quickstart.mdx
@@ -0,0 +1,168 @@
+---
+title: "Quickstart"
+description: "Start using AgentOps with just 2 lines of code"
+---
+import CodeTooltip from '/snippets/add-code-tooltip.mdx'
+import EnvTooltip from '/snippets/add-env-tooltip.mdx'
+
+<Steps>
+ <Step title="Install the AgentOps SDK">
+ <CodeGroup>
+ ```bash pip
+ pip install agentops
+ ```
+ ```bash poetry
+ poetry add agentops
+ ```
+ </CodeGroup>
+ </Step>
+ <Step title="Add 2 lines of code">
+ <CodeTooltip />
+ Get an AgentOps API key [here](https://app.agentops.ai/settings/projects)
+ <CodeGroup>
+ ```python python
+ import agentops
+ agentops.init(<INSERT YOUR API KEY HERE>)
+ ```
+ </CodeGroup>
+ That's it! These two lines automatically instrument your code and start tracking sessions. Sessions automatically end when your program exits.
+ <EnvTooltip />
+ </Step>
+ <Step title="Run your agent">
+ Execute your program and visit [app.agentops.ai/traces](https://app.agentops.ai/traces) to observe your Agent! 🕵️
+
+ <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="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/link-to-session.gif?raw=true" />
+ </Frame>
+ </Step>
+</Steps>
+<Check>[Give us a star](https://github.com/AgentOps-AI/agentops) if you liked AgentOps! (you may be our <span id="stars-text">3,000th</span> 😊)</Check>
+
+## More basic functionality
+
+<CardGroup cols={1}>
+
+<Card icon="code" title="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.
+ ```python python
+ # Instrument a function as an operation
+ from agentops.sdk.decorators import operation
+
+ @operation
+ def process_data(data):
+ # Your function logic here
+ result = data.upper()
+ return result
+```
+
+</Card>
+<Card icon="robot" title="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.
+ ```python python
+ # Create an agent class
+ from agentops.sdk.decorators import agent, operation
+
+ @agent
+ class MyAgent:
+ def __init__(self, name):
+ self.name = name
+
+ @operation
+ def perform_task(self, task):
+ # Agent task logic here
+ return f"Completed {task}"
+
+ def run_agent_task(task_name):
+ agent = MyAgent("research-agent")
+ result = agent.perform_task(task_name)
+ return result
+
+ result = run_agent_task("data analysis")
+ ```
+
+</Card>
+<Card icon="stop" title="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.
+ ```python python
+ # Create a session
+ from agentops.sdk.decorators import session
+
+ @session
+ def my_workflow():
+ # Your session code here
+ agent = MyAgent("research-agent")
+ result = agent.perform_task("data analysis")
+ return result
+
+ # Run the session
+ my_workflow()
+ ```
+</Card>
+</CardGroup>
+
+
+## Example Code
+
+Here is the complete code from the sections above
+
+```python python
+import agentops
+from agentops.sdk.decorators import agent, operation
+
+# Initialize AgentOps
+agentops.init(<INSERT YOUR API KEY HERE>)
+
+# Create an agent class
+@agent
+class MyAgent:
+ def __init__(self, name):
+ self.name = name
+
+ @operation
+ def perform_task(self, task):
+ # Agent task logic here
+ return f"Completed {task}"
+
+def run_agent_task(task_name):
+ agent = MyAgent("research-agent")
+ result = agent.perform_task(task_name)
+ return result
+
+result = run_agent_task("data analysis")
+```
+
+<Card
+ title="Simple Code Example"
+ icon="square-code"
+ href="https://github.com/AgentOps-AI/agentops-py/blob/main/examples/openai-gpt.ipynb"
+>
+ Jupyter Notebook with sample code that you can run!
+</Card>
+
+<Check>
+ 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!
+</Check>
+
+## Explore our more advanced functionality!
+
+<CardGroup cols={2}>
+ <Card
+ title="Examples and Video Guides"
+ icon="square-code"
+ href="/v2/examples"
+ >
+ Record all of your operations the way AgentOps intends.
+ </Card>
+ <Card title="Tracking Agents" icon="robot" href="/v2/usage/tracking-agents">
+ Associate operations with specific named agents.
+ </Card>
+</CardGroup>
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="css" src="/styles/styles.css"></script>
+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>
diff --git a/docs/v2/usage/advanced-configuration.mdx b/docs/v2/usage/advanced-configuration.mdx
new file mode 100644
index 00000000..4b3d9010
--- /dev/null
+++ b/docs/v2/usage/advanced-configuration.mdx
@@ -0,0 +1,36 @@
+---
+title: "Advanced Configuration"
+mode: "wide"
+---
+
+In AgentOps fashion, you only need to add one line of "code" to your `.env` file 😊
+
+<CodeGroup>
+ ```python .env
+ AGENTOPS_API_KEY=<YOUR API KEY>
+ ```
+</CodeGroup>
+
+<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
+# Write logs to file <TRUE, FALSE>. Defaults to TRUE
+AGENTOPS_LOGGING_TO_FILE=TRUE
+# Whether to opt out of recording environment data. <FALSE, TRUE>. Defaults to FALSE
+AGENTOPS_ENV_DATA_OPT_OUT=FALSE
+```
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>
diff --git a/docs/v2/usage/dashboard-info.mdx b/docs/v2/usage/dashboard-info.mdx
new file mode 100644
index 00000000..b45dbd8b
--- /dev/null
+++ b/docs/v2/usage/dashboard-info.mdx
@@ -0,0 +1,43 @@
+---
+title: "Dashboard"
+description: "Visualize your AgentOps analysis."
+mode: "wide"
+---
+
+## Insights Dashboard
+
+You need better insights to turn error-prone AI into stable workflows. Here's your new best friend.
+
+### Session Drilldown
+Here you will find a list of all of your previously recorded sessions and useful data about each such as total execution time.
+You also get helpful debugging info such as any SDK versions you were on if you're building on a supported agent framework like Crew or AutoGen.
+LLM calls are presented as a familiar chat history view, and charts give you a breakdown of the types of events that were called and how long they took.
+
+<Frame type="glass" caption="Session Summary">
+ <img height="200" src="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/session-summary.gif?raw=true" />
+</Frame>
+
+Find any past sessions from your Session Drawer.
+<Frame type="glass" caption="Session Drawer">
+ <img height="250" src="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/session-drawer.gif?raw=true" />
+</Frame>
+
+Most powerful of all is the Session Waterfall. On the left, a time visualization of all your LLM calls, Action events, Tool calls, and Errors.
+On the right, specific details about the event you've selected on the waterfall. For instance the exact prompt and completion for a given LLM call.
+Most of which has been automatically recorded for you.
+
+<Frame type="glass" caption="Session Waterfall">
+ <img height="200" src="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/session-waterfall.gif?raw=true" />
+</Frame>
+
+
+### Session Overview
+View a meta-analysis of all of your sessions in a single view.
+<Frame type="glass" caption="Session Overview">
+ <img height="200" src="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/overview.png?raw=true" />
+</Frame>
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="css" src="/styles/intro.css"></script>
\ No newline at end of file
diff --git a/docs/v2/usage/langchain-callback-handler.mdx b/docs/v2/usage/langchain-callback-handler.mdx
new file mode 100644
index 00000000..3b872c08
--- /dev/null
+++ b/docs/v2/usage/langchain-callback-handler.mdx
@@ -0,0 +1,62 @@
+---
+title: 'LangChain Callback Handler'
+description: 'How to use AgentOps with LangChain'
+---
+
+By default, AgentOps is compatible with agents using LangChain with our LLM Instrumentor as long as they're using
+supported models.
+
+As an alternative to instrumenting, the LangChain Callback Handler is available.
+
+## Constructor
+
+- `api_key` (Optional, string): API Key for AgentOps services. If not provided, the key will be read from the `AGENTOPS_API_KEY` environment variable.
+- `endpoint` (Optional, string): The endpoint for the AgentOps service. Defaults to 'https://api.agentops.ai'.
+- `max_wait_time` (Optional, int): The maximum time to wait in milliseconds before flushing the queue. Defaults to 30,000 (30 seconds).
+- `max_queue_size` (Optional, int): The maximum size of the event queue. Defaults to 100.
+- `tags` (Optional, List[string]): Tags for the sessions for grouping or sorting (e.g., ["GPT-4"]).
+
+## Usage
+
+### Install Dependencies
+<CodeGroup>
+```bash pip
+pip install agentops
+```
+```bash poetry
+poetry add agentops
+```
+</CodeGroup>
+
+### Implement Callback Handler
+
+Initialize the handler with its constructor and pass it into the callbacks array from LangChain.
+```python
+from agentops.integration.callbacks.langchain import LangchainCallbackHandler
+ChatOpenAI(callbacks=[LangchainCallbackHandler()])
+```
+
+Example:
+```python
+from langchain_core.prompts import ChatPromptTemplate
+from langchain_openai import ChatOpenAI
+from agentops import LangchainCallbackHandler
+
+prompt = ChatPromptTemplate.from_messages(["Tell me a joke about {animal}"])
+
+model = ChatOpenAI(callbacks=[LangchainCallbackHandler()])
+
+chain = prompt | model
+response = chain.invoke({"animal": "bears"})
+```
+
+## Why use the handler?
+
+If your project uses LangChain for Agents, Events and Tools, it may be easier to use the callback Handler for observability.
+
+If your project uses models with LangChain that are not yet supported by AgentOps, they can be supported by the Handler.
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>
diff --git a/docs/v2/usage/recording-operations.mdx b/docs/v2/usage/recording-operations.mdx
new file mode 100644
index 00000000..93ebed9e
--- /dev/null
+++ b/docs/v2/usage/recording-operations.mdx
@@ -0,0 +1,120 @@
+---
+title: "Recording Operations"
+description: "Track operations and LLM calls in your agent applications."
+---
+
+AgentOps makes it easy to track operations and interactions in your AI applications with minimal setup.
+
+## Basic Setup
+
+The simplest way to get started with AgentOps is to initialize it at the beginning of your application:
+
+```python
+import agentops
+
+# Initialize AgentOps with your API key
+agentops.init("your-api-key")
+```
+
+That's it! This single line of code will:
+- Automatically create a session for tracking your application run
+- Intercept and track all LLM calls to supported providers (OpenAI, Anthropic, etc.)
+- Record relevant metrics such as token counts, costs, and response times
+
+## Automatic Instrumentation
+
+AgentOps automatically instruments calls to popular LLM providers without requiring any additional code:
+
+```python
+import agentops
+from openai import OpenAI
+
+# Initialize AgentOps
+agentops.init("your-api-key")
+
+# Make LLM calls as usual - AgentOps will track them automatically
+client = OpenAI()
+response = client.chat.completions.create(
+ model="gpt-4o",
+ messages=[{"role": "user", "content": "Hello, world!"}]
+)
+```
+
+This works with many popular LLM providers including:
+- OpenAI
+- Anthropic
+- Google (Gemini)
+- Cohere
+- And more
+
+## Advanced: Using Decorators for Detailed Instrumentation
+
+For more detailed tracking, AgentOps provides decorators that allow you to explicitly instrument your code. This is optional but can provide more context in the dashboard.
+
+### `@operation` Decorator
+
+The `@operation` decorator helps track specific operations in your application:
+
+```python
+from agentops.sdk.decorators import operation
+
+@operation
+def process_data(data):
+ # Process the data
+ return result
+```
+
+### `@agent` Decorator
+
+If you use agent classes, you can track them with the `@agent` decorator:
+
+```python
+from agentops.sdk.decorators import agent, operation
+
+@agent
+class ResearchAgent:
+ @operation
+ def search(self, query):
+ # Implementation of search
+ return f"Results for: {query}"
+
+def research_workflow(topic):
+ agent = ResearchAgent()
+ results = agent.search(topic)
+ return results
+
+results = research_workflow("quantum computing")
+```
+
+### Advanced Session Management
+
+If you need more control over session lifecycle, you can disable automatic session creation:
+
+```python
+import agentops
+from agentops.sdk.decorators import session
+
+# Disable automatic session creation
+agentops.init("your-api-key", auto_start_session=False)
+
+@session
+def my_workflow():
+ # Your code here
+ pass
+
+# Run the workflow to create a session
+my_workflow()
+```
+
+## Best Practices
+
+1. **Keep it Simple**: For most applications, just initializing AgentOps with `agentops.init()` is sufficient.
+
+2. **Use Decorators Sparingly**: Only add decorators when you need more detailed tracking of specific operations.
+
+3. **Meaningful Operation Names**: When using decorators, choose descriptive names to make them easier to identify in the dashboard.
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>
diff --git a/docs/v2/usage/sdk-reference.mdx b/docs/v2/usage/sdk-reference.mdx
new file mode 100644
index 00000000..7bd33a45
--- /dev/null
+++ b/docs/v2/usage/sdk-reference.mdx
@@ -0,0 +1,163 @@
+---
+title: "SDK Reference"
+description: "All functions and classes exposed in the top layer of the SDK"
+---
+
+# SDK Reference
+
+This reference documents the functions and classes available with `import agentops`. The AgentOps SDK is designed for easy integration with your agent applications, offering both simple auto-instrumentation and more detailed manual tracing capabilities.
+
+## Core Functions
+
+These are the primary functions you'll use to initialize and configure AgentOps in your application.
+
+### `init()`
+
+Initializes the AgentOps SDK and automatically starts tracking your application.
+
+**Parameters**:
+
+- `api_key` (str, optional): API Key for AgentOps services. If not provided, the key will be read from the `AGENTOPS_API_KEY` environment variable.
+- `endpoint` (str, optional): The endpoint for the AgentOps service. If not provided, will be read from the `AGENTOPS_API_ENDPOINT` environment variable. Defaults to 'https://api.agentops.ai'.
+- `app_url` (str, optional): The dashboard URL for the AgentOps app. If not provided, will be read from the `AGENTOPS_APP_URL` environment variable. Defaults to 'https://app.agentops.ai'.
+- `max_wait_time` (int, optional): The maximum time to wait in milliseconds before flushing the queue. Defaults to 5,000 (5 seconds).
+- `max_queue_size` (int, optional): The maximum size of the event queue. Defaults to 512.
+- `default_tags` (List[str], optional): Default tags for the sessions that can be used for grouping or sorting later (e.g. ["GPT-4"]).
+- `tags` (List[str], optional): [Deprecated] Use `default_tags` instead.
+- `instrument_llm_calls` (bool, optional): Whether to instrument LLM calls automatically. Defaults to True.
+- `auto_start_session` (bool, optional): Whether to start a session automatically when the client is created. Defaults to True.
+- `auto_init` (bool, optional): Whether to automatically initialize the client on import. Defaults to True.
+- `skip_auto_end_session` (bool, optional): Don't automatically end session based on your framework's decision-making. Defaults to False.
+- `env_data_opt_out` (bool, optional): Whether to opt out of collecting environment data. Defaults to False.
+- `log_level` (str, int, optional): The log level to use for the client. Defaults to 'INFO'.
+- `fail_safe` (bool, optional): Whether to suppress errors and continue execution when possible. Defaults to False.
+- `exporter_endpoint` (str, optional): Endpoint for the exporter. If not provided, will be read from the `AGENTOPS_EXPORTER_ENDPOINT` environment variable. Defaults to 'https://otlp.agentops.ai/v1/traces'.
+- `export_flush_interval` (int, optional): Time interval in milliseconds between automatic exports of telemetry data. Defaults to 1000.
+
+**Returns**:
+
+- If `auto_start_session=True`, returns the created Session object. Otherwise, returns None.
+
+**Example**:
+
+```python
+import agentops
+
+# Basic initialization with automatic session creation
+agentops.init("your-api-key")
+```
+
+### `configure()`
+
+Updates client configuration after initialization. Supports the same parameters as `init()`.
+
+**Parameters**:
+
+- `api_key` (str, optional): API Key for AgentOps services.
+- `endpoint` (str, optional): The endpoint for the AgentOps service.
+- `app_url` (str, optional): The dashboard URL for the AgentOps app.
+- `max_wait_time` (int, optional): Maximum time to wait in milliseconds before flushing the queue.
+- `max_queue_size` (int, optional): Maximum size of the event queue.
+- `default_tags` (List[str], optional): Default tags for the sessions.
+- `instrument_llm_calls` (bool, optional): Whether to instrument LLM calls.
+- `auto_start_session` (bool, optional): Whether to start a session automatically.
+- `auto_init` (bool, optional): Whether to automatically initialize the client on import.
+- `skip_auto_end_session` (bool, optional): Don't automatically end session.
+- `env_data_opt_out` (bool, optional): Whether to opt out of collecting environment data.
+- `log_level` (str, int, optional): The log level to use for the client.
+- `fail_safe` (bool, optional): Whether to suppress errors and continue execution.
+- `exporter` (object, optional): Custom span exporter for OpenTelemetry trace data.
+- `processor` (object, optional): Custom span processor for OpenTelemetry trace data.
+- `exporter_endpoint` (str, optional): Endpoint for the exporter.
+- `export_flush_interval` (int, optional): Time interval in milliseconds between automatic exports of telemetry data.
+
+**Example**:
+
+```python
+import agentops
+
+# Initialize first
+agentops.init()
+
+# Later, update configuration
+agentops.configure(
+ max_wait_time=10000,
+ max_queue_size=200,
+ default_tags=["production", "gpt-4"]
+)
+```
+
+### `get_client()`
+
+Gets the singleton client instance. Most users won't need to use this function directly.
+
+**Returns**:
+
+- The AgentOps client instance.
+
+## Session Management
+
+These functions help you manage the lifecycle of tracking sessions.
+
+### `start_session()`
+
+Starts a new AgentOps session manually. This is useful when you've disabled automatic session creation or need multiple separate sessions.
+
+**Parameters**:
+
+- `tags` (Union[Dict[str, Any], List[str]], optional): Optional tags to attach to the session, useful for filtering in the dashboard. Can be a list of strings or a dict of key-value pairs.
+
+**Example**:
+
+```python
+import agentops
+
+# Initialize without auto-starting a session
+agentops.init("your-api-key", auto_start_session=False)
+
+# Later, manually start a session
+session = agentops.start_session(tags=["customer-query"])
+```
+## Decorators for Detailed Instrumentation
+
+For more granular control, AgentOps provides decorators that explicitly track different components of your application. These decorators are imported from `agentops.sdk.decorators`.
+
+```python
+import agentops
+from agentops.sdk.decorators import session, agent, operation, workflow, task
+
+# Initialize without automatic session creation
+agentops.init("your-api-key", auto_start_session=False)
+
+# Create and run a session using the decorator
+@session
+def my_workflow():
+ # Your workflow code here
+ pass
+
+# Run the workflow, which creates and manages the session
+my_workflow()
+```
+
+### Available Decorators
+
+- `@session`: Creates a session span, which serves as the root for all other spans
+- `@agent`: Creates an agent span for tracking agent operations
+- `@operation` / `@task`: Creates operation/task spans for tracking specific operations (these are aliases)
+- `@workflow`: Creates workflow spans for organizing related operations
+
+See [Decorators](/v2/concepts/decorators) for more detailed documentation on using these decorators.
+
+## Legacy Functions
+
+The following functions are maintained for backward compatibility with older versions of the SDK and integrations. New code should use the functions and decorators described above instead.
+
+- `record(event)`: Legacy function to record an event. Replaced by decorator-based tracing.
+- `track_agent()`: Legacy decorator for marking agents. Replaced by the `@agent` decorator.
+- `track_tool()`: Legacy decorator for marking tools. Replaced by the `@tool` decorator.
+- `ToolEvent()`, `ErrorEvent()`, `ActionEvent()`, `LLMEvent()`: Legacy event types. Replaced by automatic instrumentation and decorators.
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>
diff --git a/docs/v2/usage/tracking-agents.mdx b/docs/v2/usage/tracking-agents.mdx
new file mode 100644
index 00000000..7ee48f3f
--- /dev/null
+++ b/docs/v2/usage/tracking-agents.mdx
@@ -0,0 +1,91 @@
+---
+title: "Tracking Agents"
+description: "Associate operations with specific named agents"
+---
+
+AgentOps automatically tracks LLM interactions in your application. For more detailed tracking, especially in multi-agent systems, you can use additional features to associate operations with specific agents.
+
+## Basic Agent Tracking
+
+For simple applications, AgentOps will automatically track your LLM calls without additional configuration:
+
+```python
+import agentops
+from openai import OpenAI
+
+# Initialize AgentOps
+agentops.init("your-api-key")
+
+# Create a simple agent function
+def research_agent(query):
+ client = OpenAI()
+ response = client.chat.completions.create(
+ model="gpt-4o",
+ messages=[{"role": "user", "content": f"Research about: {query}"}]
+ )
+ return response.choices[0].message.content
+
+# Use your agent - all LLM calls will be tracked automatically
+result = research_agent("quantum computing")
+```
+
+## Advanced: Using the Agent Decorator
+
+For more structured tracking in complex applications, you can use the `@agent` decorator to explicitly identify different agents in your system:
+
+```python
+import agentops
+from agentops.sdk.decorators import agent, operation
+from openai import OpenAI
+
+# Initialize AgentOps
+agentops.init("your-api-key")
+
+# Create a decorated agent class
+@agent(name='ResearchAgent')
+class MyAgent:
+ def __init__(self):
+ self.client = OpenAI()
+
+ @operation
+ def search(self, query):
+ response = self.client.chat.completions.create(
+ model="gpt-4o",
+ messages=[{"role": "user", "content": f"Research about: {query}"}]
+ )
+ return response.choices[0].message.content
+
+# Create and use the agent within a function
+def research_workflow(topic):
+ agent = MyAgent()
+ result = agent.search(topic)
+ return result
+
+# Execute the function to properly register the agent span
+result = research_workflow("quantum computing")
+```
+
+If you don't specify a name, the agent will use the class name by default:
+
+```python
+@agent
+class ResearchAgent:
+ # This agent will have the name "ResearchAgent"
+ pass
+```
+
+## Dashboard Visualization
+
+All operations are automatically associated with the agent that originated them. Agents are given a name which is what you will see in the dashboard.
+
+<Frame type="glass" caption="Operations are labeled with the name of the Agent that originated them">
+ <img height="200" src="/images/agent-name.png" />
+</Frame>
+
+## Best Practices
+
+1. **Start Simple**: For most applications, just using `agentops.init()` is sufficient.
+
+2. **Use Decorators When Needed**: Add the `@agent` decorator when you need to clearly distinguish between multiple agents in your system.
+
+3. **Meaningful Names**: Choose descriptive names for your agents to make them easier to identify in the dashboard.
\ No newline at end of file
diff --git a/docs/v2/usage/tracking-llm-calls.mdx b/docs/v2/usage/tracking-llm-calls.mdx
new file mode 100644
index 00000000..c8a28b8c
--- /dev/null
+++ b/docs/v2/usage/tracking-llm-calls.mdx
@@ -0,0 +1,62 @@
+---
+title: "Tracking LLM Calls"
+description: "Tracking LLM Calls using the AgentOps SDK"
+---
+
+## Automatic LLM Call Tracking
+
+AgentOps makes tracking LLM calls incredibly simple. Just initialize the SDK with your API key, and AgentOps will automatically track all your LLM calls:
+
+```python
+import agentops
+from openai import OpenAI
+
+# Initialize AgentOps
+agentops.init("your-api-key")
+
+# Make LLM calls as usual - they'll be tracked automatically
+client = OpenAI()
+response = client.chat.completions.create(
+ model="gpt-4o",
+ messages=[{"role": "user", "content": "Hello, world!"}]
+)
+```
+
+### How it works
+
+When the AgentOps SDK detects a supported LLM provider module installed, it will automatically
+start tracking its usage. No further work is required from you! 😊
+
+### Supported LLM Providers
+
+AgentOps supports automatic tracking for many popular LLM providers, including:
+
+- OpenAI
+- Anthropic
+- Google (Gemini)
+- LiteLLM
+- And more
+
+### Not working?
+
+Try these steps:
+1. Make sure you have the latest version of the AgentOps SDK installed. We are constantly updating it to support new LLM libraries and releases.
+2. Make sure you are calling `agentops.init()` *after* importing the LLM module but *before* you are calling the LLM method.
+3. Make sure the `instrument_llm_calls` parameter of `agentops.init()` is set to `True` (default).
+
+Still not working? Please let us know! You can find us on [Discord](https://discord.gg/DR2abmETjZ),
+ [GitHub](https://github.com/AgentOps-AI/agentops),
+ or email us at [[email protected]](mailto:[email protected]).
+
+To get started, just follow the quick start guide.
+
+<CardGroup cols={2}>
+ <Card title="Quick Start" icon="code" href="/v2/quickstart">
+ Get started with AgentOps in under 5 minutes
+ </Card>
+</CardGroup>
+
+<script type="module" src="/scripts/github_stars.js"></script>
+<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
+<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
+<script type="module" src="/scripts/adjust_api_dynamically.js"></script>