How thequietarc/ai-knowledge-worker-rag works
AI Knowledge Worker is a local, document-grounded RAG chatbot with an evaluation harness. Its main workflow loads and chunks Markdown documents, embeds and stores them, then retrieves context for each chat question and generates a grounded answer. Evaluation separately measures retrieval and judges generated answers. The graph follows documented and excerpted relationships; unsampled evaluation details are included only where the README or source index establishes their role.
Main entry points: retrieval_eval.py Retrieval experiments · answer_eval.py Answer judge · chain.py RAG answer chain · vectorstore.py Embedding and storage
Components 17
Knowledge indexing
- Markdown knowledge base
data/raw_docs - Document chunking
rag/ingestion.py - Index builder
build_index.py - Embedding and storage
rag/vectorstore.py
Chat answering
- Gradio chat UI
app.py - RAG answer chain
rag/chain.py - Vector retrieval
rag/vectorstore.py
Evaluation harness
- Evaluation runner
run_eval.py - Retrieval experiments
eval/retrieval_eval.py - Golden questions
eval/golden_set.py - Retrieval metrics
eval/metrics.py - Answer judge
eval/answer_eval.py - Saved evaluation runs
eval/runs
Shared services
- Persistent ChromaDB
- Models and settings
rag/config.py
Other components
- Chat user
- Gemini API
Connections 24
- Chat user → Gradio chat UI: asks
README.md - Gradio chat UI → RAG answer chain: calls
app.py - RAG answer chain → Vector retrieval: retrieves
rag/chain.py - Vector retrieval → Persistent ChromaDB: queries
rag/vectorstore.py - Vector retrieval → Gemini API: embeds query
rag/vectorstore.py - RAG answer chain → Gemini API: generates answer
rag/chain.py - RAG answer chain → Chat user: returns answer
rag/chain.py - Markdown knowledge base → Document chunking: provides documents
README.md - Index builder → Embedding and storage: builds index
build_index.py - Embedding and storage → Document chunking: loads chunks
rag/vectorstore.py - Embedding and storage → Gemini API: embeds chunks
rag/vectorstore.py - Embedding and storage → Persistent ChromaDB: stores vectors
README.md - Models and settings → Gemini API: configures client
rag/config.py - Evaluation runner → Retrieval experiments: runs retrieval tests
run_eval.py - Evaluation runner → Answer judge: runs answer judging
run_eval.py - Retrieval experiments → Document chunking: varies chunking
eval/retrieval_eval.py - Retrieval experiments → Golden questions: tests questions
eval/retrieval_eval.py - Retrieval experiments → Retrieval metrics: scores results
eval/retrieval_eval.py - Retrieval experiments → Gemini API: embeds queries
eval/retrieval_eval.py - Answer judge → Golden questions: selects questions
eval/answer_eval.py - Answer judge → RAG answer chain: generates answers
eval/answer_eval.py - Answer judge → Gemini API: judges answers
README.md - Answer judge → Saved evaluation runs: saves progress
README.md - Retrieval experiments → Persistent ChromaDB: builds temporary index
eval/retrieval_eval.py