Iteria is an agentic Retrieval-Augmented Generation (RAG) system that improves its responses through iterative self-correction. Instead of returning the first generated answer, Iteria evaluates, refines, and verifies responses to ensure they are grounded in retrieved data.
This project is developed as part of the Python for Engineers course. It is built by a team of four members as a course project (CP), focusing on practical system design and intelligent backend architecture.
Traditional RAG systems often:
- Retrieve irrelevant or incomplete context
- Generate partially correct answers
- Hallucinate unsupported information
Iteria addresses these issues by introducing a feedback-driven reasoning loop.
Iteria does not trust its first answer.
Instead, it:
- Retrieves relevant context
- Generates an initial answer
- Critiques the answer based on defined criteria
- Refines the query if needed
- Repeats the process (limited iterations)
- Returns a validated response
User Query
↓
Retrieve Context
↓
Generate Answer (Draft)
↓
Critic Evaluation
↓
[If Good] → Return Answer
↓
[If Not]
→ Refine Query
→ Retrieve Again
→ Generate Again
→ Repeat (max 3 iterations)
Fetches relevant document chunks using vector similarity search.
Generates answers using retrieved context.
Evaluates the answer based on:
- Groundedness (is it supported by data?)
- Completeness (does it fully answer the query?)
- Relevance (is it aligned with the question?)
Refines the query based on critic feedback to improve retrieval quality.
Performs additional checks for hallucination or unsupported claims.
- Grounded Responses — answers must be based on retrieved data
- Iterative Improvement — responses improve over multiple passes
- Controlled Looping — limited retries to maintain efficiency
- Explainability — system behavior is observable and traceable
- Python
- FastAPI
- Vector Database (ChromaDB / Pinecone)
- LLM (Gemini Developer API via google-genai)
This project uses uv for dependency management.
Note: the rag extra depends on spaCy, which currently supports Python 3.10–3.13 (not 3.14).
uv sync
uv run uvicorn interfaces.fastapi.app:app --reload --port 8000If your system Python is 3.14, install/use Python 3.13 with uv:
uv python install 3.13
uv venv --python 3.13
uv sync --extra ragOpen:
http://127.0.0.1:8000/docs
uv sync --extra llm
$env:GEMINI_API_KEY = "YOUR_KEY"See docs/llm-integration.md for full configuration.
- Core engine architecture:
docs/core-architecture.md - API endpoints:
docs/endpoints.md - LLM integration:
docs/llm-integration.md - Memory (single session):
docs/memory.md - Module ownership:
docs/module-ownership.md
- Iterative self-correction loop
- Critique-driven query refinement
- Context-grounded answer generation
- Modular and extensible architecture
- Ishan Kulkarni
- Om Kesti
- Keshav Kothare
- Shreyas Madake
- Advanced hallucination detection
- Better retrieval ranking strategies
- UI for visualizing reasoning steps
- Domain-specific optimization
- Multi-user memory with persistence
Iteria demonstrates how adding feedback and iteration to a RAG pipeline can significantly improve answer quality, making it more reliable and closer to real-world intelligent systems.