diff --git a/docs/mint.json b/docs/mint.json index c6639f702..b220e09c7 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -129,8 +129,7 @@ "v1/usage/advanced-configuration", "v1/usage/tracking-llm-calls", "v1/usage/tracking-agents", - "v1/usage/recording-operations", - "v1/usage/multiple-sessions" + "v1/usage/recording-operations" ], "version": "v1" }, diff --git a/docs/v1/concepts/core-concepts.mdx b/docs/v1/concepts/core-concepts.mdx index cd1819658..159c59067 100644 --- a/docs/v1/concepts/core-concepts.mdx +++ b/docs/v1/concepts/core-concepts.mdx @@ -39,52 +39,49 @@ AgentOps can exist in one of two states: - • Only one session exists at a time. All agent usage is synchronous. - • Use cases: Scripting, development, local machine use (browser extensions, web client, etc) - + - • REST server - • Asynchronous agents + - • Multiple concurrent workflows -By default, AgentOps operates in single-session mode. All of the [base SDK functions](/v1/usage/sdk-reference) work as expected. +AgentOps supports both single and multiple concurrent traces (sessions) seamlessly. You can use either the modern trace-based API or the legacy session functions for backwards compatibility. -As soon as you create a second session, AgentOps enters **Multi-Session Mode**. As long as more than one session is active, the [base SDK functions](/v1/usage/sdk-reference) will no longer work. - -If multiple sessions exist, you are expected to call the function on the relevant session. Ex +The modern approach uses `start_trace()` and `end_trace()` with automatic instrumentation, while legacy session functions remain available. Multiple concurrent traces work without any special mode switching or restrictions. -```python single session +```python single trace import agentops -from agentops.sdk.decorators import session +agentops.init() +trace_context = agentops.start_trace("my_workflow") +# Your agent logic here +agentops.end_trace(trace_context, "Success") +``` -@session -def my_session(): - # Your session code here - pass +```python concurrent traces +import agentops +agentops.init(auto_start_session=False) +trace_1 = agentops.start_trace("workflow_1") +trace_2 = agentops.start_trace("workflow_2") -# Run the session -my_session() +# Work with both traces concurrently +agentops.end_trace(trace_1, "Success") +agentops.end_trace(trace_2, "Success") ``` -```python multi-session +```python using decorators import agentops -from agentops.sdk.decorators import session - -@session -def session_1(): - # Session 1 code - pass -@session -def session_2(): - # Session 2 code +@agentops.trace +def my_workflow(): + # Your agent logic here pass -# Run both sessions -session_1() -session_2() +my_workflow() ``` -For more documentation on using multiple concurrent sessions, please see [Multiple Sessions](v1/usage/multiple-sessions) and [FastAPI Example](/v1/examples/fastapi). +For more documentation on using multiple concurrent traces, please see [Concurrent Traces](/v1/usage/multiple-sessions) and [FastAPI Example](/v1/examples/fastapi). ### LLMs, Tools, and Operations (Spans) @@ -146,4 +143,4 @@ Optionally, agents may also have: *Details coming soon.* - \ No newline at end of file + diff --git a/docs/v1/examples/examples.mdx b/docs/v1/examples/examples.mdx index 7466084b9..3a48524da 100644 --- a/docs/v1/examples/examples.mdx +++ b/docs/v1/examples/examples.mdx @@ -17,8 +17,8 @@ mode: "wide" Jupyter Notebook with a simple multi-agent design - - Manage multiple sessions at the same time + + Manage multiple concurrent traces and sessions } iconType="image" href="/v1/integrations/openai" href="/v1/examples/openai_assistants"> @@ -197,4 +197,4 @@ mode: "wide"