Skip to content

Feature Request : New Notebook for Self-Correcting RAG Agent with LangGraph and OpenVINO #3240

@Ashitpatel001

Description

@Ashitpatel001

The repository's current RAG examples follow a linear execution path. these pipelines work well for straightforward queries, but they are not robust; if the retrieval step retrieves irrelevant documents, the model frequently imagines an answer.

Although loops and self-correction are used in modern "Agentic" workflows to address this, there isn't yet a specific tutorial that shows how to integrate LangGraph with OpenVINO.

Suggested Plan of Action

I suggest creating a new notebook called notebooks/llm-agent-langgraph/llm-agent-langgraph.ipynb.

The goal is to create a Self-Correcting RAG Agent that can grade the relevance of documents it retrieves and, if needed, rewrite its own search queries.

  1. State Management: Using LangGraph to maintain the conversation state is one of the key technical concepts.
  2. Conditional Logic: Using an OpenVINO-optimized LLM, a "Grader" node is implemented to determine whether the retrieval context is adequate.
  3. Cyclic Execution: The agent loops back to rewrite the query and re-retrieve if there is not enough context.
  • Orchestration: langgraph, langchain
  • Model: Llama-3 or Phi-3 (via optimum-intel / openvino-genai)
  • Database: either Chromadb or Faiss

Value to Community

  • Demonstrates capability of OpenVINO-optimized models to handle complex, multi-step agentic reasoning (not just single-turn generation).
  • Provides a template for developers looking to build "Compound AI Systems" on Intel hardware

I am interested in implementing this notebook. Could you please assign this issue to me? I aim to have a Draft PR ready for review soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PSEEscalate to PSE for further investigateenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions