RAG Knowledge Base
RAG Knowledge Base demonstrates how documents and business knowledge can support search and answers with visible source references.
The task
Turn uploaded documents into a searchable knowledge base for semantic search and Q&A over retrieved content.
Implemented solution
Search and Q&A system for internal knowledge bases. Documents are converted into vector representations, relevant context is retrieved via semantic search and passed to an AI model to generate answers with source citations. The implementation supports PDF, UTF-8 TXT, text preparation, embeddings, ChromaDB, retrieval, answer generation, and source metadata.
How the retrieval pipeline works
- 01
PDF / TXT
- 02
Parsing and normalization
- 03
Chunks
- 04
Embeddings
- 05
ChromaDB
- 06
Semantic retrieval
- 07
Relevance filtering
- 08
Context assembly
- 09
AI generation
- 10
Answer + sources
Engineering decisions
An adjacent fragment from the same document can be added to preserve continuity.
The generation prompt constrains the answer to retrieved context.
When suitable context is absent, generation is not started.
Source references are built by the backend from retrieval results.
Hash-based document identity prevents repeated indexing of identical content.
Architecture
- 01
Frontend
React / Vite
Upload, search, and Q&A interface
- 02
API & orchestration
FastAPI
API and pipeline orchestration
- 03
Document processing & retrieval
Parsing · chunks · embeddings · semantic retrieval
- 04
Vector store
ChromaDB
Vector storage and similarity search
- 05
AI providers
Embeddings · answer generation
