LangGraph connected to a RAG
Sushma Rao
Expert Vetted freelancer on Upwork(Top 1%) | Backend & GenAI | Langchain Langgraph LLM| AI ML development/Automation | Algorithms expert| Cloud development I help clients get more business through software development
Go through the introduction to LangGraph if you do not know what LangGraph is!
The LangGraph loops multiple times to get you great answers. I have a visualization of the calls made. Read till the end to find out!
Use case: Create a study plan based on the context
The context is here https://github.com/sushmasush/langGraph/blob/main/data/BinarySearchTrees.pdf The book “Introduction to Algorithms by ?Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein.
Github link https://lnkd.in/gTkkEreK
Step 1: Create embeddings & store them in vector DB
Step 2: Create the RAG context tool
Step 3: Initialize any LLM model and bind the tool
Step 4: Define the graph nodes
Step 5: Create the graph
Step 6: Compile the graph and visualize
Step 7: Query
Query 1: "I want to learn about binary search trees. Can you give me a study plan based on the topics to study along with the time required"
The model responds with a study that requires 50 hours
Query 2: “I want to learn about binary search trees. I have 8 hours allocated for this preparation. I can give 2 hours per day. Can you give me a study plan based on the topics to study in 8 hours”
When requested for a shorter study plan, It comes up with one.
Query 3: “Thanks! Can you create a cheat sheet for traversal mechanisms”
It presents me with the cheat sheet for BST traversals.
See how LangGraph makes multiple calls to get a reasonable answer
View the entire article here: https://wp.me/pccXal-AG
Please view my portfolio here: https://wp.me/PccXal-wv