Skip to content

feat: Add chatbot for interactive Q&A over generated documentation #6

Description

@mukund-gohil-atos

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:
    1. Load generated .md docs for the job
    2. Chunk & embed (using litellm embedding endpoint or local model)
    3. Vector store (in-memory with faiss or file-based with chromadb)
    4. 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

  • Users can ask questions about docs via the web UI
  • Responses cite the relevant module/file
  • Streaming output works (no waiting for full response)
  • Works with all supported LLM providers
  • Chat history persists for the session

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions