An advanced RAG system with a self-correction layer that evaluates the quality of retrieved documents before generating answers — minimizing hallucinations and improving accuracy. Built around Ancient Egyptian history as a knowledge domain, demonstrating reliable AI over specialized, niche content.
Key highlights:
- LLM-based document evaluator that classifies retrieved chunks as Correct, Ambiguous, or Incorrect
- Automatic query rewriting triggered when retrieval quality is insufficient
- Semantic chunking with sliding window fallback and spaCy-based knowledge refinement
- Tavily Search API fallback when local knowledge base is insufficient
- Deployed live on Hugging Face Spaces
Source code: https://github.com/SaraaE...