LangGraph connected to a RAG

LangGraph connected to a RAG

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

View the response here

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.

View the response here

Query 3: “Thanks! Can you create a cheat sheet for traversal mechanisms”

It presents me with the cheat sheet for BST traversals.

View the response here

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


要查看或添加评论,请登录

Sushma Rao的更多文章

社区洞察

其他会员也浏览了