179 questions
No questions match those filters.
How would you implement Agentic RAG with LangGraph? Des...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansThe graph has five functional nodes: retrieve pulls candidates from the vector store, grade_docs scores each one as relevant or not, generate produces the answer from whatever survived grading, rewrite reformulates the query when grading came back weak, and web_search is the fallback when nothing in the index was relevant at all.
The interesting part is the edges: retrieve flows into grade_docs, which then branches conditionally — all relevant goes to generate, some irrelevant triggers rewrite (which loops back to retrieve with a better query), and none relevant routes to web_search before falling through to generate. That rewrite-to-retrieve loop is the piece that actually earns the word “agentic” — it’s where the system notices a bad retrieval and corrects course instead of pushing forward regardless.
State needs to carry the question, the accumulated documents, the current generation, and a retry counter, because that loop needs a hard stop: past three or so retries, force generation regardless of grading rather than looping indefinitely. Checkpointing state after every node (to Postgres or similar) is what makes this production-viable rather than a demo — a crash during grading resumes from grading, not from the top of the graph.