# camel-ai/owl architecture

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

- Interactive diagram: https://gitdiagram.com/camel-ai/owl
- Repository: https://github.com/camel-ai/owl

## Overview

#### Purpose and Entry Points
OWL is a Python framework for real-world task automation through collaborating LLM agents, built on the external CAMEL-AI framework. Primary CLI examples construct and run an agent “society”; the local Gradio UI exposes the same workflow in English, Chinese, and Japanese.
- `examples/run.py`
- `owl/webapp.py`
- `owl/webapp_zh.py`

#### Workforce Orchestration
The core execution model is enhanced role-playing: agents exchange messages, select tools, process results, and converge on an answer plus chat history/token usage. The implementation is thin in this repository and delegates foundational agent, model, and toolkit behavior to the installed CAMEL dependency.
- `owl/utils/enhanced_role_playing.py`
- `examples/run.py`
- `pyproject.toml`

#### Task Input and Document Boundary
User tasks may include local file paths. Document utilities provide the repository-local adaptation layer for extracting or preparing document content, while tool selection and model-driven invocation remain CAMEL responsibilities.
- `owl/utils/document_toolkit.py`
- `owl/utils/common.py`
- `examples/run.py`

#### Tool-Enabled Execution
Agents operate through configured toolkits: search, browser automation, multimodal analysis, document parsing, code execution, filesystem writing, and MCP services. Tool calls cross the main trust/runtime boundary: local subprocesses and browsers, remote search/content providers, and optional MCP servers.
- `examples/run.py`
- `community_usecase/qwen3_mcp/mcp_sse_config.json`
- `community_usecase/Puppeteer MCP/mcp_servers_config.json`

#### Model and External-Service Integration
The framework requires tool-calling LLMs and uses environment-provided credentials. It supports OpenAI and other CAMEL-supported model backends; task capabilities can additionally depend on OpenAI audio services, search engines, Playwright/browser channels, Node.js MCP services, and remote SSE MCP endpoints.
- `owl/.env_template`
- `examples/run_claude.py`
- `examples/run_gemini.py`

#### Web Interaction Surface
The web applications are local Gradio front ends for model selection, environment configuration, chat submission, and task history. They are alternate entry points rather than a separate server-side product; configured model APIs are the principal external data egress.
- `owl/webapp.py`
- `owl/webapp_jp.py`
- `owl/webapp_backup.py`

#### Deployment and Runtime
Supported runtime is Python 3.10–3.12, installed via package metadata or requirements. Docker Compose packages the environment, including browser-oriented execution requirements; Playwright may need OS dependencies and virtual display support.
- `pyproject.toml`
- `requirements.txt`
- `.container/docker-compose.yml`
- `.container/Dockerfile`

#### Extensions and Reference Implementations
`community_usecase/` contains independent vertical applications and MCP demonstrations, not core OWL runtime modules. They illustrate how the orchestration/tool boundary is reused for domain workflows such as investment analysis, interview preparation, and document/resume processing.
- `community_usecase/a_share_investment_agent_camel/src/main.py`
- `community_usecase/stock-analysis/run.py`
- `community_usecase/OWL Interview Preparation Assistant/main.py`

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry Points"]
  node_cli["CLI society runner<br/>Python entry point<br/>[run.py]"]
  node_webapp["Gradio web UI<br/>local UI<br/>[webapp.py]"]
  node_webapp_zh["Chinese web UI<br/>local UI<br/>[webapp_zh.py]"]
  node_webapp_jp["Japanese web UI<br/>local UI<br/>[webapp_jp.py]"]
end

subgraph group_core["Core Runtime"]
  node_role_playing["Enhanced role playing<br/>orchestrator"]
  node_document_tools["Document utilities<br/>input adapter"]
  node_common["Common utilities<br/>support module<br/>[common.py]"]
  node_camel{{"CAMEL-AI<br/>external framework<br/>[pyproject.toml]"}}
end

subgraph group_tools["Tool Boundary"]
  node_toolkits["Configured toolkits<br/>execution boundary<br/>[run.py]"]
  node_local_runtime{{"Local execution<br/>subprocess/browser runtime"}}
  node_remote_services{{"Remote content services<br/>external providers"}}
  node_mcp["MCP services<br/>tool servers"]
  node_mcp_puppeteer["Puppeteer MCP config<br/>MCP configuration"]
