DevPulseAI is a FastAPI RAG API for developer documentation.
It lets teams upload Markdown or PDF docs, store them as reusable vector embeddings, and ask questions about implementation details, code patterns, and architecture decisions. Chat is session-based, so follow-up questions can use previous conversation context.
DevPulseAI is useful when engineering knowledge is spread across internal docs, architecture notes, onboarding guides, and project-specific Markdown files. Instead of manually searching those files, developers can query the API and get an answer with the source chunks used to produce it.
The project is intentionally small and direct: FastAPI handles the API layer, Postgres stores document/session metadata, ChromaDB stores vectors, Hugging Face provides remote embeddings, and Gemini handles the LLM response.
- Python 3.12
- FastAPI and Uvicorn for the API server
- LangChain for chat model integration, vector store integration, and text splitting
- Gemini through
langchain-google-genaifor LLM responses - Hugging Face Inference API through
huggingface-hubfor remote embeddings - ChromaDB for vector storage
- Postgres for document metadata, chat sessions, and message history
- SQLAlchemy and Psycopg for database access
- Docker Compose for local infrastructure
- Pytest for regression tests
- Upload
.md,.markdown, and.pdfdocumentation files. - Embed documents through the remote Hugging Face Inference API.
- Store vectors in ChromaDB so files are not re-embedded on every run.
- Track file checksums in Postgres to skip unchanged documents.
- Ingest existing files from
data/docson startup. - Query documentation through a session-based chat endpoint.
- Store chat sessions and message history in Postgres.
- Return source document chunks with every chat response.
- Explore and test endpoints through FastAPI Swagger UI.
-
POST /upload- Accepts a multipart file upload.
- Saves the file, extracts text, chunks it, embeds it, and stores vectors.
- Skips recomputation when the same checksum is already embedded.
-
POST /chat- Accepts a
messageand optionalsession_id. - Creates a session automatically when
session_idis omitted. - Returns the answer, session id, and source document chunks.
- Accepts a
Swagger UI is available at:
http://localhost:8000/docs
Create a local environment file:
cp .env.example .envThen fill in:
GOOGLE_API_KEY=your-gemini-api-key
HUGGINGFACEHUB_API_TOKEN=your-hugging-face-tokenFor local development from your machine, keep these values:
DATABASE_URL=postgresql+psycopg://devpulse:devpulse@localhost:5432/devpulse
CHROMA_HOST=localhost
CHROMA_PORT=8001Inside Docker, the Compose file provides service networking for the API container.
Start Postgres and ChromaDB:
docker compose up -d postgres chromadbCreate and activate a virtual environment:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtRun the API locally:
uvicorn app.main:app --reloadOpen:
http://localhost:8000/docs
Run the full stack:
docker compose up --buildThis starts:
- FastAPI app on
localhost:8000 - Postgres on
localhost:5432 - ChromaDB on
localhost:8001
Run the test suite:
pytest -qThe test_docs/ directory contains small Markdown files that can be used for upload and retrieval testing.