# rehanshaikh-ai/hyades architecture

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

- Interactive diagram: https://gitdiagram.com/rehanshaikh-ai/hyades
- Repository: https://github.com/rehanshaikh-ai/hyades

## Overview

Knowledge Atlas is a personal knowledge platform for capturing notes and source documents, connecting them in a knowledge graph, and retrieving grounded answers with citations. The main workflow runs from the web app through API routes into ingestion, indexing, search, and assistant services; background jobs handle non-blocking processing. Notes, sources, graph data, and assistant conversations are distinct product stages. The graph includes key storage and provider integrations. Some frontend and service wiring is unsampled, so those relationships are omitted unless documented in the README or visible in an indexed excerpt.

Main entry points: [`backend/app/api/v1/router.py`](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/api/v1/router.py) (Versioned API), [`backend/app/services/retrieval_service.py`](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/retrieval_service.py) (Hybrid retrieval), [`backend/app/services/source_processing_service.py`](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/source_processing_service.py) (Source processing), [`backend/app/services/graph_rag_service.py`](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/graph_rag_service.py) (Graph reasoning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Knowledge Atlas UI<br/>[App.tsx]"]
  node_webpages["Knowledge workspaces"]
  node_webapi["API client<br/>[client.ts]"]
end

subgraph group_api["API boundary"]
  node_apirouter["Versioned API<br/>[router.py]"]
  node_sourceapi["Source routes<br/>[sources.py]"]
  node_noteapi["Note routes<br/>[notes.py]"]
  node_searchapi["Search routes<br/>[search.py]"]
  node_ragapi["RAG routes<br/>[rag.py]"]
  node_graphapi["Graph routes<br/>[graph_rag.py]"]
end

subgraph group_knowledge["Knowledge capture"]
  node_sourceprocessing["Source processing"]
  node_notes["Notes and versions<br/>[note_service.py]"]
  node_graph["Knowledge graph<br/>[graph_service.py]"]
end

subgraph group_retrieval["Search and reasoning"]
  node_search["Hybrid retrieval"]
  node_rag["Grounded assistant<br/>[rag_service.py]"]
  node_graphrag["Graph reasoning"]
  node_llm["LLM providers<br/>[llm_service.py]"]
end

subgraph group_runtime["Processing and storage"]
  node_worker["Background worker<br/>[worker.py]"]
  node_jobs["Job service<br/>[job_service.py]"]
  node_postgres[("PostgreSQL<br/>[session.py]")]
  node_vector[("Qdrant vectors")]
  node_redis["Redis queue"]
  node_git[("Git revisions")]
end

node_person(("Knowledge worker"))
node_user(("User knowledge"))

node_person -->|"uses"| node_webapp
node_webapp -.->|"presents"| node_webpages
node_webpages -.->|"requests"| node_webapi
node_webapi -->|"calls API"| node_apirouter
node_apirouter -->|"registers"| node_sourceapi
node_apirouter -->|"registers"| node_noteapi
node_apirouter -->|"registers"| node_searchapi
node_apirouter -->|"registers"| node_ragapi
node_apirouter -->|"registers"| node_graphapi
node_sourceapi -.->|"dispatches"| node_sourceprocessing
node_noteapi -.->|"delegates"| node_notes
node_searchapi -.->|"delegates"| node_search
node_ragapi -->|"calls"| node_rag
node_graphapi -->|"calls"| node_graphrag
node_sourceprocessing -->|"queued processing"| node_worker
node_worker -->|"uses"| node_jobs
node_rag -->|"retrieves"| node_search
node_rag -->|"generates answer"| node_llm
node_graphrag -->|"retrieves"| node_search
node_graphrag -->|"generates answer"| node_llm
node_search -->|"semantic search"| node_vector
node_search -->|"reads chunks"| node_postgres
node_graphrag -->|"traverses graph"| node_postgres
node_sourceprocessing -.->|"stores records"| node_postgres
node_sourceprocessing -.->|"indexes chunks"| node_vector
node_worker -->|"uses queue"| node_redis
node_notes -->|"versions notes"| node_git
node_llm -.->|"streams response"| node_user

click node_webapp "https://github.com/rehanshaikh-ai/hyades/blob/main/frontend/src/App.tsx"
click node_webpages "https://github.com/rehanshaikh-ai/hyades/tree/main/frontend/src/pages"
click node_webapi "https://github.com/rehanshaikh-ai/hyades/blob/main/frontend/src/api/client.ts"
click node_apirouter "https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/api/v1/router.py"
click node_sourceapi "https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/api/v1/sources.py"
click node_noteapi "https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/api/v1/notes.py"
click node_searchapi "https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/api/v1/search.py"
click node_ragapi "https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/api/v1/rag.py"
click node_graphapi "https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/api/v1/graph_rag.py"
click node_sourceprocessing "https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/source_processing_service.py"
click node_notes "https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/note_service.py"
click node_graph "https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/graph_service.py"
click node_search "https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/retrieval_service.py"
click node_rag "https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/rag_service.py"
click node_graphrag "https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/graph_rag_service.py"
click node_llm "https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/llm_service.py"
click node_worker "https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/jobs/worker.py"
click node_jobs "https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/job_service.py"
click node_postgres "https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/db/session.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_webapp,node_webpages,node_webapi,node_user toneBlue
class node_apirouter,node_sourceapi,node_noteapi,node_searchapi,node_ragapi,node_graphapi toneAmber
class node_sourceprocessing,node_notes,node_graph toneMint
class node_search,node_rag,node_graphrag,node_llm,node_person toneRose
class node_worker,node_jobs,node_postgres,node_vector,node_redis,node_git toneIndigo
```

## Components

### Web experience

- [Knowledge Atlas UI](https://github.com/rehanshaikh-ai/hyades/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Knowledge workspaces](https://github.com/rehanshaikh-ai/hyades/tree/main/frontend/src/pages): `frontend/src/pages`
- [API client](https://github.com/rehanshaikh-ai/hyades/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### API boundary

- [Versioned API](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/api/v1/router.py): `backend/app/api/v1/router.py`
- [Source routes](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/api/v1/sources.py): `backend/app/api/v1/sources.py`
- [Note routes](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/api/v1/notes.py): `backend/app/api/v1/notes.py`
- [Search routes](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/api/v1/search.py): `backend/app/api/v1/search.py`
- [RAG routes](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/api/v1/rag.py): `backend/app/api/v1/rag.py`
- [Graph routes](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/api/v1/graph_rag.py): `backend/app/api/v1/graph_rag.py`

### Knowledge capture

- [Source processing](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/source_processing_service.py): `backend/app/services/source_processing_service.py`
- [Notes and versions](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/note_service.py): `backend/app/services/note_service.py`
- [Knowledge graph](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/graph_service.py): `backend/app/services/graph_service.py`

### Search and reasoning

- [Hybrid retrieval](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/retrieval_service.py): `backend/app/services/retrieval_service.py`
- [Grounded assistant](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/rag_service.py): `backend/app/services/rag_service.py`
- [Graph reasoning](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/graph_rag_service.py): `backend/app/services/graph_rag_service.py`
- [LLM providers](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/llm_service.py): `backend/app/services/llm_service.py`

### Processing and storage

- [Background worker](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/jobs/worker.py): `backend/app/jobs/worker.py`
- [Job service](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/services/job_service.py): `backend/app/services/job_service.py`
- [PostgreSQL](https://github.com/rehanshaikh-ai/hyades/blob/main/backend/app/db/session.py): `backend/app/db/session.py`
- **Qdrant vectors**
- **Redis queue**
- **Git revisions**

### Other components

- **Knowledge worker**
- **User knowledge**

## Connections

- Knowledge worker → Knowledge Atlas UI: uses
- Knowledge Atlas UI → Knowledge workspaces: presents
- Knowledge workspaces → API client: requests
- API client → Versioned API: calls API
- Versioned API → Source routes: registers (evidence: `backend/app/api/v1/router.py`)
- Versioned API → Note routes: registers (evidence: `backend/app/api/v1/router.py`)
- Versioned API → Search routes: registers (evidence: `backend/app/api/v1/router.py`)
- Versioned API → RAG routes: registers (evidence: `backend/app/api/v1/router.py`)
- Versioned API → Graph routes: registers (evidence: `backend/app/api/v1/router.py`)
- Source routes → Source processing: dispatches
- Note routes → Notes and versions: delegates
- Search routes → Hybrid retrieval: delegates
- RAG routes → Grounded assistant: calls (evidence: `backend/app/api/v1/rag.py`)
- Graph routes → Graph reasoning: calls (evidence: `backend/app/api/v1/graph_rag.py`)
- Source processing → Background worker: queued processing (evidence: `backend/app/jobs/worker.py`)
- Background worker → Job service: uses (evidence: `backend/app/jobs/worker.py`)
- Grounded assistant → Hybrid retrieval: retrieves (evidence: `backend/app/services/rag_service.py`)
- Grounded assistant → LLM providers: generates answer (evidence: `backend/app/services/rag_service.py`)
- Graph reasoning → Hybrid retrieval: retrieves (evidence: `backend/app/services/graph_rag_service.py`)
- Graph reasoning → LLM providers: generates answer (evidence: `backend/app/services/graph_rag_service.py`)
- Hybrid retrieval → Qdrant vectors: semantic search (evidence: `backend/app/services/retrieval_service.py`)
- Hybrid retrieval → PostgreSQL: reads chunks (evidence: `backend/app/services/retrieval_service.py`)
- Graph reasoning → PostgreSQL: traverses graph (evidence: `backend/app/services/graph_rag_service.py`)
- Source processing → PostgreSQL: stores records
- Source processing → Qdrant vectors: indexes chunks
- Background worker → Redis queue: uses queue
- Notes and versions → Git revisions: versions notes
- LLM providers → User knowledge: streams response
