02. Naive RAG

Naive RAG

step

  1. Perform Naive RAG

Preferences

Basic PDF-based Retrieval Chain creation

Here, we create a Retrieval Chain based on PDF documents. Retrieval Chain with the simplest structure.

However, LangGraph creates Retirever and Chain separately. Only then can you do detailed processing for each node.

First, use pdf_retriever to get your search results.

Pass the previously searched result to the context of the chain.

State definition

State : Defines the state of sharing between nodes and nodes in Graph.

Generally TypedDict Use format.

Node definition

  • Nodes : Nodes that handle each step. Usually implemented as a Python function. Input and output are state values.

Reference

  • State Updated after performing a defined logic with input State Returns.

Edges

  • Edges : Currently State Run next based on Node Python function to determine.

General edges, conditional edges, and more.

Visualize compa-like graphs.

Graph execution

  • config Parameters convey the necessary setting information when running the graph.

  • recursion_limit : Set the maximum number of recurses when running the graph.

  • inputs : Pass the required input information when running the graph.

Reference

Under stream_graph A function is a function that only streams certain nodes.

You can easily check the streaming output of a specific node.

Last updated