RAG

LangChain convenience functions

create_stuff_documents_chain

Creates a chain that takes a list of documents as context. The documents are passed as a context. The prompt must have the input_variable {context}

create_retrieval_chain

Creates a basic retriever chain. Reuires a retriever object that is used for getting the context with input. The prompt must have an input_variable named {input}

create_history_aware_retriever

This creates a retriver object that takes the conversation history and user query as input. It uses an LLM to create an appropriate input for the retriever. The LLM generated query is then used to fetch the documents from the retrieval system.

IMAGE PLACEHOLDER

create_sql_query_chain

Used for relational database based retrieval systems. The chain created with this function uses the get_table_info to get the schema for the table and generates a SQL statement. This chain MUST be used carefully as the generated SQL may be harmful.

References

Retriever challenges

Advanced retrievers

LangChain advanced retrievers

Reciprocal Rank Fusion

Agents

Arxiv : The Rise and Potential of Large Language Model Based Agents: A Survey

Autonomous Agents (Blog)