Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevDocs Assistant

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.

Overview

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.

Features

  • Retrieval-Augmented Generation (RAG): Combines semantic document retrieval with language model reasoning.
  • Local Embeddings: Uses Ollama’s nomic-embed-text model 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.

Quickstart

1. Install Dependencies

git clone https://github.com/michaeltsige/Devdocs-Assistant.git
cd Devdocs-Assistant
pip install -r requirements.txt

2. Start Ollama & Pull Models

# Start Ollama service
ollama serve &

# Pull lightweight embedding and chat models
ollama pull nomic-embed-text
ollama pull tinyllama

3. Run the API Server

python3 -m uvicorn app:app --host 0.0.0.0 --port 8000

The server will start at http://localhost:8000. Open http://localhost:8000/docs in your browser to access the interactive Swagger documentation.


API Usage & Examples

Ask a RAG Question (POST /ask)

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?"}'

Example Response

{
  "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)"
}

Direct Question Answering (POST /simple_ask)

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?"}'

Example Response

{
  "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"
}

Architecture & Customization

  • Vector Store: ChromaDB (./vectorstore)
  • Embeddings: nomic-embed-text
  • LLM: tinyllama (configurable in app.py)

About

Intelligent documentation assistant using RAG with Ollama, ChromaDB, and FastAPI

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages