# arti2210/corvus-x architecture

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

- Interactive diagram: https://gitdiagram.com/arti2210/corvus-x
- Repository: https://github.com/arti2210/corvus-x
- Video tour (about a minute): https://gitdiagram.com/arti2210/corvus-x/video

## Overview

Corvus X is a personal AI assistant reached primarily through Telegram, with a React operations interface. The main conversational path runs from Telegram into the channel adapter and application pipeline, which composes a response using LLM, persona/style, and contact-memory services before sending it back through the channel. Separate product branches provide web/API management, voice and calls, and ReAct tools. The README documents these capabilities; several internal connections below are supported by the source index rather than inspected implementation excerpts.

Main entry points: [`src/core/application/pipeline_runner.py`](https://github.com/arti2210/corvus-x/blob/main/src/core/application/pipeline_runner.py) (Conversation pipeline), [`src/adapters/channels/telegram_channel.py`](https://github.com/arti2210/corvus-x/blob/main/src/adapters/channels/telegram_channel.py) (Telegram channel), [`src/core/application/knowledge_base.py`](https://github.com/arti2210/corvus-x/blob/main/src/core/application/knowledge_base.py) (Knowledge base), [`src/main.py`](https://github.com/arti2210/corvus-x/blob/main/src/main.py) (Runtime startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Channels and UI"]
  node_channel["Telegram channel"]
  node_frontend["Management SPA<br/>[App.tsx]"]
end

subgraph group_app["Assistant application"]
  node_pipeline["Conversation pipeline<br/>[pipeline_runner.py]"]
  node_dialog["Dialog manager<br/>[dialog_manager.py]"]
  node_llm["LLM orchestration"]
  node_persona["Persona and prompts<br/>[persona_manager.py]"]
  node_style["Style imprinting<br/>[style_imprinter.py]"]
  node_agent["ReAct agent<br/>[agent_loop.py]"]
end

subgraph group_adapters["Runtime adapters"]
  node_api["REST API<br/>[app.py]"]
  node_tools["Agent tools"]
  node_voice["Voice adapters"]
  node_calls["Live call engine<br/>[engine.py]"]
end

subgraph group_memory["Memory and persistence"]
  node_contact_memory["Contact memory"]
  node_knowledge["Knowledge base<br/>[knowledge_base.py]"]
  node_consolidation["Memory consolidation<br/>[worker.py]"]
  node_repositories[("Persistence adapters")]
end

subgraph group_ops["Operations"]
  node_main["Runtime startup<br/>[main.py]"]
  node_container["Dependency assembly<br/>[di_container.py]"]
  node_background["Background loops"]
  node_orchestrator["Multi-stage orchestrator<br/>[main.py]"]
end

node_telegram_user(("Messenger user"))
node_telegram(("Telegram"))

node_telegram_user -->|"sends messages"| node_telegram
node_telegram -->|"receives via"| node_channel
node_channel -.->|"routes messages"| node_dialog
node_dialog -.->|"runs conversation"| node_pipeline
node_pipeline -->|"requests generation"| node_llm
node_pipeline -->|"uses persona"| node_persona
node_pipeline -->|"uses style"| node_style
node_pipeline -->|"persists memory"| node_contact_memory
node_pipeline -->|"uses memory"| node_knowledge
node_agent -->|"dispatches tools"| node_tools
node_pipeline -.->|"supports agent loop"| node_agent
node_contact_memory -.->|"stores profiles"| node_repositories
node_knowledge -->|"reads knowledge"| node_repositories
node_consolidation -.->|"consolidates memory"| node_knowledge
node_channel -->|"provides call client"| node_calls
node_calls -.->|"uses voice services"| node_voice
node_frontend -.->|"calls management API"| node_api
node_main -->|"builds services"| node_container
node_main -->|"wires loops"| node_background
node_container -->|"creates app"| node_api
node_orchestrator -.->|"coordinates stages"| node_telegram

click node_channel "https://github.com/arti2210/corvus-x/blob/main/src/adapters/channels/telegram_channel.py"
click node_frontend "https://github.com/arti2210/corvus-x/blob/main/frontend/src/App.tsx"
click node_api "https://github.com/arti2210/corvus-x/blob/main/src/adapters/api/app.py"
click node_pipeline "https://github.com/arti2210/corvus-x/blob/main/src/core/application/pipeline_runner.py"
click node_dialog "https://github.com/arti2210/corvus-x/blob/main/src/core/application/dialog_manager.py"
click node_llm "https://github.com/arti2210/corvus-x/blob/main/src/core/application/llm_orchestrator.py"
click node_persona "https://github.com/arti2210/corvus-x/blob/main/src/core/application/persona_manager.py"
click node_style "https://github.com/arti2210/corvus-x/blob/main/src/core/application/style_imprinter.py"
click node_agent "https://github.com/arti2210/corvus-x/blob/main/src/core/application/agent_loop.py"
click node_tools "https://github.com/arti2210/corvus-x/tree/main/src/tools"
click node_contact_memory "https://github.com/arti2210/corvus-x/blob/main/src/core/application/contact_memory_manager.py"
click node_knowledge "https://github.com/arti2210/corvus-x/blob/main/src/core/application/knowledge_base.py"
click node_consolidation "https://github.com/arti2210/corvus-x/blob/main/src/core/application/consolidation/worker.py"
click node_repositories "https://github.com/arti2210/corvus-x/tree/main/src/adapters/persistence"
click node_voice "https://github.com/arti2210/corvus-x/tree/main/src/adapters/voice"
click node_calls "https://github.com/arti2210/corvus-x/blob/main/src/adapters/calls/engine.py"
click node_main "https://github.com/arti2210/corvus-x/blob/main/src/main.py"
click node_container "https://github.com/arti2210/corvus-x/blob/main/src/di_container.py"
click node_background "https://github.com/arti2210/corvus-x/blob/main/src/core/application/background_loops.py"
click node_orchestrator "https://github.com/arti2210/corvus-x/blob/main/orchestrator/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_channel,node_frontend,node_telegram_user toneBlue
class node_pipeline,node_dialog,node_llm,node_persona,node_style,node_agent toneAmber
class node_api,node_tools,node_voice,node_calls toneMint
class node_contact_memory,node_knowledge,node_consolidation,node_repositories toneRose
class node_main,node_container,node_background,node_orchestrator,node_telegram toneIndigo
```

## Components

### Channels and UI

- [Telegram channel](https://github.com/arti2210/corvus-x/blob/main/src/adapters/channels/telegram_channel.py): `src/adapters/channels/telegram_channel.py`
- [Management SPA](https://github.com/arti2210/corvus-x/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`

### Assistant application

- [Conversation pipeline](https://github.com/arti2210/corvus-x/blob/main/src/core/application/pipeline_runner.py): `src/core/application/pipeline_runner.py`
- [Dialog manager](https://github.com/arti2210/corvus-x/blob/main/src/core/application/dialog_manager.py): `src/core/application/dialog_manager.py`
- [LLM orchestration](https://github.com/arti2210/corvus-x/blob/main/src/core/application/llm_orchestrator.py): `src/core/application/llm_orchestrator.py`
- [Persona and prompts](https://github.com/arti2210/corvus-x/blob/main/src/core/application/persona_manager.py): `src/core/application/persona_manager.py`
- [Style imprinting](https://github.com/arti2210/corvus-x/blob/main/src/core/application/style_imprinter.py): `src/core/application/style_imprinter.py`
- [ReAct agent](https://github.com/arti2210/corvus-x/blob/main/src/core/application/agent_loop.py): `src/core/application/agent_loop.py`

### Runtime adapters

- [REST API](https://github.com/arti2210/corvus-x/blob/main/src/adapters/api/app.py): `src/adapters/api/app.py`
- [Agent tools](https://github.com/arti2210/corvus-x/tree/main/src/tools): `src/tools`
- [Voice adapters](https://github.com/arti2210/corvus-x/tree/main/src/adapters/voice): `src/adapters/voice`
- [Live call engine](https://github.com/arti2210/corvus-x/blob/main/src/adapters/calls/engine.py): `src/adapters/calls/engine.py`

### Memory and persistence

- [Contact memory](https://github.com/arti2210/corvus-x/blob/main/src/core/application/contact_memory_manager.py): `src/core/application/contact_memory_manager.py`
- [Knowledge base](https://github.com/arti2210/corvus-x/blob/main/src/core/application/knowledge_base.py): `src/core/application/knowledge_base.py`
- [Memory consolidation](https://github.com/arti2210/corvus-x/blob/main/src/core/application/consolidation/worker.py): `src/core/application/consolidation/worker.py`
- [Persistence adapters](https://github.com/arti2210/corvus-x/tree/main/src/adapters/persistence): `src/adapters/persistence`

### Operations

- [Runtime startup](https://github.com/arti2210/corvus-x/blob/main/src/main.py): `src/main.py`
- [Dependency assembly](https://github.com/arti2210/corvus-x/blob/main/src/di_container.py): `src/di_container.py`
- [Background loops](https://github.com/arti2210/corvus-x/blob/main/src/core/application/background_loops.py): `src/core/application/background_loops.py`
- [Multi-stage orchestrator](https://github.com/arti2210/corvus-x/blob/main/orchestrator/main.py): `orchestrator/main.py`

### Other components

- **Messenger user**
- **Telegram**

## Connections

- Messenger user → Telegram: sends messages (evidence: `README.md`)
- Telegram → Telegram channel: receives via (evidence: `README.md`)
- Telegram channel → Dialog manager: routes messages
- Dialog manager → Conversation pipeline: runs conversation
- Conversation pipeline → LLM orchestration: requests generation (evidence: `src/core/application/pipeline_runner.py`)
- Conversation pipeline → Persona and prompts: uses persona (evidence: `src/core/application/pipeline_runner.py`)
- Conversation pipeline → Style imprinting: uses style (evidence: `src/core/application/pipeline_runner.py`)
- Conversation pipeline → Contact memory: persists memory (evidence: `src/core/application/pipeline_runner.py`)
- Conversation pipeline → Knowledge base: uses memory (evidence: `src/core/application/pipeline_runner.py`)
- ReAct agent → Agent tools: dispatches tools (evidence: `README.md`)
- Conversation pipeline → ReAct agent: supports agent loop
- Contact memory → Persistence adapters: stores profiles
- Knowledge base → Persistence adapters: reads knowledge (evidence: `src/adapters/persistence/knowledge_repository.py`)
- Memory consolidation → Knowledge base: consolidates memory
- Telegram channel → Live call engine: provides call client (evidence: `src/adapters/calls/engine.py`)
- Live call engine → Voice adapters: uses voice services
- Management SPA → REST API: calls management API
- Runtime startup → Dependency assembly: builds services (evidence: `src/main.py`)
- Runtime startup → Background loops: wires loops (evidence: `src/main.py`)
- Dependency assembly → REST API: creates app (evidence: `src/di_container.py`)
- Multi-stage orchestrator → Telegram: coordinates stages
