| title | DevDocs AI |
|---|---|
| emoji | 🤖 |
| colorFrom | blue |
| colorTo | purple |
| sdk | docker |
| app_port | 7860 |
| suggested_hardware | cpu-basic |
| pinned | false |
A production-grade RAG system with hybrid search, cross-encoder reranking, and agentic routing — built entirely with free tools.
DevDocs AI answers questions about developer tools, frameworks, and libraries using a multi-stage retrieval pipeline. Instead of relying on a single embedding lookup, it combines dense semantic search, sparse BM25 keyword matching, and a cross-encoder reranker to surface the most relevant context before passing it to the LLM.
The entire stack runs on free-tier services — no paid APIs beyond optional monitoring.
User Query
│
▼
┌─────────────────────────────────────────────────────┐
│ Query Router │
│ (LangGraph agent — routes to retrieve / search / │
│ direct answer based on query classification) │
└──────────────────────┬──────────────────────────────┘
│
┌───────────▼───────────┐
│ Hybrid Retrieval │
│ │
│ Dense ──┐ │
│ (SBERT) ├──► Merge ──► CrossEncoder ──► Top-K
│ Sparse ──┘ │ Reranker
│ (BM25) │
└───────────────────────┘
│
┌───────────▼───────────┐
│ LLM Generation │
│ Groq / Llama 3.3 70B │
└───────────────────────┘
│
Answer + Sources + Scores
| Layer | Tool | Notes |
|---|---|---|
| LLM | Groq — Llama 3.3 70B | Free tier, ~300 tok/s |
| Embeddings | all-MiniLM-L6-v2 |
Local, no API cost |
| Vector DB | ChromaDB | Local persistent store |
| Sparse search | BM25 (rank-bm25) |
In-memory, no server |
| Reranker | ms-marco-MiniLM-L-6-v2 |
CrossEncoder, local |
| Orchestration | LangChain + LangGraph | Agent routing |
| UI | Gradio 5 | Deployed on HF Spaces |
| Deployment | Docker on HF Spaces | CPU-basic tier |
devdocs-ai/
├── app.py # HF Spaces entry point
├── Dockerfile # Container build (CPU-optimised)
├── requirements.txt
├── app/
│ └── gradio_app.py # Gradio interface
└── src/
├── config.py # Pydantic settings
├── agents/
│ └── langgraph_agent.py # SimpleRAG + RAGAgent
├── retrieval/
│ └── hybrid_search.py # Dense + BM25 + reranking
├── ingestion/
│ ├── document_loader.py
│ └── chunking.py
└── evaluation/
└── ragas_eval.py # RAGAS metrics
- Python 3.10+
- A free Groq API key
git clone https://github.com/vamsiy2001/DevDocs_AI-Intelligent_Documentation_Assistant.git
cd DevDocs_AI-Intelligent_Documentation_Assistant
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# Add your key
echo "GROQ_API_KEY=your_key_here" > .env
python app.py
# Open http://localhost:7860docker build -t devdocs-ai .
docker run -p 7860:7860 -e GROQ_API_KEY=your_key_here devdocs-aifrom src.retrieval import HybridRetriever
from src.agents import SimpleRAG
retriever = HybridRetriever()
retriever.load_vector_store() # or create_vector_store(docs)
rag = SimpleRAG(retriever)
result = rag.query("How do I use LangChain agents?")
print(result["answer"])
# Sources with relevance scores available in result["sources"]Evaluated on 30 test cases using the RAGAS framework:
| Metric | Score | Target |
|---|---|---|
| Context Precision | 85% | > 70% |
| Answer Faithfulness | 92% | > 80% |
| Context Recall | 88% | > 70% |
| Answer Relevancy | 90% | > 80% |
| P95 Latency | 1.8s | < 2s |
# Run evaluation
python scripts/run_evaluation.pyThe live demo runs on HuggingFace Spaces (CPU basic, free tier).
The Docker image installs torch CPU-only (~200 MB) before other packages so that sentence-transformers does not pull the 2.6 GB CUDA wheel — keeping the build within memory limits.
To deploy your own copy:
git remote add space https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
git push space mainSet GROQ_API_KEY in Space Settings → Variables and secrets.
MIT — see LICENSE.