How rk936503/enterprise-knowledge-base-rag works
This repository is the early core of an API-based RAG knowledge base: users are meant to upload documents and query for grounded, cited answers. The source shows chunking, embedding-provider selection, answer generation, configuration, and database models/session setup, but no router implementation or retrieval code. Accordingly, the documented upload/query stages are represented, while their runtime wiring to these components is left unspecified.
Main entry points: embeddings.py Embedding service · config.py Runtime settings · llm.py Grounded answer generation · chunking.py Text chunking
Components 13
API workflow
- Upload and query API
app/routers
Document processing
- Text chunking
app/chunking.py - Embedding service
app/embeddings.py
Answer generation
- Relevant chunk retrieval
app - Grounded answer generation
app/llm.py
Persistence and settings
- Document and query models
app/models.py - Database sessions
app/database.py - Runtime settings
app/config.py
Other components
- API user
- PostgreSQL with pgvector
- OpenAI embeddings
- Local embedding model
- Anthropic Claude
Connections 9
- API user → Upload and query API: uploads and queries
- Embedding service → OpenAI embeddings: requests embeddings
- Embedding service → Local embedding model: encodes locally
- Grounded answer generation → Anthropic Claude: requests generation
- Database sessions → PostgreSQL with pgvector: creates engine
- Document and query models → PostgreSQL with pgvector: maps persisted records
- Text chunking → Runtime settings: reads settings
- Embedding service → Runtime settings: reads settings
- Grounded answer generation → Runtime settings: reads settings