end

subgraph group_platform["Platform &amp; Extensions"]
  node_credentials["Environment credentials<br/>runtime configuration<br/>[.env_template]"]
  node_model_backends{{"LLM backends<br/>external model APIs<br/>[run_claude.py]"}}
  node_gemini_example["Gemini runner<br/>provider example<br/>[run_gemini.py]"]
  node_container["Container runtime<br/>deployment<br/>[docker-compose.yml]"]
  node_dockerfile["Container image<br/>build definition<br/>[Dockerfile]"]
  node_community["Community use cases<br/>independent applications<br/>[main.py]"]
end

node_cli -->|"starts"| node_role_playing
node_webapp -->|"submits tasks"| node_role_playing
node_webapp_zh -->|"submits tasks"| node_role_playing
node_webapp_jp -->|"submits tasks"| node_role_playing
node_cli -->|"accepts file tasks"| node_document_tools
node_document_tools -->|"uses"| node_common
node_role_playing -->|"delegates agent runtime"| node_camel
node_role_playing -->|"executes tool calls"| node_toolkits
node_toolkits -->|"runs locally"| node_local_runtime
node_toolkits -->|"calls"| node_remote_services
node_toolkits -.->|"connects optionally"| node_mcp
node_mcp_puppeteer -.->|"configures"| node_mcp
node_camel -->|"selects"| node_model_backends
node_credentials -.->|"authenticates"| node_model_backends
node_gemini_example -.->|"demonstrates"| node_model_backends
node_container -->|"builds from"| node_dockerfile
node_container -.->|"runs"| node_cli
node_community -.->|"reuses orchestration pattern"| node_role_playing

