Skip to main content
The AgentOSClient provides a convenient interface for interacting with a running AgentOS instance. It supports all AgentOS operations including running agents, teams, and workflows, managing sessions and memories, and searching knowledge bases.

Basic Usage

Parameters

Methods

Discovery & Configuration

aget_config

Get AgentOS configuration and metadata asynchronously.
Returns: ConfigResponse containing:
  • os_id: Unique identifier for the OS instance
  • name: Name of the OS instance
  • agents: List of registered agents
  • teams: List of registered teams
  • workflows: List of registered workflows
  • interfaces: List of available interfaces

get_config

Synchronous version of aget_config.

list_agents

List all agents configured in the AgentOS instance.
Returns: List[AgentSummaryResponse]

aget_agent

Get detailed configuration for a specific agent.
Parameters:
  • agent_id (str): ID of the agent to retrieve
Returns: AgentResponse

list_teams

List all teams configured in the AgentOS instance.
Returns: List[TeamSummaryResponse]

aget_team

Get detailed configuration for a specific team.
Parameters:
  • team_id (str): ID of the team to retrieve
Returns: TeamResponse

list_workflows

List all workflows configured in the AgentOS instance.
Returns: List[WorkflowSummaryResponse]

aget_workflow

Get detailed configuration for a specific workflow.
Parameters:
  • workflow_id (str): ID of the workflow to retrieve
Returns: WorkflowResponse

Running Agents

run_agent

Execute an agent run (non-streaming).
Parameters: Returns: RunOutput

run_agent_stream

Stream an agent run response.
Parameters: Same as run_agent Yields: RunOutputEvent (one of RunStartedEvent, RunContentEvent, RunToolCallEvent, RunCompletedEvent, etc.)

continue_agent_run

Continue a paused agent run with tool results.
Parameters: Returns: RunOutput

cancel_agent_run

Cancel an agent run.

Running Teams

run_team

Execute a team run (non-streaming).
Parameters: Returns: TeamRunOutput Paused runs return status="paused" and requirements on the TeamRunOutput.

run_team_stream

Stream a team run response.
Yields: TeamRunOutputEvent

cancel_team_run

Cancel a team run.

Running Workflows

run_workflow

Execute a workflow run (non-streaming).
Parameters: Returns: WorkflowRunOutput

run_workflow_stream

Stream a workflow run response.
Yields: WorkflowRunOutputEvent

cancel_workflow_run

Cancel a workflow run.

Memory Operations

create_memory

Create a new user memory.
Parameters: Returns: UserMemorySchema

list_memories

List user memories with filtering and pagination.
Parameters: Returns: PaginatedResponse[UserMemorySchema]

get_memory

Get a specific memory by ID.
Returns: UserMemorySchema

update_memory

Update an existing memory.
Returns: UserMemorySchema

delete_memory

Delete a specific memory.

Session Operations

create_session

Create a new session.
Parameters: Returns: AgentSessionDetailSchema, TeamSessionDetailSchema, or WorkflowSessionDetailSchema

get_sessions

List sessions with filtering and pagination.
Returns: PaginatedResponse[SessionSchema]

get_session

Get a specific session by ID.
Returns: AgentSessionDetailSchema, TeamSessionDetailSchema, or WorkflowSessionDetailSchema

get_session_runs

Get all runs for a specific session.
Returns: List[RunSchema | TeamRunSchema | WorkflowRunSchema]

rename_session

Rename a session.
Returns: Session detail schema

delete_session

Delete a specific session.

Knowledge Operations

upload_knowledge_content

Upload content to the knowledge base.
Parameters: Returns: ContentResponseSchema

search_knowledge

Search the knowledge base.
Parameters: Returns: PaginatedResponse[VectorSearchResult]

list_knowledge_content

List all content in the knowledge base.
Returns: PaginatedResponse[ContentResponseSchema]

get_knowledge_config

Get knowledge base configuration.
Returns: KnowledgeConfigResponse

Trace Operations

get_traces

List execution traces with filtering and pagination.
Returns: PaginatedResponse[TraceSummary]

get_trace

Get detailed trace information.
Returns: TraceDetail or TraceNode (if span_id provided)

Metrics Operations

get_metrics

Retrieve AgentOS metrics and analytics data.
Returns: MetricsResponse

refresh_metrics

Manually trigger recalculation of system metrics.
Returns: List[DayAggregatedMetrics]

Error Handling

The client raises RemoteServerUnavailableError when the remote server is unavailable:
For HTTP errors (4xx, 5xx), the client raises httpx.HTTPStatusError.

Authentication

To include authentication headers in requests, pass the headers parameter to any method: