<ARYA/>
← All projects

2025

LLQP Study Assistant RAG System

Agentic RAG chatbot for Canadian insurance exam preparation

PythonFastAPIPostgreSQLQdrantOpenAI APIRAGLLMVector SearchReactDockerTelegram Bot APIAlembic

Overview

An agentic RAG system for candidates studying for the LLQP, the Canadian life insurance licensing exam. It ingests the official study PDFs, embeds them into a Qdrant vector database, and answers exam questions with a citation back to the source. A web chat widget and a Telegram bot run off the same pipeline.

The Problem

LLQP study material spans several dense PDFs with no index worth using, so candidates hunt by hand for a rule or a definition. I wanted an assistant that answers any LLQP question from the official material and nothing outside it, with the source attached.

My Role

Designed and built the system end to end: schema, document ingestion, chunking and embedding, retrieval logic, prompt design, and both interfaces. Still iterating on chunk quality and retrieval accuracy.

Key Features

  • PDF ingestion pipeline: extraction, cleaning, chunking, and batch upload with per-file error handling
  • OpenAI embeddings stored in Qdrant with semantic vector search and relevance scoring
  • Agentic RAG pipeline: retriever → prompt builder → LLM → cited response
  • Source citations on every answer: document name, page number, similarity score
  • Web chat widget (React + Vite) connecting to the FastAPI backend
  • Telegram bot sharing the same RAG pipeline, with Telegram-formatted plain-text output
  • Conversation history stored in PostgreSQL with per-session context retention
  • Health check endpoints for backend, database, and Qdrant collection status
  • Docker Compose setup for the local development stack and production deployment
  • Debug mode exposing retrieved chunk details for pipeline inspection and tuning

Challenges

LLQP material mixes dense regulatory text with scenario examples, and fixed-size chunks cut straight through both in ways that wreck retrieval. Right now I'm working on chunk boundaries, overlap, and re-ranking for questions that span more than one concept.

What I Learned

In the next version I chunk along the document structure, the headings and the definitions, instead of picking a token size first and tuning it afterwards.