This document explains how Archive Brain is structured and how data flows through the system.
- Frontend – React UI for search and browsing
- API – FastAPI service for queries and RAG
- Worker – Background ingestion and enrichment pipeline
- Database – PostgreSQL + pgvector
- LLM Runtime – Ollama (local or external)
All components communicate over Docker networks.
-
Ingestion
- Files scanned from configured directories
- Content extracted via Tika / OCR
-
Segmentation
- Large files split into logical chunks
- Chunk boundaries stored in the database
-
Enrichment
- LLM generates metadata:
- Title
- Summary
- Tags
- LLM generates metadata:
-
Embedding
- Each chunk converted into a vector embedding
- Stored in pgvector for semantic search
-
Retrieval & Generation
- Search queries retrieve relevant chunks
- LLM synthesizes responses from retrieved context
- Files – Original documents
- Entries – Segmented chunks
- Metadata – LLM-generated enrichment
- Embeddings – Vector representations
The database is the system’s source of truth.
- Chat model – Summaries, Q&A
- Embedding model – Semantic similarity
- Vision model – Image descriptions
Models are interchangeable via environment variables.
Advanced users can customize:
- Chunking strategy
- Metadata schema
- Ranking and retrieval logic
- UI presentation
Most extensions live in the worker pipeline.
- Local-first
- Transparent processing
- Inspectable data
- Composable architecture
Archive Brain favors clarity over cleverness.