How lkmbh42/agentic_rag_claudecode works
This is a private, multi-user Agentic RAG platform with a React admin/chat UI, FastAPI backend, background indexing/evaluation worker, and self-hosted model services. The main workflow is authenticated document upload → queued parsing and indexing → permission-scoped retrieval → agent answer with citations, streamed to the user. Separate capabilities cover administration, visual-document handling, and evaluation/observability. The README documents the broader architecture; some subsystem links below reflect those documented responsibilities because their implementation was not sampled.
Main entry points: main.py FastAPI application · indexer.py Document indexer · App.tsx Admin and chat UI · retriever.py Hybrid retrieval
Components 28
User experience
- Admin and chat UI
admin-ui/app/src/App.tsx - Chat interface
admin-ui/app/src/Chat.tsx - Admin interface
admin-ui/app/src/Admin.tsx - UI API client
admin-ui/app/src/api.ts
Backend API
- FastAPI application
app/main.py - Authentication and access control
app/api/auth.py - Document endpoints
app/api/documents.py - Search endpoints
app/api/search.py - Chat endpoints
app/api/chat.py - Admin endpoints
app/api/admin.py
Knowledge pipeline
- Background worker
worker/main.py - Redis job queues
app/queue.py - Document indexer
app/ingestion/indexer.py - Parse and chunk
app/ingestion/pipeline.py - Uploaded-file storage
app/ingestion/storage.py - Visual document services
services/vlm/main.py - PostgreSQL
app/db/session.py
Retrieval and answers
- Hybrid retrieval
app/retrieval/retriever.py - Agent graph
app/graph/runtime.py - LLM client
app/llm/client.py - Embedding and reranking service
services/embeddings/main.py - Visual retrieval service
services/colqwen/main.py - Qdrant vector store
app/ingestion/qdrant_index.py
Operations and evaluation
- Evaluation and judging
app/eval/runner.py - Tracing and metrics
app/observability/tracing.py
Other components
- Employee
- Administrator
- Phoenix
Connections 33
- Employee → Admin and chat UI: uses
- Administrator → Admin and chat UI: uses
- Admin and chat UI → UI API client: calls
- UI API client → FastAPI application: sends requests
- Admin and chat UI → Chat interface: shows
- Admin and chat UI → Admin interface: shows
- FastAPI application → Authentication and access control: dispatches
- FastAPI application → Document endpoints: dispatches
- FastAPI application → Search endpoints: dispatches
- FastAPI application → Chat endpoints: dispatches
- FastAPI application → Admin endpoints: dispatches
- Document endpoints → Uploaded-file storage: stores uploads
- Document endpoints → Redis job queues: enqueues indexing
- Background worker → Redis job queues: consumes jobs
- Background worker → Document indexer: indexes documents
- Document indexer → Uploaded-file storage: reads uploads
- Document indexer → Parse and chunk: parses and chunks
- Parse and chunk → Visual document services: requests captions
- Document indexer → Qdrant vector store: writes vectors
- Document indexer → PostgreSQL: records document state
- Search endpoints → Hybrid retrieval: retrieves passages
- Chat endpoints → Agent graph: runs conversation
- Agent graph → Hybrid retrieval: requests context
- Agent graph → LLM client: routes and generates
- Hybrid retrieval → Embedding and reranking service: embeds and reranks
- Hybrid retrieval → Visual retrieval service: queries page vectors
- Hybrid retrieval → Qdrant vector store: searches vectors
- Agent graph → PostgreSQL: checkpoints state
- Background worker → Evaluation and judging: scores queued answers
- Evaluation and judging → LLM client: judges answers
- FastAPI application → Tracing and metrics: sets up tracing
- Background worker → Tracing and metrics: sets up tracing
- Tracing and metrics → Phoenix: exports traces