FM
Fabian Muoghalu
Back to Case Studies
AI / PythonPersonal / Technical Project2025

RAG Agent System

An end-to-end Retrieval-Augmented Generation system that allows users to query information contained within uploaded documents.

Technologies & Tools

PythonFastAPILangChainChromaDBLLM APIsVector Embeddings

Problem Statement

Language models do not automatically have access to private documents uploaded by users, and large documents can be difficult to search efficiently using traditional keyword matching.

Role & Contributions

Backend / AI Engineer. Designed and implemented document ingestion, processing, chunking, embedding, vector storage, semantic retrieval, and agent-driven multi-step querying.

System Architecture & Design

FastAPI backend integrated with LangChain and ChromaDB. Uploaded documents are parsed, chunked, and converted into embeddings stored in ChromaDB. Queries trigger semantic search and an iterative retrieval workflow looping up to 5 times if needed before producing a grounded response.

Key Engineering Decisions

  • 1.FastAPI: Selected for rapid, asynchronous Python API execution and automatic OpenAPI specification generation.
  • 2.ChromaDB Vector Store: Used as an efficient vector database for embedding storage and semantic similarity search.
  • 3.Multi-Step Agentic Retrieval: Allowed the agent to perform up to 5 retrieval calls if initial context is incomplete before generating a final answer.

Challenges Overcome

  • Ensuring the retrieval workflow dynamically selects appropriate functions and gathers sufficient context instead of relying on a single fixed retrieval call.
  • Optimizing document chunking boundaries to preserve semantic context across sections.

Lessons Learned

  • Multi-step retrieval loops significantly improve answer fidelity for complex questions across dense documents.
  • Grounding responses with explicit source attribution builds user trust and verification.

Results & Impact

  • Built complete RAG pipeline demonstrating ingestion, chunking, embeddings, vector storage, multi-step agentic retrieval, grounded AI responses, and source attribution.