click node_cli "https://github.com/camel-ai/owl/blob/main/examples/run.py"
click node_webapp "https://github.com/camel-ai/owl/blob/main/owl/webapp.py"
click node_webapp_zh "https://github.com/camel-ai/owl/blob/main/owl/webapp_zh.py"
click node_webapp_jp "https://github.com/camel-ai/owl/blob/main/owl/webapp_jp.py"
click node_role_playing "https://github.com/camel-ai/owl/blob/main/owl/utils/enhanced_role_playing.py"
click node_document_tools "https://github.com/camel-ai/owl/blob/main/owl/utils/document_toolkit.py"
click node_common "https://github.com/camel-ai/owl/blob/main/owl/utils/common.py"
click node_camel "https://github.com/camel-ai/owl/blob/main/pyproject.toml"
click node_toolkits "https://github.com/camel-ai/owl/blob/main/examples/run.py"
click node_mcp "https://github.com/camel-ai/owl/blob/main/community_usecase/qwen3_mcp/mcp_sse_config.json"
click node_mcp_puppeteer "https://github.com/camel-ai/owl/blob/main/community_usecase/Puppeteer%20MCP/mcp_servers_config.json"
click node_credentials "https://github.com/camel-ai/owl/blob/main/owl/.env_template"
click node_model_backends "https://github.com/camel-ai/owl/blob/main/examples/run_claude.py"
click node_gemini_example "https://github.com/camel-ai/owl/blob/main/examples/run_gemini.py"
click node_container "https://github.com/camel-ai/owl/blob/main/.container/docker-compose.yml"
click node_dockerfile "https://github.com/camel-ai/owl/blob/main/.container/Dockerfile"
click node_community "https://github.com/camel-ai/owl/blob/main/community_usecase/a_share_investment_agent_camel/src/main.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_cli,node_webapp,node_webapp_zh,node_webapp_jp toneBlue
class node_role_playing,node_document_tools,node_common,node_camel toneAmber
class node_toolkits,node_local_runtime,node_remote_services,node_mcp,node_mcp_puppeteer toneMint
class node_credentials,node_model_backends,node_gemini_example,node_container,node_dockerfile,node_community toneRose
```

## Components

### Entry Points

- [CLI society runner](https://github.com/camel-ai/owl/blob/main/examples/run.py): Python entry point · Builds and runs an agent society. · `examples/run.py`
- [Gradio web UI](https://github.com/camel-ai/owl/blob/main/owl/webapp.py): local UI · Provides model configuration, chat submission, and history. · `owl/webapp.py`
- [Chinese web UI](https://github.com/camel-ai/owl/blob/main/owl/webapp_zh.py): local UI · `owl/webapp_zh.py`
- [Japanese web UI](https://github.com/camel-ai/owl/blob/main/owl/webapp_jp.py): local UI · `owl/webapp_jp.py`

### Core Runtime

- [Enhanced role playing](https://github.com/camel-ai/owl/blob/main/owl/utils/enhanced_role_playing.py): orchestrator · Coordinates agent messages, tool results, answer, history, and token usage. · `owl/utils/enhanced_role_playing.py`
- [Document utilities](https://github.com/camel-ai/owl/blob/main/owl/utils/document_toolkit.py): input adapter · Prepares local task documents for the agent workflow. · `owl/utils/document_toolkit.py`
- [Common utilities](https://github.com/camel-ai/owl/blob/main/owl/utils/common.py): support module · `owl/utils/common.py`
- [CAMEL-AI](https://github.com/camel-ai/owl/blob/main/pyproject.toml): external framework · Supplies foundational agents, models, tool selection, and toolkit behavior. · `pyproject.toml`

### Tool Boundary

- [Configured toolkits](https://github.com/camel-ai/owl/blob/main/examples/run.py): execution boundary · Search, browser, multimodal, parsing, code, and filesystem capabilities. · `examples/run.py`
- **Local execution**: subprocess/browser runtime · Code execution, filesystem writes, and browser automation run locally.
- **Remote content services**: external providers · Search, browser content, and model-provider APIs receive configured requests.
- [MCP services](https://github.com/camel-ai/owl/blob/main/community_usecase/qwen3_mcp/mcp_sse_config.json): tool servers · Optional Node.js and remote SSE tool integrations. · `community_usecase/qwen3_mcp/mcp_sse_config.json`
- [Puppeteer MCP config](https://github.com/camel-ai/owl/blob/main/community_usecase/Puppeteer%20MCP/mcp_servers_config.json): MCP configuration · `community_usecase/Puppeteer MCP/mcp_servers_config.json`

### Platform & Extensions

- [Environment credentials](https://github.com/camel-ai/owl/blob/main/owl/.env_template): runtime configuration · Provides API keys and service settings. · `owl/.env_template`
- [LLM backends](https://github.com/camel-ai/owl/blob/main/examples/run_claude.py): external model APIs · Tool-calling models are selected through CAMEL-supported providers. · `examples/run_claude.py`
- [Gemini runner](https://github.com/camel-ai/owl/blob/main/examples/run_gemini.py): provider example · `examples/run_gemini.py`
- [Container runtime](https://github.com/camel-ai/owl/blob/main/.container/docker-compose.yml): deployment · Packages Python and browser-oriented execution dependencies. · `.container/docker-compose.yml`
- [Container image](https://github.com/camel-ai/owl/blob/main/.container/Dockerfile): build definition · `.container/Dockerfile`
- [Community use cases](https://github.com/camel-ai/owl/blob/main/community_usecase/a_share_investment_agent_camel/src/main.py): independent applications · Reference vertical workflows outside the core OWL runtime. · `community_usecase/a_share_investment_agent_camel/src/main.py`

## Connections

- CLI society runner → Enhanced role playing: starts
- Gradio web UI → Enhanced role playing: submits tasks
- Chinese web UI → Enhanced role playing: submits tasks
- Japanese web UI → Enhanced role playing: submits tasks
- CLI society runner → Document utilities: accepts file tasks
- Document utilities → Common utilities: uses
- Enhanced role playing → CAMEL-AI: delegates agent runtime
- Enhanced role playing → Configured toolkits: executes tool calls
- Configured toolkits → Local execution: runs locally
- Configured toolkits → Remote content services: calls
- Configured toolkits → MCP services: connects optionally
- Puppeteer MCP config → MCP services: configures
- CAMEL-AI → LLM backends: selects
- Environment credentials → LLM backends: authenticates
- Gemini runner → LLM backends: demonstrates
- Container runtime → Container image: builds from
- Container runtime → CLI society runner: runs
- Community use cases → Enhanced role playing: reuses orchestration pattern
