RAG-based codebase Q&A system. Automatically generates code documentation and answers questions with relevant code snippets.
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Frontend │────▶│ Backend │────▶│ Qdrant │
│ (React) │ │ (Go/Gin) │ │ (Vector DB) │
└─────────────┘ └──────┬──────┘ └─────────────┘
│
┌──────▼──────┐
│ OpenAI API │
│ (LLM+Embed) │
└─────────────┘
┌─────────────┐
│ Docgen │──▶ Generate docs via Claude CLI → Index to Qdrant
│ (Go CLI) │
└─────────────┘
| Directory | Description | Tech Stack |
|---|---|---|
docgen/ |
Code documentation generator CLI | Go, Claude CLI, OpenAI Embeddings |
backend/ |
RAG API server | Go, Gin, OpenAI, Qdrant |
frontend/ |
Chat UI | React, Vite, TailwindCSS |
docker run -d --name qdrant -p 6333:6333 -p 6334:6334 qdrant/qdrant
⚠️ Warning: Docgen runs Claude CLI withbypassPermissionsmode, granting full filesystem access. Run in a container for untrusted codebases.
cd docgen
export ANTHROPIC_API_KEY=your-key # skip this if you logged in
export OPENAI_API_KEY=your-key
# Generate docs (use --exclude to skip test/build dirs)
./docgen generate --dir /path/to/repo --output ./docs --exclude test,build
# Index to Qdrant
./docgen index --docs ./docs --collection code_docscd backend
export OPENAI_API_KEY=your-key
export OPENAI_MODEL=gpt-4o-mini
export QDRANT_URL=http://localhost:6333
export REPO_PATH=/path/to/repo
./servercd frontend
npm install
npm run devOpen http://localhost:5173 in your browser.
| Variable | Description | Default |
|---|---|---|
ANTHROPIC_API_KEY |
Claude CLI authentication | - |
OPENAI_API_KEY |
Embedding generation | - |
| Variable | Description | Default |
|---|---|---|
OPENAI_API_KEY |
OpenAI API key | - |
OPENAI_MODEL |
LLM model | gpt-4o-mini |
QDRANT_URL |
Qdrant server URL | http://localhost:6333 |
REPO_PATH |
Target repository path | /repo |
PORT |
Server port | 8080 |
COLLECTION_NAME |
Qdrant collection name | code_docs |
- Auto Documentation: Claude analyzes each file and generates structured documentation
- Query Rewriting + HyDE: Optimizes search queries for better retrieval accuracy
- Code Enrichment: Provides actual source code alongside documentation to LLM
- SSE Streaming: Real-time response streaming
- Code Viewer: Click file references in answers to view highlighted code