# hillzeealex/vektoria architecture

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

- Interactive diagram: https://gitdiagram.com/hillzeealex/vektoria
- Repository: https://github.com/hillzeealex/vektoria

## Overview

Vektoria is a self-hosted vector database for local document ingestion and vector, keyword, or hybrid retrieval. A typical flow accepts a document through the REST API, extracts and chunks its text, embeds the chunks, and stores them in an index; queries are embedded and searched against that index. Raw-vector clients can also use the API, and the read-only dashboard uses its endpoints. The graph reflects documented behavior and sampled calls; some server-route details and index internals were not fully excerpted.

Main entry points: [`vektoria/server.py`](https://github.com/hillzeealex/vektoria/blob/master/vektoria/server.py) (REST API), [`vektoria/ingest/pipeline.py`](https://github.com/hillzeealex/vektoria/blob/master/vektoria/ingest/pipeline.py) (Ingestion pipeline), [`vektoria/index.py`](https://github.com/hillzeealex/vektoria/blob/master/vektoria/index.py) (Index operations), [`vektoria/embedding.py`](https://github.com/hillzeealex/vektoria/blob/master/vektoria/embedding.py) (Text embedding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Document ingestion"]
  node_extract["Text extraction<br/>[extract.py]"]
  node_chunk["Text chunking<br/>[chunk.py]"]
  node_pipeline["Ingestion pipeline<br/>[pipeline.py]"]
  node_embedder["Text embedding<br/>[embedding.py]"]
end

subgraph group_service["API and management"]
  node_dashboard["Read-only dashboard<br/>[dashboard.py]"]
  node_server["REST API<br/>[server.py]"]
  node_manager["Index manager<br/>[manager.py]"]
end

subgraph group_retrieval["Index and retrieval"]
  node_index["Index operations<br/>[index.py]"]
  node_sqlite[("SQLite index store<br/>[index.py]")]
  node_bm25["BM25 keyword search<br/>[bm25.py]"]
  node_backend["Vector backend<br/>[backends.py]"]
end

subgraph group_extensions["Optional integrations"]
  node_ann["TurboVec ANN adapter<br/>[ann.py]"]
end

node_client(("API client"))
node_ollama["Ollama embedding service"]

node_client -->|"calls REST API"| node_server
node_server -->|"manages indexes"| node_manager
node_manager -->|"opens and creates"| node_index
node_server -->|"serves page"| node_dashboard
node_dashboard -->|"fetches index and query endpoints"| node_server
node_server -->|"routes document ingestion"| node_pipeline
node_pipeline -->|"extracts text"| node_extract
node_pipeline -->|"chunks text"| node_chunk
node_pipeline -->|"embeds chunks"| node_embedder
node_pipeline -->|"upserts vectors"| node_index
node_server -->|"embeds text queries"| node_embedder
node_index -->|"persists vectors and metadata"| node_sqlite
node_index -->|"uses keyword ranking"| node_bm25
node_index -->|"delegates vector search"| node_backend
node_backend -->|"loads optional adapter"| node_ann
node_embedder -.->|"requests embeddings"| node_ollama

click node_dashboard "https://github.com/hillzeealex/vektoria/blob/master/vektoria/dashboard.py"
click node_server "https://github.com/hillzeealex/vektoria/blob/master/vektoria/server.py"
click node_manager "https://github.com/hillzeealex/vektoria/blob/master/vektoria/manager.py"
click node_extract "https://github.com/hillzeealex/vektoria/blob/master/vektoria/ingest/extract.py"
click node_chunk "https://github.com/hillzeealex/vektoria/blob/master/vektoria/ingest/chunk.py"
click node_pipeline "https://github.com/hillzeealex/vektoria/blob/master/vektoria/ingest/pipeline.py"
click node_embedder "https://github.com/hillzeealex/vektoria/blob/master/vektoria/embedding.py"
click node_index "https://github.com/hillzeealex/vektoria/blob/master/vektoria/index.py"
click node_sqlite "https://github.com/hillzeealex/vektoria/blob/master/vektoria/index.py"
click node_bm25 "https://github.com/hillzeealex/vektoria/blob/master/vektoria/bm25.py"
click node_backend "https://github.com/hillzeealex/vektoria/blob/master/vektoria/backends.py"
click node_ann "https://github.com/hillzeealex/vektoria/blob/master/vektoria/ann.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_extract,node_chunk,node_pipeline,node_embedder,node_client toneBlue
class node_dashboard,node_server,node_manager toneAmber
class node_index,node_sqlite,node_bm25,node_backend toneMint
class node_ann toneRose
class node_ollama toneIndigo
```

## Components

### Document ingestion

- [Text extraction](https://github.com/hillzeealex/vektoria/blob/master/vektoria/ingest/extract.py): `vektoria/ingest/extract.py`
- [Text chunking](https://github.com/hillzeealex/vektoria/blob/master/vektoria/ingest/chunk.py): `vektoria/ingest/chunk.py`
- [Ingestion pipeline](https://github.com/hillzeealex/vektoria/blob/master/vektoria/ingest/pipeline.py): `vektoria/ingest/pipeline.py`
- [Text embedding](https://github.com/hillzeealex/vektoria/blob/master/vektoria/embedding.py): `vektoria/embedding.py`

### API and management

- [Read-only dashboard](https://github.com/hillzeealex/vektoria/blob/master/vektoria/dashboard.py): `vektoria/dashboard.py`
- [REST API](https://github.com/hillzeealex/vektoria/blob/master/vektoria/server.py): `vektoria/server.py`
- [Index manager](https://github.com/hillzeealex/vektoria/blob/master/vektoria/manager.py): `vektoria/manager.py`

### Index and retrieval

- [Index operations](https://github.com/hillzeealex/vektoria/blob/master/vektoria/index.py): `vektoria/index.py`
- [SQLite index store](https://github.com/hillzeealex/vektoria/blob/master/vektoria/index.py): `vektoria/index.py`
- [BM25 keyword search](https://github.com/hillzeealex/vektoria/blob/master/vektoria/bm25.py): `vektoria/bm25.py`
- [Vector backend](https://github.com/hillzeealex/vektoria/blob/master/vektoria/backends.py): `vektoria/backends.py`

### Optional integrations

- [TurboVec ANN adapter](https://github.com/hillzeealex/vektoria/blob/master/vektoria/ann.py): `vektoria/ann.py`

### Other components

- **API client**
- **Ollama embedding service**

## Connections

- API client → REST API: calls REST API (evidence: `README.md`)
- REST API → Index manager: manages indexes (evidence: `vektoria/server.py`)
- Index manager → Index operations: opens and creates (evidence: `vektoria/manager.py`)
- REST API → Read-only dashboard: serves page (evidence: `vektoria/server.py`)
- Read-only dashboard → REST API: fetches index and query endpoints (evidence: `vektoria/dashboard.py`)
- REST API → Ingestion pipeline: routes document ingestion (evidence: `README.md`)
- Ingestion pipeline → Text extraction: extracts text (evidence: `vektoria/ingest/pipeline.py`)
- Ingestion pipeline → Text chunking: chunks text (evidence: `vektoria/ingest/pipeline.py`)
- Ingestion pipeline → Text embedding: embeds chunks (evidence: `vektoria/ingest/pipeline.py`)
- Ingestion pipeline → Index operations: upserts vectors (evidence: `vektoria/ingest/pipeline.py`)
- REST API → Text embedding: embeds text queries (evidence: `README.md`)
- Index operations → SQLite index store: persists vectors and metadata (evidence: `README.md`)
- Index operations → BM25 keyword search: uses keyword ranking (evidence: `vektoria/index.py`)
- Index operations → Vector backend: delegates vector search (evidence: `vektoria/index.py`)
- Vector backend → TurboVec ANN adapter: loads optional adapter (evidence: `vektoria/backends.py`)
- Text embedding → Ollama embedding service: requests embeddings (evidence: `vektoria/embedding.py`)
