← Back to portfolio

Machine Learning Project

Document-Grounded RAG QA Assistant

Retrieval, grounded generation, citation control, and evaluation.

Overview

MeChatBot is a document-grounded RAG QA assistant that answers questions strictly from a Markdown knowledge base and refuses to answer when the evidence is insufficient. It was built to help engineers and reviewers query legacy documentation without wading through raw files, while keeping every answer traceable back to a source document.

Architecture

Offline knowledge & indexing: Markdown documents (data/docs/*.md) act as the single source of truth. An ingestion pipeline (ingest.py) chunks documents, attaches metadata (doc_id, title, section, timestamps, category), embeds each chunk with OpenAI or Ollama embeddings, and stores them in Chroma, supporting incremental updates so only new documents need to be re-embedded.

Online serving: A Gradio UI collects the question and displays the answer with citations. LangGraph orchestrates the workflow — state management and conditional branching between retrieval paths (Vector RAG via LlamaIndex + Chroma, or Graph RAG via Neo4j). The retrieval layer fetches top-k relevant context, and the LLM layer (local Ollama or production OpenAI API) generates the final grounded response.

Design principles (SELF-RAG & CRAG-inspired)

Problems solved

Pain pointRoot causeStatus
Unclear source / missing citationGrounding failure, lack of traceabilitySolved
Content not present in the documentHallucination, generation driftPartially solved
Missing info in long documentsRetrieval missSolved
Answer drifts from provided evidenceUngrounded answerSolved
Conflicting answers across document versionsConflict, ambiguityOpen — planned GraphRAG conflict resolution
Confident but wrong answersLack of uncertainty handlingPartially solved (low temperature + abstention)

Results

On a demo question set spanning unclear-source, hallucination, retrieval-miss, and grounding-failure cases, MeChatBot correctly abstained on out-of-scope questions ("When is Eunbi Yoon's birthday?" → cannot answer) while answering in-scope questions with citations (e.g., "What is MeChatBot's main technique?" → LlamaIndex / LangGraph / Chroma).

Key learnings

Code

github.com/EunbiYoon/meChatBot

Tech stack

LlamaIndex, Chroma, Neo4j (optional Graph RAG), LangGraph, Gradio, OpenAI API / Ollama