Project case study · AI/ML Engineer · Software Engineer

Northstar RAG System

An independently built, end-to-end hands-on RAG engineering project for grounded retrieval, citation-backed answers, strict refusals, evaluation, testing, and Docker delivery.

My role

I independently built the complete ingestion, retrieval, generation, evaluation, testing, and deployment workflow.

Technologies

  • Python
  • FastAPI
  • LangChain text splitters
  • sentence-transformers
  • Chroma
  • RAGAS
  • pytest
  • Docker

Overview

Northstar answers questions over a small internal-document corpus while keeping each answer tied to retrieved evidence. The goal was to demonstrate the complete engineering path from document ingestion to an API response a reader can verify.

Challenge

The service must refuse questions the indexed documents do not support. It also needs citations that identify the source document, page, and chunk instead of returning unsupported prose.

My role

I independently built the project end to end: ingestion, chunking, embeddings, vector storage, retrieval filters, grounded generation, citations, refusal behavior, evaluation, automated tests, and Docker packaging.

What I built

I exposed health and question-answering endpoints with FastAPI and Uvicorn, extracted PDFs with PyMuPDF, created chunks with LangChain text splitters, generated local embeddings with all-MiniLM-L6-v2, and persisted vectors in Chroma. Docker and Docker Compose package the API and its data volumes.

Architecture

Document sources are ingested and chunked, embedded locally, filtered through persistent retrieval, and supplied to grounded generation with citations or refusal. Relationships: Document sources to Ingest and chunk; Ingest and chunk to Local embeddings; Local embeddings to Chroma retrieval; Chroma retrieval to Grounded answer.

PDF / TXT / Markdown → clean text → recursive chunks → local embeddings → persistent Chroma → filtered retrieval → grounded prompt → answer + citations

The default pipeline uses 700-character chunks with 100-character overlap, retrieves the nearest candidates, and rejects chunks beyond a configurable cosine-distance threshold.

Results

The delivered system demonstrates grounded retrieval, source-level citations, deterministic refusal when evidence is insufficient, pytest coverage, and a RAGAS pipeline for faithfulness, answer relevancy, context precision, and context recall.

Lessons

The key engineering lesson was to make “I do not have enough evidence” part of the architecture. Retrieval thresholds, citations, and evaluation are product behavior, not optional additions after generation works.