A lightweight retrieval-augmented documentation assistant built with FastAPI, LangChain, ChromaDB, and Ollama.
It allows developers to query their own documentation or project notes using local language models and embeddings.
DevDocs Assistant provides an API that retrieves relevant document context and generates concise answers using an Ollama model (tinyllama) and local embeddings (nomic-embed-text).
It is designed to run locally, fully offline once your vector database is built, and can work with any Ollama model that supports chat and embedding.
- Retrieval-Augmented Generation (RAG): Combines semantic document retrieval with language model reasoning.
- Local Embeddings: Uses Ollama’s
nomic-embed-textmodel for vector indexing. - Modular Model Selection: Defaults to TinyLlama but supports any installed Ollama model.
- FastAPI Backend: Clean REST API with automatic interactive Swagger documentation (
/docs). - Persistent Vector Store: Uses ChromaDB to store and retrieve embedded document chunks.
git clone https://github.com/michaeltsige/Devdocs-Assistant.git
cd Devdocs-Assistant
pip install -r requirements.txt# Start Ollama service
ollama serve &
# Pull lightweight embedding and chat models
ollama pull nomic-embed-text
ollama pull tinyllamapython3 -m uvicorn app:app --host 0.0.0.0 --port 8000The server will start at http://localhost:8000. Open http://localhost:8000/docs in your browser to access the interactive Swagger documentation.
Query your documentation using semantic vector search across ChromaDB:
curl -X POST http://localhost:8000/ask \
-H "Content-Type: application/json" \
-d '{"question": "How do I configure API routing in Express?"}'{
"answer": "To configure routing in Express, use express.Router() to create modular route handlers. Define HTTP methods (router.get, router.post) and mount the router on your app using app.use('/api', router).",
"processing_time": 0.384,
"source": "docs/express/routing.md (chunk_id: 14)"
}Bypass retrieval for general knowledge or fast answers:
curl -X POST http://localhost:8000/simple_ask \
-H "Content-Type: application/json" \
-d '{"question": "What is Retrieval-Augmented Generation?"}'{
"answer": "Retrieval-Augmented Generation (RAG) is an architecture that enhances a language model's responses by retrieving relevant data from an external knowledge base before generation.",
"processing_time": 0.192,
"source": "direct_llm"
}- Vector Store: ChromaDB (
./vectorstore) - Embeddings:
nomic-embed-text - LLM:
tinyllama(configurable inapp.py)