Skip to content

Repository files navigation

Intelligent RAG

Intelligent RAG is a production-ready retrieval-augmented generation platform for building accurate, evidence-grounded AI experiences. It turns trusted knowledge into ranked, traceable evidence and generates answers that remain connected to their sources.

Why Intelligent RAG

Great RAG is more than finding a nearby passage. Intelligent RAG treats retrieval quality, evidence integrity, and operational confidence as first-class product capabilities.

  • High-quality retrieval combines complementary search signals to find relevant evidence across varied language and document structure.
  • Grounded answers are generated from a bounded evidence set with validated citations.
  • Traceable results preserve source identity and provenance from ingestion through the final response.
  • Intelligent query planning supports direct questions, conversational follow-ups, and complex questions that benefit from decomposition.
  • Semantic reranking prioritizes the evidence most useful for answering the original question.
  • Deterministic ingestion produces stable chunks and avoids unnecessary reprocessing when content has not changed.
  • Safe document replacement keeps the previously indexed version intact until a complete replacement is ready.
  • Metadata-aware retrieval narrows results with exact-match business attributes.
  • Measurable quality evaluates retrieval modes with established information-retrieval metrics and comparison reports.
  • Operational visibility provides health checks, diagnostics, and telemetry across the RAG lifecycle.

What it does

Intelligent RAG provides a complete knowledge-to-answer workflow:

  1. Organizes trusted content into collections.
  2. Parses and normalizes source documents.
  3. Creates structure-aware, retrieval-ready chunks.
  4. Indexes content for semantic and lexical discovery.
  5. Plans the best retrieval strategy for each question.
  6. Retrieves and reranks the strongest supporting evidence.
  7. Assembles a bounded, source-traceable context.
  8. Returns ranked evidence or a grounded answer with validated citations.
  9. Measures retrieval quality across repeatable evaluation datasets.

Ideal for

  • internal knowledge assistants;
  • policy and compliance search;
  • support and operations copilots;
  • research and document intelligence;
  • grounded enterprise question answering;
  • reusable RAG foundations for .NET applications.

Retrieval strategies

Intelligent RAG handles several query shapes through one consistent interface:

  • Direct retrieval for complete, standalone questions.
  • Conversational rewrite for follow-up questions that depend on prior context.
  • Query decomposition for multi-part questions requiring evidence from several topics.

Every strategy produces an explicit query plan and a first-class retrieval result, making the system observable and straightforward to evaluate.

Evidence-first answers

Retrieval results remain useful independently of answer generation. Each result includes ranked hits, assembled evidence, source provenance, and diagnostics. When an answer is requested, Intelligent RAG uses that same evidence set and validates its citations before returning the response.

This evidence-first design makes answers easier to inspect, applications easier to debug, and retrieval quality easier to improve.

Quality evaluation

The included evaluation workflow compares:

  • lexical retrieval;
  • dense retrieval;
  • hybrid fusion;
  • hybrid fusion with semantic reranking.

Reports include Recall@K, Mean Reciprocal Rank, nDCG, latency percentiles, per-tag results, failure classification, side-by-side mode comparisons, and reranker candidate-order diagnostics.

Quick start

Prerequisites

  • .NET 10 SDK
  • Docker with Compose
  • Gemini API key

Configure the provider key

PowerShell:

$env:GEMINI_API_KEY = "<your-gemini-api-key>"

Bash:

export GEMINI_API_KEY='<your-gemini-api-key>'

Start and verify

docker compose up -d postgres
dotnet restore
dotnet build --no-restore
dotnet test --no-build --no-restore
dotnet run --project src/IntelligentRag.Api

The API applies its database migrations at startup and exposes readiness and liveness checks for operational verification.

Documentation

The Intelligent RAG User Guide provides the complete setup, ingestion, retrieval, grounded-answer, evaluation, and operations walkthrough.

License

Copyright © 2026. All rights reserved. See LICENSE.

About

A .NET framework for hybrid retrieval, query planning, semantic reranking, cited answers, and RAG evaluation with PostgreSQL and pgvector.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages