Multi-Stage RAG System
Document Ingestion & Semantic Vector Retrieval Engine
Standard LLMs hallucinate when asked domain-specific questions about private documents, while naive keyword search fails to capture semantic meaning when queries and texts do not share identical vocabulary.
Must ingest heterogeneous document formats (PDF, DOCX, PPTX), preserve semantic context across chunk boundaries, and retrieve relevant passages with high-dimensional vector precision without hallucinating.
Built a production-grade Retrieval-Augmented Generation (RAG) system with a multi-stage pipeline: automated document parsing with metadata extraction, semantic text chunking (~2200 chars with 350-char overlap), and instruction-based high-dimensional vector search using the BGE-large-en-v1.5 embedding model.
Addis Entrance Hub: Dual-Channel Delivery Topology
High-concurrency web and Telegram MTProto microservices over MySQL transactional persistence
Student requests from low-bandwidth mobile devices ingress through either the web interface or lightweight Fastify Telegram bot. Requests route through custom PHP controllers, querying an in-house AI Gateway for instant tutoring explanations and persisting test session attempts into normalized MySQL tables.
Extracted clean normalized text, subjects, and page metadata across PDFs (PyMuPDF), DOCX (python-docx), and PPTX (python-pptx).
Chunked text into ~2200-character segments with a 350-character sliding overlap, guaranteeing continuous context preservation across document sections.
Employed the state-of-the-art BGE-large-en-v1.5 model with query instruction prefixing ('Represent this sentence for searching relevant passages:') for high-accuracy semantic retrieval.