Summary
Add a conversational chatbot interface that lets users ask natural-language questions
about their repository's generated documentation, powered by the same configured LLM.
Motivation
After documentation is generated, users often have follow-up questions like:
"Where is the authentication logic?", "What does the TaskScheduler module do?",
"Show me the data flow between the API and the database layer."
A chatbot gives instant answers without manually reading through all docs.
Proposed Design
Backend
- New FastAPI endpoint
POST /api/chat/{job_id} accepting { "message": "..." }
- RAG (Retrieval-Augmented Generation) pipeline:
- Load generated
.md docs for the job
- Chunk & embed (using
litellm embedding endpoint or local model)
- Vector store (in-memory with
faiss or file-based with chromadb)
- Retrieve relevant chunks, build context prompt, call configured LLM
- Streaming response via Server-Sent Events (SSE) for real-time feel
Frontend
- Chat widget on the documentation viewer page
- Message history with user/assistant bubbles
- Markdown rendering in assistant responses (code blocks, links)
- "Clear chat" button
Configuration
- Reuse the existing LLM provider configuration (no extra setup needed)
- Optional: dedicated
--chat-model config for a cheaper/faster model
Files Affected
- New
codewiki/src/fe/chat_service.py — RAG logic
- New
codewiki/src/fe/chat_routes.py — FastAPI chat endpoints
codewiki/src/fe/web_app.py — register chat routes
codewiki/src/fe/templates.py — add chat UI to doc viewer
requirements.txt — add faiss-cpu or chromadb
Acceptance Criteria
Summary
Add a conversational chatbot interface that lets users ask natural-language questions
about their repository's generated documentation, powered by the same configured LLM.
Motivation
After documentation is generated, users often have follow-up questions like:
"Where is the authentication logic?", "What does the TaskScheduler module do?",
"Show me the data flow between the API and the database layer."
A chatbot gives instant answers without manually reading through all docs.
Proposed Design
Backend
POST /api/chat/{job_id}accepting{ "message": "..." }.mddocs for the joblitellmembedding endpoint or local model)faissor file-based withchromadb)Frontend
Configuration
--chat-modelconfig for a cheaper/faster modelFiles Affected
codewiki/src/fe/chat_service.py— RAG logiccodewiki/src/fe/chat_routes.py— FastAPI chat endpointscodewiki/src/fe/web_app.py— register chat routescodewiki/src/fe/templates.py— add chat UI to doc viewerrequirements.txt— addfaiss-cpuorchromadbAcceptance Criteria