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的更多文章

  • Building a Text-to-Speech(TTS) Application Using OpenAI and LangChain

    Building a Text-to-Speech(TTS) Application Using OpenAI and LangChain

    Introduction Text-to-speech (TTS) technology has significantly evolved. It allows machines to generate human-like…

  • Speech to text(STT) using whisper and langchain

    Speech to text(STT) using whisper and langchain

    Here you learn how to convert Speech to Text using Whisper an OpenAI speech transcribing model. Code link: https://lnkd.

  • Demonstrate the use of conditionals in LangGraph

    Demonstrate the use of conditionals in LangGraph

    Use case: Symptoms and diagnosis Medical chatbot Document retrieval is presented to the doctor for further analysis…

    2 条评论
  • A simple agent using LangGraph with RAG context and web search

    A simple agent using LangGraph with RAG context and web search

    Aim: To create a study assistant that can help in the preparation, notes, cheat sheets, guides, and much more. Along…

    1 条评论
  • An introduction to LangGraph

    An introduction to LangGraph

    What is LangGraph? LangGraph is a Python-based framework that enables developers to create sophisticated, multi-step…

  • Langchain Tools and Agents use cases with examples

    Langchain Tools and Agents use cases with examples

    These 2 articles will give you some context What is LangChain? Vector Database & Langchain? What is LangChain? A…

    3 条评论
  • Vector Databases and LangChain

    Vector Databases and LangChain

    A vector database stores and queries high-dimensional vectors, representing data points in a mathematical space. Unlike…

    5 条评论
  • Using Few-Shot Prompts with Langchain and OpenAI API in Real-World Applications

    Using Few-Shot Prompts with Langchain and OpenAI API in Real-World Applications

    Refer for a deeper understanding of prompts and Langchain A python code sample to create Multiple choice questions for…

社区洞察

其他会员也浏览了