Skip to content
 
 

Repository files navigation

Iteria

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.


📌 Project Context

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.


🧠 Problem Statement

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.


🚀 Key Idea

Iteria does not trust its first answer.

Instead, it:

  1. Retrieves relevant context
  2. Generates an initial answer
  3. Critiques the answer based on defined criteria
  4. Refines the query if needed
  5. Repeats the process (limited iterations)
  6. Returns a validated response

🔁 System Flow

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)

🧩 Core Components

1. Retriever

Fetches relevant document chunks using vector similarity search.

2. Generator

Generates answers using retrieved context.

3. Critic (Core Logic)

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?)

4. Query Rewriter

Refines the query based on critic feedback to improve retrieval quality.

5. (Optional) Verifier

Performs additional checks for hallucination or unsupported claims.


🎯 Design Principles

  • 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

⚙️ Tech Stack (Planned)

  • Python
  • FastAPI
  • Vector Database (ChromaDB / Pinecone)
  • LLM (Gemini Developer API via google-genai)

📦 Package Manager (uv)

This project uses uv for dependency management.

Note: the rag extra depends on spaCy, which currently supports Python 3.103.13 (not 3.14).

uv sync
uv run uvicorn interfaces.fastapi.app:app --reload --port 8000

If 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 rag

Open:

  • http://127.0.0.1:8000/docs

LLM quick start (Gemini)

uv sync --extra llm
$env:GEMINI_API_KEY = "YOUR_KEY"

See docs/llm-integration.md for full configuration.


📚 Docs

  • 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

📊 Features

  • Iterative self-correction loop
  • Critique-driven query refinement
  • Context-grounded answer generation
  • Modular and extensible architecture

👥 Team

  • Ishan Kulkarni
  • Om Kesti
  • Keshav Kothare
  • Shreyas Madake

📎 Future Improvements

  • Advanced hallucination detection
  • Better retrieval ranking strategies
  • UI for visualizing reasoning steps
  • Domain-specific optimization
  • Multi-user memory with persistence

📝 Summary

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.


About

Iteria is an agentic Retrieval-Augmented Generation (RAG) system that improves its responses through iterative self-correction.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages