# elophanto/elophanto architecture

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

- Interactive diagram: https://gitdiagram.com/elophanto/elophanto
- Repository: https://github.com/elophanto/elophanto

## Overview

EloPhanto is a persistent, self-evolving autonomous agent that acts through local tools and external services, with approvals guarding sensitive actions. The principal workflow is an operator starting a conversation, the agent reasoning and using tools, and the resulting work and identity persisting across sessions. Operators can also reach it through the web dashboard, gateway, and messaging channels. The graph preserves documented capabilities such as goals, background autonomy, companies, payments, browser control, and self-development. Several runtime internals were not sampled, so links beyond the shown CLI wiring rely on README statements.

Main entry points: [`core/agent.py`](https://github.com/elophanto/elophanto/blob/main/core/agent.py) (Agent runtime), [`core/gateway.py`](https://github.com/elophanto/elophanto/blob/main/core/gateway.py) (Gateway), [`cli/chat_cmd.py`](https://github.com/elophanto/elophanto/blob/main/cli/chat_cmd.py) (CLI chat), [`web/src/App.tsx`](https://github.com/elophanto/elophanto/blob/main/web/src/App.tsx) (Web dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["Operator interfaces"]
  node_cli["CLI chat<br/>[chat_cmd.py]"]
  node_web["Web dashboard<br/>[App.tsx]"]
  node_channels["Messaging channels"]
  node_gateway["Gateway<br/>[gateway.py]"]
end

subgraph group_runtime["Agent runtime"]
  node_agent["Agent runtime<br/>[agent.py]"]
  node_tooling["Tool runtime<br/>[base.py]"]
  node_approvals["Action approvals<br/>[approval_queue.py]"]
end

subgraph group_capabilities["Agent capabilities"]
  node_browser["Browser control<br/>[browser-agent.ts]"]
  node_goals["Goal checkpoints<br/>[goal_manager.py]"]
  node_mind["Autonomous mind<br/>[autonomous_mind.py]"]
  node_identity["Identity and outcomes<br/>[affect.py]"]
  node_selfdev["Self-development<br/>[pipeline.py]"]
  node_company["Company operations<br/>[company.py]"]
  node_payments["Payments<br/>[manager.py]"]
end

subgraph group_state["Persistent state"]
  node_database[("SQLite state<br/>[database.py]")]
  node_vault[("Credential vault<br/>[vault.py]")]
end

node_operator(("Operator"))

node_operator -->|"starts chat"| node_cli
node_cli -->|"initializes"| node_agent
node_operator -->|"uses dashboard"| node_web
node_operator -->|"messages through"| node_channels
node_cli -->|"starts gateway"| node_gateway
node_web -->|"connects through"| node_gateway
node_channels -->|"connects through"| node_gateway
node_gateway -->|"serves sessions"| node_agent
node_agent -->|"invokes tools"| node_tooling
node_tooling -->|"drives browser"| node_browser
node_agent -->|"requests approval"| node_approvals
node_agent -->|"tracks goals"| node_goals
node_agent -->|"runs background loop"| node_mind
node_agent -->|"reflects on outcomes"| node_identity
node_agent -->|"creates tools"| node_selfdev
node_agent -->|"operates companies"| node_company
node_agent -->|"moves funds"| node_payments
node_agent -->|"persists state"| node_database
node_identity -->|"stores identity"| node_database
node_agent -->|"brokers credentials"| node_vault

click node_cli "https://github.com/elophanto/elophanto/blob/main/cli/chat_cmd.py"
click node_web "https://github.com/elophanto/elophanto/blob/main/web/src/App.tsx"
click node_channels "https://github.com/elophanto/elophanto/tree/main/channels"
click node_gateway "https://github.com/elophanto/elophanto/blob/main/core/gateway.py"
click node_agent "https://github.com/elophanto/elophanto/blob/main/core/agent.py"
click node_tooling "https://github.com/elophanto/elophanto/blob/main/tools/base.py"
click node_approvals "https://github.com/elophanto/elophanto/blob/main/core/approval_queue.py"
click node_browser "https://github.com/elophanto/elophanto/blob/main/bridge/browser/src/browser-agent.ts"
click node_goals "https://github.com/elophanto/elophanto/blob/main/core/goal_manager.py"
click node_mind "https://github.com/elophanto/elophanto/blob/main/core/autonomous_mind.py"
click node_identity "https://github.com/elophanto/elophanto/blob/main/core/affect.py"
click node_selfdev "https://github.com/elophanto/elophanto/blob/main/tools/self_dev/pipeline.py"
click node_company "https://github.com/elophanto/elophanto/blob/main/core/company.py"
click node_payments "https://github.com/elophanto/elophanto/blob/main/core/payments/manager.py"
click node_database "https://github.com/elophanto/elophanto/blob/main/core/database.py"
click node_vault "https://github.com/elophanto/elophanto/blob/main/core/vault.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_web,node_channels,node_gateway toneBlue
class node_agent,node_tooling,node_approvals toneAmber
class node_browser,node_goals,node_mind,node_identity,node_selfdev,node_company,node_payments toneMint
class node_database,node_vault toneRose
class node_operator toneIndigo
```

## Components

### Operator interfaces

- [CLI chat](https://github.com/elophanto/elophanto/blob/main/cli/chat_cmd.py): `cli/chat_cmd.py`
- [Web dashboard](https://github.com/elophanto/elophanto/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Messaging channels](https://github.com/elophanto/elophanto/tree/main/channels): `channels`
- [Gateway](https://github.com/elophanto/elophanto/blob/main/core/gateway.py): `core/gateway.py`

### Agent runtime

- [Agent runtime](https://github.com/elophanto/elophanto/blob/main/core/agent.py): `core/agent.py`
- [Tool runtime](https://github.com/elophanto/elophanto/blob/main/tools/base.py): `tools/base.py`
- [Action approvals](https://github.com/elophanto/elophanto/blob/main/core/approval_queue.py): `core/approval_queue.py`

### Agent capabilities

- [Browser control](https://github.com/elophanto/elophanto/blob/main/bridge/browser/src/browser-agent.ts): `bridge/browser/src/browser-agent.ts`
- [Goal checkpoints](https://github.com/elophanto/elophanto/blob/main/core/goal_manager.py): `core/goal_manager.py`
- [Autonomous mind](https://github.com/elophanto/elophanto/blob/main/core/autonomous_mind.py): `core/autonomous_mind.py`
- [Identity and outcomes](https://github.com/elophanto/elophanto/blob/main/core/affect.py): `core/affect.py`
- [Self-development](https://github.com/elophanto/elophanto/blob/main/tools/self_dev/pipeline.py): `tools/self_dev/pipeline.py`
- [Company operations](https://github.com/elophanto/elophanto/blob/main/core/company.py): `core/company.py`
- [Payments](https://github.com/elophanto/elophanto/blob/main/core/payments/manager.py): `core/payments/manager.py`

### Persistent state

- [SQLite state](https://github.com/elophanto/elophanto/blob/main/core/database.py): `core/database.py`
- [Credential vault](https://github.com/elophanto/elophanto/blob/main/core/vault.py): `core/vault.py`

### Other components

- **Operator**

## Connections

- Operator → CLI chat: starts chat (evidence: `README.md`)
- CLI chat → Agent runtime: initializes (evidence: `cli/chat_cmd.py`)
- Operator → Web dashboard: uses dashboard (evidence: `README.md`)
- Operator → Messaging channels: messages through (evidence: `README.md`)
- CLI chat → Gateway: starts gateway (evidence: `cli/chat_cmd.py`)
- Web dashboard → Gateway: connects through (evidence: `README.md`)
- Messaging channels → Gateway: connects through (evidence: `README.md`)
- Gateway → Agent runtime: serves sessions (evidence: `README.md`)
- Agent runtime → Tool runtime: invokes tools (evidence: `README.md`)
- Tool runtime → Browser control: drives browser (evidence: `README.md`)
- Agent runtime → Action approvals: requests approval (evidence: `README.md`)
- Agent runtime → Goal checkpoints: tracks goals (evidence: `README.md`)
- Agent runtime → Autonomous mind: runs background loop (evidence: `README.md`)
- Agent runtime → Identity and outcomes: reflects on outcomes (evidence: `README.md`)
- Agent runtime → Self-development: creates tools (evidence: `README.md`)
- Agent runtime → Company operations: operates companies (evidence: `README.md`)
- Agent runtime → Payments: moves funds (evidence: `README.md`)
- Agent runtime → SQLite state: persists state (evidence: `README.md`)
- Identity and outcomes → SQLite state: stores identity (evidence: `README.md`)
- Agent runtime → Credential vault: brokers credentials (evidence: `README.md`)
