Skip to content

nandapg0204/langchain

Repository files navigation

Langchain Notes

Langchain is a development framework designed to streamline the creation of applications powered by Large Language Models (LLMs). It provides essential building blocks to simplify the development process.

L1-Model_prompt_parser

Prompt Templates : LangChain's prompt templates facilitate the creation of instructions for LLMs. This functionality is crucial for efficiently formatting, organizing, and reusing prompts across applications.

Output Parsers : LangChain's output parsers convert LLM completions into structured formats, enabling easier extraction and interpretation of meaningful information from model outputs.

L3-Memory

Every input to an LLM is stateless i.e. every interaction is independent and it does not remember any information from previous conversations.This could be problem if we want to build applications like Chatbots. Chatbots appear to have memory buffer by providing previous context as input along with each interaction. Langchain provides various functionalities to store, format and manipulate this memory buffer.

L3-Chains

Handling diverse queries needs multiple sequences of text processing and intergration. Langchain's chains helps for efficient stream line integration

L4-QnA

Integrating LLM applications with external documents such as PDFs, Web pages enhances their capabilities.Embedding models create vector representations of text, allowing efficient comparison and retrieval of similar content. Vector databases store these embeddings and associated text chunks.

When queried, the system embeds the query, compares it to stored vectors, and retrieves relevant text for the LLM.

Retrieval methods include:

1.Stuff : Simple, single call, limited by context length.

2.Map reduce : Parallel processing, summarizing responses, more calls required.

3.Refine : Iterative building of answers, slower.

4.Map rerank : Scores and ranks answers for relevance.

L5- Evaluations

Its really important to understand what really going in and coming out of each step. As LLM are good enough, we can use an LLM to evaluate our application. Langchain's functionalities help us to develop the uses cases to test and evaluate the reponses generated by LLM application.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published