# xlang-ai/openagents architecture

> Architecture diagram of the GitHub repository xlang-ai/openagents, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xlang-ai/openagents
- Repository: https://github.com/xlang-ai/openagents

## Overview

OpenAgents is a chat-based platform for using three kinds of language agents: data analysis, third-party plugins, and autonomous web browsing. The main user workflow is to submit a chat request in the web UI, send it to the backend, and receive an agent response; agent capabilities branch into data operations, plugin calls, or web actions. The tree and README establish these product areas, but the sampled source does not show the full request-routing implementation, so uncertain internal connections are omitted.

Main entry points: [`backend/app.py`](https://github.com/xlang-ai/openagents/blob/main/backend/app.py) (HTTP Service), [`frontend/pages/api/home/home.tsx`](https://github.com/xlang-ai/openagents/blob/main/frontend/pages/api/home/home.tsx) (Chat UI), [`real_agents/adapters/executors/chat_executor.py`](https://github.com/xlang-ai/openagents/blob/main/real_agents/adapters/executors/chat_executor.py) (Chat Executor), [`backend/api/chat_webot.py`](https://github.com/xlang-ai/openagents/blob/main/backend/api/chat_webot.py) (Web Agent API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Chat Interface"]
  node_chat_ui["Chat UI<br/>[home.tsx]"]
  node_chat_components["Chat Components<br/>[Chat.tsx]"]
  node_browser_state["Browser State<br/>[storage.ts]"]
  node_api_client["API Client<br/>[api.ts]"]
end

subgraph group_server["Backend Service"]
  node_backend_app["HTTP Service<br/>[app.py]"]
  node_chat_api["Conversation API<br/>[conversation.py]"]
  node_data_api["Data API<br/>[data_tools.py]"]
  node_plugin_api["Plugin API<br/>[chat_plugin.py]"]
  node_web_api["Web Agent API<br/>[chat_webot.py]"]
  node_conversation_store[("Conversation Store")]
end

subgraph group_agents["Agent Capabilities"]
  node_data_agent["Data Agent<br/>[copilot.py]"]
  node_data_exec["Data Executors"]
  node_plugin_agent["Plugins Agent<br/>[plugin.py]"]
  node_plugin_exec["Plugin Executor<br/>[plugin_executor.py]"]
  node_plugin_catalog["Plugin Tools"]
  node_web_actions["Web Actions<br/>[webot_actions.py]"]
  node_web_instructions["Web Instructions"]
end

subgraph group_runtime["Agent Runtime"]
  node_agent_executor["Chat Executor<br/>[chat_executor.py]"]
  node_llm_adapter["Model Adapters<br/>[llm.py]"]
  node_streaming["Streaming Callbacks<br/>[agent_streaming.py]"]
end

node_user(("User"))
node_llm_provider(("LLM Provider"))
node_plugin_services(("Plugin Services"))
node_web_browser(("Web Browser"))

node_user -->|"submits request"| node_chat_ui
node_chat_ui -->|"renders chat"| node_chat_components
node_chat_ui -->|"reads and updates"| node_browser_state
node_chat_ui -->|"sends requests"| node_api_client
node_api_client -->|"HTTP request"| node_backend_app
node_backend_app -->|"serves routes"| node_chat_api
node_chat_api -->|"stores history"| node_conversation_store
node_backend_app -->|"serves routes"| node_data_api
node_backend_app -->|"serves routes"| node_plugin_api
node_backend_app -->|"serves routes"| node_web_api
node_data_api -->|"handles data tasks"| node_data_agent
node_data_agent -->|"runs analysis"| node_data_exec
node_plugin_api -->|"handles plugin tasks"| node_plugin_agent
node_plugin_agent -->|"dispatches tools"| node_plugin_exec
node_plugin_exec -->|"invokes plugin"| node_plugin_catalog
node_plugin_catalog -.->|"calls service"| node_plugin_services
node_web_api -->|"exposes actions"| node_web_actions
node_web_api -->|"exposes instructions"| node_web_instructions
node_web_actions -.->|"controls browser"| node_web_browser
node_data_agent -->|"uses executor"| node_agent_executor
node_plugin_agent -->|"uses executor"| node_agent_executor
node_agent_executor -->|"requests generation"| node_llm_adapter
node_llm_adapter -.->|"calls model"| node_llm_provider
node_agent_executor -->|"emits events"| node_streaming

click node_chat_ui "https://github.com/xlang-ai/openagents/blob/main/frontend/pages/api/home/home.tsx"
click node_chat_components "https://github.com/xlang-ai/openagents/blob/main/frontend/components/Chat/Chat.tsx"
click node_browser_state "https://github.com/xlang-ai/openagents/blob/main/frontend/types/storage.ts"
click node_api_client "https://github.com/xlang-ai/openagents/blob/main/frontend/utils/app/api.ts"
click node_backend_app "https://github.com/xlang-ai/openagents/blob/main/backend/app.py"
click node_chat_api "https://github.com/xlang-ai/openagents/blob/main/backend/api/conversation.py"
click node_data_api "https://github.com/xlang-ai/openagents/blob/main/backend/api/data_tools.py"
click node_plugin_api "https://github.com/xlang-ai/openagents/blob/main/backend/api/chat_plugin.py"
click node_web_api "https://github.com/xlang-ai/openagents/blob/main/backend/api/chat_webot.py"
click node_conversation_store "https://github.com/xlang-ai/openagents/blob/main/backend/utils/user_conversation_storage.py"
click node_data_agent "https://github.com/xlang-ai/openagents/blob/main/real_agents/data_agent/copilot.py"
click node_data_exec "https://github.com/xlang-ai/openagents/blob/main/real_agents/data_agent/executors/code_generation_executor.py"
click node_plugin_agent "https://github.com/xlang-ai/openagents/blob/main/real_agents/plugins_agent/plugin.py"
click node_plugin_exec "https://github.com/xlang-ai/openagents/blob/main/real_agents/plugins_agent/executors/plugin_executor.py"
click node_plugin_catalog "https://github.com/xlang-ai/openagents/tree/main/real_agents/plugins_agent/plugins"
click node_web_actions "https://github.com/xlang-ai/openagents/blob/main/backend/api/webot_actions.py"
click node_web_instructions "https://github.com/xlang-ai/openagents/blob/main/backend/api/webot_instructions.py"
click node_agent_executor "https://github.com/xlang-ai/openagents/blob/main/real_agents/adapters/executors/chat_executor.py"
click node_llm_adapter "https://github.com/xlang-ai/openagents/blob/main/real_agents/adapters/llm.py"
click node_streaming "https://github.com/xlang-ai/openagents/blob/main/real_agents/adapters/callbacks/agent_streaming.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_chat_ui,node_chat_components,node_browser_state,node_api_client,node_user,node_web_browser toneBlue
class node_backend_app,node_chat_api,node_data_api,node_plugin_api,node_web_api,node_conversation_store toneAmber
class node_data_agent,node_data_exec,node_plugin_agent,node_plugin_exec,node_plugin_catalog,node_web_actions,node_web_instructions toneMint
class node_agent_executor,node_llm_adapter,node_streaming toneRose
class node_llm_provider,node_plugin_services toneIndigo
```

## Components

### Chat Interface

- [Chat UI](https://github.com/xlang-ai/openagents/blob/main/frontend/pages/api/home/home.tsx): `frontend/pages/api/home/home.tsx`
- [Chat Components](https://github.com/xlang-ai/openagents/blob/main/frontend/components/Chat/Chat.tsx): `frontend/components/Chat/Chat.tsx`
- [Browser State](https://github.com/xlang-ai/openagents/blob/main/frontend/types/storage.ts): `frontend/types/storage.ts`
- [API Client](https://github.com/xlang-ai/openagents/blob/main/frontend/utils/app/api.ts): `frontend/utils/app/api.ts`

### Backend Service

- [HTTP Service](https://github.com/xlang-ai/openagents/blob/main/backend/app.py): `backend/app.py`
- [Conversation API](https://github.com/xlang-ai/openagents/blob/main/backend/api/conversation.py): `backend/api/conversation.py`
- [Data API](https://github.com/xlang-ai/openagents/blob/main/backend/api/data_tools.py): `backend/api/data_tools.py`
- [Plugin API](https://github.com/xlang-ai/openagents/blob/main/backend/api/chat_plugin.py): `backend/api/chat_plugin.py`
- [Web Agent API](https://github.com/xlang-ai/openagents/blob/main/backend/api/chat_webot.py): `backend/api/chat_webot.py`
- [Conversation Store](https://github.com/xlang-ai/openagents/blob/main/backend/utils/user_conversation_storage.py): `backend/utils/user_conversation_storage.py`

### Agent Capabilities

- [Data Agent](https://github.com/xlang-ai/openagents/blob/main/real_agents/data_agent/copilot.py): `real_agents/data_agent/copilot.py`
- [Data Executors](https://github.com/xlang-ai/openagents/blob/main/real_agents/data_agent/executors/code_generation_executor.py): `real_agents/data_agent/executors/code_generation_executor.py`
- [Plugins Agent](https://github.com/xlang-ai/openagents/blob/main/real_agents/plugins_agent/plugin.py): `real_agents/plugins_agent/plugin.py`
- [Plugin Executor](https://github.com/xlang-ai/openagents/blob/main/real_agents/plugins_agent/executors/plugin_executor.py): `real_agents/plugins_agent/executors/plugin_executor.py`
- [Plugin Tools](https://github.com/xlang-ai/openagents/tree/main/real_agents/plugins_agent/plugins): `real_agents/plugins_agent/plugins`
- [Web Actions](https://github.com/xlang-ai/openagents/blob/main/backend/api/webot_actions.py): `backend/api/webot_actions.py`
- [Web Instructions](https://github.com/xlang-ai/openagents/blob/main/backend/api/webot_instructions.py): `backend/api/webot_instructions.py`

### Agent Runtime

- [Chat Executor](https://github.com/xlang-ai/openagents/blob/main/real_agents/adapters/executors/chat_executor.py): `real_agents/adapters/executors/chat_executor.py`
- [Model Adapters](https://github.com/xlang-ai/openagents/blob/main/real_agents/adapters/llm.py): `real_agents/adapters/llm.py`
- [Streaming Callbacks](https://github.com/xlang-ai/openagents/blob/main/real_agents/adapters/callbacks/agent_streaming.py): `real_agents/adapters/callbacks/agent_streaming.py`

### Other components

- **User**
- **LLM Provider**
- **Plugin Services**
- **Web Browser**

## Connections

- User → Chat UI: submits request
- Chat UI → Chat Components: renders chat
- Chat UI → Browser State: reads and updates
- Chat UI → API Client: sends requests
- API Client → HTTP Service: HTTP request
- HTTP Service → Conversation API: serves routes
- Conversation API → Conversation Store: stores history
- HTTP Service → Data API: serves routes
- HTTP Service → Plugin API: serves routes
- HTTP Service → Web Agent API: serves routes
- Data API → Data Agent: handles data tasks
- Data Agent → Data Executors: runs analysis
- Plugin API → Plugins Agent: handles plugin tasks
- Plugins Agent → Plugin Executor: dispatches tools
- Plugin Executor → Plugin Tools: invokes plugin
- Plugin Tools → Plugin Services: calls service
- Web Agent API → Web Actions: exposes actions
- Web Agent API → Web Instructions: exposes instructions
- Web Actions → Web Browser: controls browser
- Data Agent → Chat Executor: uses executor
- Plugins Agent → Chat Executor: uses executor
- Chat Executor → Model Adapters: requests generation
- Model Adapters → LLM Provider: calls model
- Chat Executor → Streaming Callbacks: emits events
