Cookies

With your permission, we use Google Analytics cookies to measure visits and improve the site. Necessary cookies are always on. You can change your choice or withdraw consent anytime in the footer, under Cookie settings. Cookie Policy

Skip to content

RAG and Knowledge ·Intermediate

Corrective RAG Agent

About this app

A sophisticated Retrieval-Augmented Generation (RAG) system that implements a corrective multi-stage workflow using LangGraph. This system combines document retrieval, relevance grading, query transformation, and web search to provide comprehensive and accurate responses.

  • Complete open-source code
  • Step-by-step tutorial

Technical sheet

Category
RAG and Knowledge
Difficulty
Intermediate
Models
OpenAI, Claude, Gemini
Frameworks
LangChain
Runs locally?
Needs cloud APIs
Required keys
None

License Apache-2.0 · content curated and maintained by Doutor AI.

Full tutorial

A sophisticated Retrieval-Augmented Generation (RAG) system that implements a corrective multi-stage workflow using LangGraph. This system combines document retrieval, relevance grading, query transformation, and web search to provide comprehensive and accurate responses.

Features

  • Smart Document Retrieval: Uses Qdrant vector store for efficient document retrieval
  • Document Relevance Grading: Employs Claude 4.5 sonnet to assess document relevance
  • Query Transformation: Improves search results by optimizing queries when needed
  • Web Search Fallback: Uses Tavily API for web search when local documents aren't sufficient
  • Multi-Model Approach: Combines OpenAI embeddings and Claude 4.5 sonnet for different tasks
  • Interactive UI: Built with Streamlit for easy document upload and querying

How to Run?

  1. Clone the Repository:
git clone https://github.com/Shubhamsaboo/awesome-llm-apps.git
cd rag_tutorials/corrective_rag
  1. Install Dependencies:
pip install -r requirements.txt
  1. Set Up API Keys:

You'll need to obtain the following API keys:

  1. Visit Qdrant Cloud
  2. Create an account or sign in
  3. Create a new cluster
  4. Get your credentials:
  • Qdrant API Key: Found in API Keys section
  • Qdrant URL: Your cluster URL (format: https://xxx-xxx.aws.cloud.qdrant.io)
  1. Run the Application:
streamlit run corrective_rag.py
  1. Use the Application:
  • Upload documents or provide URLs
  • Enter your questions in the query box
  • View the step-by-step Corrective RAG process
  • Get comprehensive answers

Tech Stack

  • LangChain: For RAG orchestration and chains
  • LangGraph: For workflow management
  • Qdrant: Vector database for document storage
  • Claude 4.5 sonnet: Main language model for analysis and generation
  • OpenAI: For document embeddings
  • Tavily: For web search capabilities
  • Streamlit: For the user interface

From the same category

RAG and KnowledgeIntermediate

Agentic RAG Embedding Gemma

This Streamlit app demonstrates an agentic Retrieval-Augmented Generation (RAG) Agent using Google's EmbeddingGemma for embeddings and Llama 3.2 as th…

  • Llama
  • local
RAG and KnowledgeIntermediate

Agentic RAG with GPT-5

An agentic RAG application built with the Agno framework, featuring GPT-5 and LanceDB for efficient knowledge retrieval and question answering.

  • OpenAI

Need a tailor-made solution?

Not sure where to start with AI in your business? Get a free assessment and a tailored plan - no commitment.

Save hours every week with AI, no hassle

Doutor AI gives you 1,859 ready-to-copy AI prompts, by industry and in plain English - plus a complete technical library for those who want to go further.

See plans