Add self-correcting RAG agent notebook with LangGraph#3330
Add self-correcting RAG agent notebook with LangGraph#3330LuciferDono wants to merge 3 commits intoopenvinotoolkit:latestfrom
Conversation
Implements a new notebook demonstrating a self-correcting RAG pipeline using LangGraph state machine with four nodes: retrieve, grade documents, generate answer, and rewrite query. Uses Phi-3-mini with INT4 compression via OpenVINO for efficient inference on Intel hardware. Closes openvinotoolkit#3240
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
@LuciferDono, thanks for the contribution! I tried running the notebook locally and hit an error during model conversion with optimum-cli. Could you please share the full conversion log from a successful run on your side? Also, which versions of optimum-intel and openvino did you use? |
|
Hey @aleksandr-mokrov, sorry about the wait. I hit the same conversion error on my end and have been debugging it. Found a few issues in the notebook. Fixing them up and running a clean test now. Will reply here with the full conversion log and the exact openvino/optimum-intel versions once it goes through. |
Switch to cmd_helper.optimum_cli() for conversion, use HuggingFacePipeline.from_model_id(backend="openvino") for model loading, pin package versions, add device_widget and telemetry.
|
Pushed the fix and tested on Colab (Intel Xeon, Python 3.12). Everything runs through now. Versions: openvino 2026.1.0, optimum-intel from git HEAD, nncf 3.0.0, transformers 4.53.3, torch 2.8.0+cpu Main things I changed; switched to |
|
hey @aleksandr-mokrov, just checking in, did the fix work on your end? let me know if you need anything else from me.
|
Summary
Adds a new notebook
notebooks/llm-agent-langgraph/llm-agent-langgraph.ipynbimplementing a self-correcting RAG agent using LangGraph and OpenVINO.The notebook demonstrates a stateful RAG pipeline that goes beyond linear retrieve-then-generate by adding:
Key features
Files added
notebooks/llm-agent-langgraph/llm-agent-langgraph.ipynbnotebooks/llm-agent-langgraph/README.mdCloses #3240