LangChain Talk
LangChain Talk
Lance Martin
Software Engineer, LangChain
@RLanceMartin
LangChain makes it as easy as possible to develop LLM-powered applications.
Platform (LangSmith) and Library (LangChain)
Platform
(Debug, Test, Monitor)
LangSmith Blog
Building Blocks
Document Loaders: > 140 Integrations Document
Loaders
Unstructured Structured
Public
Integrations hub
Text splitters Document
Transformers
Playground
Beyond basic splitting: Context-aware splitting, Function calling (Doctran) Document
Transformers
Code:
Def foo
Def foo(...): for section in sections:
for section in sections: sect = section.find("head")
sect = section.find("head")
Markdown:
Introduction
# Introduction Notion templates are effective . . .
Notion templates are effective . . .
PDF:
Abstract
Abstract
The dominant sequence The dominant sequence . . .
transduction models . . .
Document Loaders
(> 140 Integrations)
Vector Storage
(> 40 Integrations)
Document
Transformers
(e.g., Text Splitters, OAI functions)
Embeddings
(> 30 Integrations)
Hosted or Private vectorstore + embeddings Embeddings
Document +
Storage
Transformers
Embeddings
Vector Storage
GPT4All embeddings
> 60 LLM integrations LLM
Document Loaders
(> 140 Integrations)
Vector Storage
(> 40 Integrations)
Document
Transformers LLMs
(e.g., Text Splitters, OAI functions)
(> 60 Integrations)
Embeddings
(> 30 Integrations)
LLM landscape LLM
Performance GPT-4 SOTA (best overall) Claude-2 getting closer to GPT4 70b on par w/ GPT-3.5-turbo*
Math
Language
Code
OSS models can run on device (private) LLM
Ollama, Llama.cpp
Integrations Hub
Integrations hub
Use Cases
RAG: Load working memory w/ retrieved information relevant to a task RAG
URLs
PDFs
Relevant
Prompt
Splits
Documents Splits LLM Answer
Database Query
Question
Abstraction / Simplicity
VectorstoreIndexCreator Answer
RetrievalQA Answer
Relevant
Splits Answer
Load_QA_chain
Trace
Prompt
Retrieved docs
Question
Response
LangSmith trace
Chat: Persist conversation history Chatbots
Retrieval (Optional)
Memory
Prompt
Chat history
Response
Final
Stuff document in context window Summary
Fits in LLM
context window
Prompt
Extract final summary LLM
from input list
Document Loader
Embed-and-cluster
Summarize each cluster
Prompt Cluster
Summarize themes in LLM Summaries
the group of docs
Prompt Prompt
Summarize themes in LLM Summary Extract final summary LLM
the group of docs from input list
Summarized themes from LangChain questions using different methods and LLMs
User Questions
(Thousands)
Blog Post
Extraction: Getting structured output from LLMs Extraction
Input
Alex is 5 feet tall. Claudia is 1 feet taller Alex and jumps higher
than him. Claudia is a brunette and Alex is blonde.
"name": "information_extraction",
"description": "Extracts information from the passage.",
"parameters": {schema}
Prompt
Response
LangSmith Trace
Text-to-SQL SQL
Query
Prompt
Response
Chat Chains
Yes
ConversationalRetrievalChain
Agents
Access to memory
No Yes
Access to tools
Large agent ecosystem (will focus on ReAct as one example) Agents
Short-term Long-term
(Buffers) (> 40 vectorstores)
Action
Tools
(> 60 tools + toolkits)
Memory
Agents Simulation
(> 15 agent types)
Autonomous
Tools Agent Plan
LLMs
(> 60 integrations)
Action
Agents
No
No Yes
Multi-Step Reasoning
*Condition LLM to show its work
LangSmith trace for SQL ReAct agent Agents
Prompt
Tool / action
Observation
Uses tool at
next step
Response
(Chain-of-thought) reasoning
LangSmith trace
Case-study on reliability: Web researcher started an agent, retriever was better Agents
Document
Document Loader Document Retrieval + QA
Transformation
HTML
pages
Query 1
Vector Retrieved
Storage Chunks
Research Query 2 LLM Answer
Question LLM
Query N
Blog Post
Case-study on reliability: Web researcher started an agent, retriever was better Agents
Correct
Save to dataset
Cookbook, Docs
LangSmith: Tracing and evaluation
Re-deploy
Cookbook, Docs
Questions