# swapnaniltripathy/aetheon architecture

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

- Interactive diagram: https://gitdiagram.com/swapnaniltripathy/aetheon
- Repository: https://github.com/swapnaniltripathy/aetheon

## Overview

Codebase RAG is a terminal AI coding assistant: users select Chat or Agent mode, provide a repository, then ask questions or request reviewed edits. The backend ingests source through Tree-sitter into a Memgraph knowledge graph; query tools translate natural language to Cypher, with optional semantic retrieval, and an LLM responds or uses file/shell tools. The React Ink frontend uses REST and Socket.IO for queries and delegated file operations. The graph preserves documented capabilities, but several links to unsampled tools and services are based on README descriptions rather than inspected implementations.

Main entry points: [`api/codebase_rag/main.py`](https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/main.py) (RAG orchestrator), [`source/app.tsx`](https://github.com/swapnaniltripathy/aetheon/blob/main/source/app.tsx) (Terminal UI), [`api/services/remote_repo_service.py`](https://github.com/swapnaniltripathy/aetheon/blob/main/api/services/remote_repo_service.py) (Remote query service), [`api/codebase_rag/graph_updater.py`](https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/graph_updater.py) (Graph updater)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Terminal interface"]
  node_tui["Terminal UI<br/>[app.tsx]"]
  node_rest_client["Chat API client<br/>[chat.ts]"]
  node_workspace["Workspace operations<br/>[workspace.ts]"]
  node_socket_client["Socket file operations<br/>[SocketContext.tsx]"]
end

subgraph group_api["API and sessions"]
  node_api_server["HTTP and socket server<br/>[main.py]"]
  node_remote_controller["Remote repository routes"]
  node_remote_service["Remote query service"]
  node_socket_server["Socket server<br/>[server.py]"]
end

subgraph group_indexing["Code indexing"]
  node_indexer["Graph updater<br/>[graph_updater.py]"]
  node_parser_factory["Language parsers<br/>[factory.py]"]
  node_language_config["Language support<br/>[language_config.py]"]
  node_graph_store["Graph access<br/>[graph_service.py]"]
end

subgraph group_reasoning["RAG and tools"]
  node_rag_agent["RAG orchestrator<br/>[main.py]"]
  node_query_tool["Graph query tool<br/>[codebase_query.py]"]
  node_cypher_llm["Cypher generator<br/>[llm.py]"]
  node_semantic["Semantic search<br/>[semantic_search.py]"]
  node_providers["LLM providers<br/>[base.py]"]
  node_agent_tools["Code and file tools"]
end

subgraph group_persistence["State and storage"]
  node_session_store[("Chat sessions<br/>[session.py]")]
  node_relational_db[("Session database<br/>[database.py]")]
end

node_user(("Developer"))
node_memgraph[("Memgraph")]

node_user -->|"asks or edits"| node_tui
node_tui -->|"submits queries"| node_rest_client
node_tui -->|"selects repository"| node_workspace
node_tui -->|"opens operations"| node_socket_client
node_rest_client -->|"REST requests"| node_api_server
node_api_server -->|"registers routes"| node_remote_controller
node_remote_controller -->|"delegates requests"| node_remote_service
node_remote_service -->|"ingests uploads"| node_indexer
node_remote_service -->|"runs query agent"| node_rag_agent
node_remote_service -->|"loads and saves history"| node_session_store
node_session_store -.->|"persists sessions"| node_relational_db
node_indexer -->|"uses parsers"| node_parser_factory
node_indexer -->|"reads language settings"| node_language_config
node_indexer -->|"writes graph data"| node_graph_store
node_graph_store -->|"executes graph queries"| node_memgraph
node_rag_agent -->|"offers graph querying"| node_query_tool
node_query_tool -->|"generates Cypher"| node_cypher_llm
node_query_tool -->|"fetches results"| node_graph_store
node_rag_agent -->|"offers semantic search"| node_semantic
node_rag_agent -->|"offers code tools"| node_agent_tools
node_rag_agent -.->|"configures model"| node_providers
node_socket_client -->|"delegated file actions"| node_socket_server
node_api_server -->|"wraps ASGI app"| node_socket_server

click node_tui "https://github.com/swapnaniltripathy/aetheon/blob/main/source/app.tsx"
click node_rest_client "https://github.com/swapnaniltripathy/aetheon/blob/main/source/api/chat.ts"
click node_workspace "https://github.com/swapnaniltripathy/aetheon/blob/main/source/utils/workspace.ts"
click node_socket_client "https://github.com/swapnaniltripathy/aetheon/blob/main/source/contexts/SocketContext.tsx"
click node_api_server "https://github.com/swapnaniltripathy/aetheon/blob/main/api/main.py"
click node_remote_controller "https://github.com/swapnaniltripathy/aetheon/blob/main/api/controllers/remote_repo_controller.py"
click node_remote_service "https://github.com/swapnaniltripathy/aetheon/blob/main/api/services/remote_repo_service.py"
click node_session_store "https://github.com/swapnaniltripathy/aetheon/blob/main/api/models/session.py"
click node_relational_db "https://github.com/swapnaniltripathy/aetheon/blob/main/api/core/db/database.py"
click node_indexer "https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/graph_updater.py"
click node_parser_factory "https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/parsers/factory.py"
click node_language_config "https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/language_config.py"
click node_graph_store "https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/services/graph_service.py"
click node_rag_agent "https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/main.py"
click node_query_tool "https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/tools/codebase_query.py"
click node_cypher_llm "https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/services/llm.py"
click node_semantic "https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/tools/semantic_search.py"
click node_providers "https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/providers/base.py"
click node_agent_tools "https://github.com/swapnaniltripathy/aetheon/tree/main/api/codebase_rag/tools"
click node_socket_server "https://github.com/swapnaniltripathy/aetheon/blob/main/api/sockets/server.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_tui,node_rest_client,node_workspace,node_socket_client toneBlue
class node_api_server,node_remote_controller,node_remote_service,node_socket_server,node_memgraph toneAmber
class node_indexer,node_parser_factory,node_language_config,node_graph_store toneMint
class node_rag_agent,node_query_tool,node_cypher_llm,node_semantic,node_providers,node_agent_tools toneRose
class node_session_store,node_relational_db,node_user toneIndigo
```

## Components

### Terminal interface

- [Terminal UI](https://github.com/swapnaniltripathy/aetheon/blob/main/source/app.tsx): `source/app.tsx`
- [Chat API client](https://github.com/swapnaniltripathy/aetheon/blob/main/source/api/chat.ts): `source/api/chat.ts`
- [Workspace operations](https://github.com/swapnaniltripathy/aetheon/blob/main/source/utils/workspace.ts): `source/utils/workspace.ts`
- [Socket file operations](https://github.com/swapnaniltripathy/aetheon/blob/main/source/contexts/SocketContext.tsx): `source/contexts/SocketContext.tsx`

### API and sessions

- [HTTP and socket server](https://github.com/swapnaniltripathy/aetheon/blob/main/api/main.py): `api/main.py`
- [Remote repository routes](https://github.com/swapnaniltripathy/aetheon/blob/main/api/controllers/remote_repo_controller.py): `api/controllers/remote_repo_controller.py`
- [Remote query service](https://github.com/swapnaniltripathy/aetheon/blob/main/api/services/remote_repo_service.py): `api/services/remote_repo_service.py`
- [Socket server](https://github.com/swapnaniltripathy/aetheon/blob/main/api/sockets/server.py): `api/sockets/server.py`

### Code indexing

- [Graph updater](https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/graph_updater.py): `api/codebase_rag/graph_updater.py`
- [Language parsers](https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/parsers/factory.py): `api/codebase_rag/parsers/factory.py`
- [Language support](https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/language_config.py): `api/codebase_rag/language_config.py`
- [Graph access](https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/services/graph_service.py): `api/codebase_rag/services/graph_service.py`

### RAG and tools

- [RAG orchestrator](https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/main.py): `api/codebase_rag/main.py`
- [Graph query tool](https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/tools/codebase_query.py): `api/codebase_rag/tools/codebase_query.py`
- [Cypher generator](https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/services/llm.py): `api/codebase_rag/services/llm.py`
- [Semantic search](https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/tools/semantic_search.py): `api/codebase_rag/tools/semantic_search.py`
- [LLM providers](https://github.com/swapnaniltripathy/aetheon/blob/main/api/codebase_rag/providers/base.py): `api/codebase_rag/providers/base.py`
- [Code and file tools](https://github.com/swapnaniltripathy/aetheon/tree/main/api/codebase_rag/tools): `api/codebase_rag/tools`

### State and storage

- [Chat sessions](https://github.com/swapnaniltripathy/aetheon/blob/main/api/models/session.py): `api/models/session.py`
- [Session database](https://github.com/swapnaniltripathy/aetheon/blob/main/api/core/db/database.py): `api/core/db/database.py`

### Other components

- **Developer**
- **Memgraph**

## Connections

- Developer → Terminal UI: asks or edits (evidence: `README.md`)
- Terminal UI → Chat API client: submits queries (evidence: `source/app.tsx`)
- Terminal UI → Workspace operations: selects repository (evidence: `source/app.tsx`)
- Terminal UI → Socket file operations: opens operations (evidence: `source/contexts/SocketContext.tsx`)
- Chat API client → HTTP and socket server: REST requests (evidence: `README.md`)
- HTTP and socket server → Remote repository routes: registers routes (evidence: `api/main.py`)
- Remote repository routes → Remote query service: delegates requests (evidence: `api/controllers/remote_repo_controller.py`)
- Remote query service → Graph updater: ingests uploads (evidence: `api/services/remote_repo_service.py`)
- Remote query service → RAG orchestrator: runs query agent (evidence: `api/services/remote_repo_service.py`)
- Remote query service → Chat sessions: loads and saves history (evidence: `api/services/remote_repo_service.py`)
- Chat sessions → Session database: persists sessions (evidence: `api/models/session.py`)
- Graph updater → Language parsers: uses parsers (evidence: `api/codebase_rag/graph_updater.py`)
- Graph updater → Language support: reads language settings (evidence: `api/codebase_rag/graph_updater.py`)
- Graph updater → Graph access: writes graph data (evidence: `api/codebase_rag/graph_updater.py`)
- Graph access → Memgraph: executes graph queries (evidence: `api/codebase_rag/services/graph_service.py`)
- RAG orchestrator → Graph query tool: offers graph querying (evidence: `api/codebase_rag/main.py`)
- Graph query tool → Cypher generator: generates Cypher (evidence: `api/codebase_rag/tools/codebase_query.py`)
- Graph query tool → Graph access: fetches results (evidence: `api/codebase_rag/tools/codebase_query.py`)
- RAG orchestrator → Semantic search: offers semantic search (evidence: `api/codebase_rag/main.py`)
- RAG orchestrator → Code and file tools: offers code tools (evidence: `api/codebase_rag/main.py`)
- RAG orchestrator → LLM providers: configures model (evidence: `README.md`)
- Socket file operations → Socket server: delegated file actions (evidence: `README.md`)
- HTTP and socket server → Socket server: wraps ASGI app (evidence: `api/main.py`)
