Skip to content

ye-tambatra/devpulse-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevPulseAI

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.

What It Is For

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.

Tech Stack

  • 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-genai for LLM responses
  • Hugging Face Inference API through huggingface-hub for 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

Features

  • Upload .md, .markdown, and .pdf documentation 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/docs on 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.

API Endpoints

  • 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 message and optional session_id.
    • Creates a session automatically when session_id is omitted.
    • Returns the answer, session id, and source document chunks.

Swagger UI is available at:

http://localhost:8000/docs

Environment

Create a local environment file:

cp .env.example .env

Then fill in:

GOOGLE_API_KEY=your-gemini-api-key
HUGGINGFACEHUB_API_TOKEN=your-hugging-face-token

For local development from your machine, keep these values:

DATABASE_URL=postgresql+psycopg://devpulse:devpulse@localhost:5432/devpulse
CHROMA_HOST=localhost
CHROMA_PORT=8001

Inside Docker, the Compose file provides service networking for the API container.

Run In Development

Start Postgres and ChromaDB:

docker compose up -d postgres chromadb

Create and activate a virtual environment:

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Run the API locally:

uvicorn app.main:app --reload

Open:

http://localhost:8000/docs

Run With Docker

Run the full stack:

docker compose up --build

This starts:

  • FastAPI app on localhost:8000
  • Postgres on localhost:5432
  • ChromaDB on localhost:8001

Testing

Run the test suite:

pytest -q

The test_docs/ directory contains small Markdown files that can be used for upload and retrieval testing.

About

DevPulseAI is a FastAPI-based RAG system that turns developer documentation into a queryable knowledge base. It lets you upload Markdown or PDF files, stores them as vector embeddings, and enables session-based chat to retrieve context-aware answers with source references using LLMs and semantic search.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors