RemoteAgent allows you to run agents that are hosted on a remote AgentOS instance. It provides the same interface as a local agent, making it easy to integrate remote agents into your applications or compose them into teams and workflows.
Installation
Basic Usage
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
base_url | str | Required | Base URL of the remote AgentOS instance (e.g., "http://localhost:7777") |
agent_id | str | Required | ID of the remote agent to execute |
timeout | float | 60.0 | Request timeout in seconds |
config_ttl | float | 300.0 | Time-to-live for cached configuration in seconds |
Properties
id
Returns the agent ID.
name
Returns the agent’s name from the remote configuration.
description
Returns the agent’s description from the remote configuration.
role
Returns the agent’s role from the remote configuration.
tools
Returns the agent’s tools as a list of dictionaries.
db
Returns a RemoteDb instance if the agent has a database configured.
knowledge
Returns a RemoteKnowledge instance if the agent has knowledge configured.
Methods
arun
Execute the remote agent asynchronously.
| Parameter | Type | Default | Description |
|---|---|---|---|
input | str | List | Dict | Message | BaseModel | Required | The input message for the agent |
stream | bool | False | Whether to stream the response |
user_id | Optional[str] | None | User ID for the run |
session_id | Optional[str] | None | Session ID for context persistence |
session_state | Optional[Dict] | None | Session state dictionary |
images | Optional[Sequence[Image]] | None | Images to include |
audio | Optional[Sequence[Audio]] | None | Audio to include |
videos | Optional[Sequence[Video]] | None | Videos to include |
files | Optional[Sequence[File]] | None | Files to include |
stream_events | Optional[bool] | None | Whether to stream events |
retries | Optional[int] | None | Number of retries |
knowledge_filters | Optional[Dict] | None | Filters for knowledge search |
add_history_to_context | Optional[bool] | None | Add history to context |
dependencies | Optional[Dict] | None | Dependencies dictionary |
metadata | Optional[Dict] | None | Metadata dictionary |
auth_token | Optional[str] | None | JWT token for authentication |
RunOutputwhenstream=FalseAsyncIterator[RunOutputEvent]whenstream=True
acontinue_run
Continue a paused agent run with tool results.
| Parameter | Type | Default | Description |
|---|---|---|---|
run_id | str | Required | ID of the run to continue |
updated_tools | List[ToolExecution] | Required | Tool execution results |
stream | bool | False | Whether to stream the response |
user_id | Optional[str] | None | User ID |
session_id | Optional[str] | None | Session ID |
auth_token | Optional[str] | None | JWT token for authentication |
RunOutputwhenstream=FalseAsyncIterator[RunOutputEvent]whenstream=True
cancel_run
Cancel a running agent execution.
| Parameter | Type | Default | Description |
|---|---|---|---|
run_id | str | Required | ID of the run to cancel |
auth_token | Optional[str] | None | JWT token for authentication |
bool - True if successfully cancelled
get_agent_config
Get the agent configuration from the remote server (always fetches fresh).
AgentResponse
refresh_config
Force refresh the cached agent configuration.
AgentResponse
Using in Teams
Remote agents can be used as members of local teams:Using in AgentOS Gateway
Remote agents can be registered in a local AgentOS to create a gateway:Error Handling
Authentication
For authenticated AgentOS instances, pass theauth_token parameter: