SlideShare a Scribd company logo
The Document Engineering Company
LangChain Webinar: Lessons from
Deploying LLMs with LangSmith
Jean Paoli @jeanpaoli
Taqi Jaffri @tjaffri
Mike Palmer
Zubin Wadia @zubinwadia
Topics
1. Intros
2. Real-World Challenges using LLMs with Documents
i. Real documents are more than flat Text
ii. Documents are Knowledge Graphs
iii. Building Complex Chains with the LangChain Expression Language
iv. Debugging Complex Chain Failures in Production
3. Summary: End to end LLM Ops
… deploy / run / trace / correct / finetune / repeat
Who we are...
• Generative AI for Business Documents. Founded 2018.
• Leverage open source and our own LLMs trained on millions of business documents to create a full
XML data representation of complex documents in their entirety, delivering immediate value to frontline
business users.
• Document as data can be used to generate insights and reports, create new documents, or drive line-
of-business applications. Free trial at www.docugami.com/trial
• Customers in many sectors, including insurance, real estate, health, professional services.
Jean Paoli
Co-founder, CEO
Pioneer in document engineering;
co-creator of XML, .docx, .xlsx, .pptx;
started four $1B+ businesses at Microsoft
Mike Palmer
Co-founder, Head of Technologies
Senior engineering manager at
Microsoft; co-created Microsoft
InfoPath.
Zubin Wadia
Product Manager
Making documents matter to people and
systems – 100+ products over 20 years. MIT,
ImageWork, CiviGuard.
Taqi Jaffri
Co-founder, Head of Product
Principal Product Manager at
Microsoft; co-created the AI driving
Microsoft presence in physical stores.
Challenge 1: Real documents are more than flat text
Real Documents are Structurally Complex: Headings, Lists, Tables, Headers/Footers, Complex Reading Orders, Figures, etc.
Mitigations:
1. Structurally chunk the
document to find
structural elements.
2. Stitch together reading
order flow with language
models.
3. Sub-chunk for RAG using
document structural
elements rather than
simple tiling or text
splitting.
Challenge 2: Documents are Knowledge Graphs
Document structures and spatial relationships contain semantics that are often lost in simple text-based retrieval
Mitigations:
1. XML hierarchical
Knowledge Graph
representation for
inherent per-
document
semantics added to
vector store for
RAG
2. Schema
normalization
across sets of
similar documents
Example XML hierarchical Knowledge Graph
Represents structural relationships as well as per-chunk semantic labels
Retrieval Augmented Generation (RAG) w/ Semantic Chunk
Metadata from Docugami XML
Vector DB
Knowledge Base e.g.,
business documents
Step 1: Indexing / Ingestion
Embedding Model
converts chunks to
embeddings
Data Loader reads
text from
Knowledge Base
and creates chunks
Vector DB offers
fast lookup of
chunks
semantically
similar to any
given string, e.g.
a question
Question
Step 2: Querying
Similar Chunks in Knowledge
Base (possibly contain
answers)
-- improved with additional
information from Docugami
XML Knowledge Graph
Chat
History
Answer
(sourced in
Knowledge
Base)
Metadata from
Docugami XML
LangSmith
Run
traces
Challenges 1 & 2
CODE WALK-THROUGH
https://rebrand.ly/docugami_semantic_rag
Challenge 3: Building Complex Chains with the LangChain
Expression Language
Real-world chains can get complicated with parallel branches, output parsers, few shot examples, conditional sub-chains, etc.
Question
“What were the
total midmarket
gross sales for
Mexico in
2014?”
Generate
SQL Query
SQL DB
(read-only)
Table
schema and
sample rows
Run SQL
Query
Explainers
(in parallel)
Result
Explainer
Query
Explainer
(for non-
technical
users)
SELECT SUM("Gross
Sales") FROM
financial_data WHERE
Segment = "Midmarket"
AND Country = "Mexico"
AND Year = 2014;
Syntax
Error?
(pysqlite3.dbapi2.O
perationalError) no
such table:
financial_data
Attempt
Fixup
SELECT SUM("Gross
Sales") FROM "Financial
Data" WHERE Segment =
"Midmarket" AND Country
= "Mexico" AND Year =
2014;
"[(451890.0,)]"
The total
midmarket gross
sales for Mexico
in 2014 were
$451,890.
Sum of 'Gross
Sales' for the
'Midmarket' segment
in Mexico for the
year 2014.
Sample code: https://rebrand.ly/docugami_complex_chain
Challenge 3
LANGSMITH WALK-THROUGH
https://smith.langchain.com/public/ab8ef1ec-46d1-4d1f-980a-
6dcc8f1943e0/r
Challenge 4: Debugging Complex Chain Failures in Production
Identifying what went wrong, where…
Common Failures:
1. Invalid SQL that could not
be automatically fixed,
leading to chain failure
2. Token overflow (table
schema too large)
3. LLM rate limit reached
4. LLM call failed with GPU
OOM (for self-hosted
models)
5. Exception in custom python
RunnableLambda
6. Exception in custom output
parser
TIP: If you have a link to a detailed call stack for an exception, you can add it to the failed run as
metadata for later investigation. You can also add other information useful to investigate the
failure later.
TIP: Name all runnable lambdas and pass config to conditionally-invoked runnables to correctly link and
name. Reference: cookbook | example
1. Deploy Model (we self-host a custom LLM)
2. Regularly look at failed and user-disliked runs
3. Add some problematic runs to dataset
a) Failed runs e.g. with syntax errors
b) Runs with negative user feedback
4. Fix runs in dataset
a) Tip: use larger LLM to propose fixes
b) Tip: validate that fixes are syntactically correct e.g. by checking SQL syntax
5. Add some examples to few shot set for in-context learning
6. Fine tune model on updated dataset
7. Redeploy (go back to #1)
Summary: Docugami’s End to end LLM Ops with LangChain
+ LangSmith
Q&A
The Document Engineering Company
Docugami API
1.Docs: https://help.docugami.com/home/docugami-api
2.Things to try:
a) Upload docs (DOCX, DOC, digital or scanned PDF)
b) Download processed XML (with semantic metadata tags)
c) Build reports to identify key chunks
d) Use the LlamaHub Docugami loader to load docs for RAG, with
report metadata
3.Free trials available!
Example: Extracting Custom Data from a Document Set
Improved significantly via structural chunking and key metadata associated with all chunks
Example: Authoring Assistance Based on Your Documents
Improved significantly via structural chunking and key metadata associated with all chunks
Example: Workflows Triggered by Auto-Extracted Data
Improved significantly via structural chunking and key metadata associated with all chunks

More Related Content

What's hot

How will development change with LLMs
How will development change with LLMsHow will development change with LLMs
How will development change with LLMs
Microsoft, InfuseAI, Appier, IBM, KaiOS
 
Salesforce Streaming event - PushTopic and Generic Events
Salesforce Streaming event - PushTopic and Generic EventsSalesforce Streaming event - PushTopic and Generic Events
Salesforce Streaming event - PushTopic and Generic Events
Dhanik Sahni
 
ChatGPT - AI.pdf
ChatGPT - AI.pdfChatGPT - AI.pdf
ChatGPT - AI.pdf
Bannoon1
 
LanGCHAIN Framework
LanGCHAIN FrameworkLanGCHAIN Framework
LanGCHAIN Framework
Keymate.AI
 
Einstein bots
Einstein botsEinstein bots
Einstein bots
Amit Chaudhary
 
Benefits of Stream Processing and Apache Kafka Use Cases
Benefits of Stream Processing and Apache Kafka Use CasesBenefits of Stream Processing and Apache Kafka Use Cases
Benefits of Stream Processing and Apache Kafka Use Cases
confluent
 
Anypoint platform architecture and components
Anypoint platform architecture and componentsAnypoint platform architecture and components
Anypoint platform architecture and components
D.Rajesh Kumar
 
Salesforce customization vs configuration
Salesforce customization vs configurationSalesforce customization vs configuration
Salesforce customization vs configuration
Cloud Analogy
 
How Apache Kafka® Works
How Apache Kafka® WorksHow Apache Kafka® Works
How Apache Kafka® Works
confluent
 
Managing and supporting PowerApps & Flow at scale by Daniel Laskewitz
Managing and supporting PowerApps & Flow at scale by Daniel LaskewitzManaging and supporting PowerApps & Flow at scale by Daniel Laskewitz
Managing and supporting PowerApps & Flow at scale by Daniel Laskewitz
Daniel Laskewitz
 
SharePoint goes Microsoft Graph
SharePoint goes Microsoft GraphSharePoint goes Microsoft Graph
SharePoint goes Microsoft Graph
Markus Moeller
 
Mother of Language`s Langchain
Mother of Language`s LangchainMother of Language`s Langchain
Mother of Language`s Langchain
Jun-hang Lee
 
How to Use Salesforce Platform Events to Help With Salesforce Limits
How to Use Salesforce Platform Events to Help With Salesforce LimitsHow to Use Salesforce Platform Events to Help With Salesforce Limits
How to Use Salesforce Platform Events to Help With Salesforce Limits
Roy Gilad
 
Salesforce CPQ
Salesforce CPQSalesforce CPQ
Salesforce CPQ
Jade Global
 
An AI Maturity Roadmap for Becoming a Data-Driven Organization
An AI Maturity Roadmap for Becoming a Data-Driven OrganizationAn AI Maturity Roadmap for Becoming a Data-Driven Organization
An AI Maturity Roadmap for Becoming a Data-Driven Organization
David Solomon
 
Mule access management - Managing Environments and Permissions
Mule access management - Managing Environments and PermissionsMule access management - Managing Environments and Permissions
Mule access management - Managing Environments and Permissions
Shanky Gupta
 
Single Sign-On and User Provisioning with Salesforce Identity
Single Sign-On and User Provisioning with Salesforce IdentitySingle Sign-On and User Provisioning with Salesforce Identity
Single Sign-On and User Provisioning with Salesforce Identity
Salesforce Developers
 
Einstein Bots
 Einstein Bots Einstein Bots
Einstein Bots
AIMDek Technologies
 
AZConf 2023 - Considerations for LLMOps: Running LLMs in production
AZConf 2023 - Considerations for LLMOps: Running LLMs in productionAZConf 2023 - Considerations for LLMOps: Running LLMs in production
AZConf 2023 - Considerations for LLMOps: Running LLMs in production
SARADINDU SENGUPTA
 
Accelerating Path to Production for Generative AI-powered Applications
Accelerating Path to Production for Generative AI-powered ApplicationsAccelerating Path to Production for Generative AI-powered Applications
Accelerating Path to Production for Generative AI-powered Applications
HostedbyConfluent
 

What's hot (20)

How will development change with LLMs
How will development change with LLMsHow will development change with LLMs
How will development change with LLMs
 
Salesforce Streaming event - PushTopic and Generic Events
Salesforce Streaming event - PushTopic and Generic EventsSalesforce Streaming event - PushTopic and Generic Events
Salesforce Streaming event - PushTopic and Generic Events
 
ChatGPT - AI.pdf
ChatGPT - AI.pdfChatGPT - AI.pdf
ChatGPT - AI.pdf
 
LanGCHAIN Framework
LanGCHAIN FrameworkLanGCHAIN Framework
LanGCHAIN Framework
 
Einstein bots
Einstein botsEinstein bots
Einstein bots
 
Benefits of Stream Processing and Apache Kafka Use Cases
Benefits of Stream Processing and Apache Kafka Use CasesBenefits of Stream Processing and Apache Kafka Use Cases
Benefits of Stream Processing and Apache Kafka Use Cases
 
Anypoint platform architecture and components
Anypoint platform architecture and componentsAnypoint platform architecture and components
Anypoint platform architecture and components
 
Salesforce customization vs configuration
Salesforce customization vs configurationSalesforce customization vs configuration
Salesforce customization vs configuration
 
How Apache Kafka® Works
How Apache Kafka® WorksHow Apache Kafka® Works
How Apache Kafka® Works
 
Managing and supporting PowerApps & Flow at scale by Daniel Laskewitz
Managing and supporting PowerApps & Flow at scale by Daniel LaskewitzManaging and supporting PowerApps & Flow at scale by Daniel Laskewitz
Managing and supporting PowerApps & Flow at scale by Daniel Laskewitz
 
SharePoint goes Microsoft Graph
SharePoint goes Microsoft GraphSharePoint goes Microsoft Graph
SharePoint goes Microsoft Graph
 
Mother of Language`s Langchain
Mother of Language`s LangchainMother of Language`s Langchain
Mother of Language`s Langchain
 
How to Use Salesforce Platform Events to Help With Salesforce Limits
How to Use Salesforce Platform Events to Help With Salesforce LimitsHow to Use Salesforce Platform Events to Help With Salesforce Limits
How to Use Salesforce Platform Events to Help With Salesforce Limits
 
Salesforce CPQ
Salesforce CPQSalesforce CPQ
Salesforce CPQ
 
An AI Maturity Roadmap for Becoming a Data-Driven Organization
An AI Maturity Roadmap for Becoming a Data-Driven OrganizationAn AI Maturity Roadmap for Becoming a Data-Driven Organization
An AI Maturity Roadmap for Becoming a Data-Driven Organization
 
Mule access management - Managing Environments and Permissions
Mule access management - Managing Environments and PermissionsMule access management - Managing Environments and Permissions
Mule access management - Managing Environments and Permissions
 
Single Sign-On and User Provisioning with Salesforce Identity
Single Sign-On and User Provisioning with Salesforce IdentitySingle Sign-On and User Provisioning with Salesforce Identity
Single Sign-On and User Provisioning with Salesforce Identity
 
Einstein Bots
 Einstein Bots Einstein Bots
Einstein Bots
 
AZConf 2023 - Considerations for LLMOps: Running LLMs in production
AZConf 2023 - Considerations for LLMOps: Running LLMs in productionAZConf 2023 - Considerations for LLMOps: Running LLMs in production
AZConf 2023 - Considerations for LLMOps: Running LLMs in production
 
Accelerating Path to Production for Generative AI-powered Applications
Accelerating Path to Production for Generative AI-powered ApplicationsAccelerating Path to Production for Generative AI-powered Applications
Accelerating Path to Production for Generative AI-powered Applications
 

Similar to LangChain + Docugami Webinar

5010
50105010
Reengineering PDF-Based Documents Targeting Complex Software Specifications
Reengineering PDF-Based Documents Targeting Complex Software SpecificationsReengineering PDF-Based Documents Targeting Complex Software Specifications
Reengineering PDF-Based Documents Targeting Complex Software Specifications
Moutasm Tamimi
 
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
Fwdays
 
Company Visitor Management System Report.docx
Company Visitor Management System Report.docxCompany Visitor Management System Report.docx
Company Visitor Management System Report.docx
fantabulous2024
 
Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...
Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...
Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...
Mihai Criveti
 
Introductionto Xm Lmessaging
Introductionto Xm LmessagingIntroductionto Xm Lmessaging
Introductionto Xm Lmessaging
LiquidHub
 
Tech challenges in a large scale agile project
Tech challenges in a large scale agile projectTech challenges in a large scale agile project
Tech challenges in a large scale agile project
Harald Soevik
 
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
Bill Buchan
 
Ad507
Ad507Ad507
Use Case Patterns for LLM Applications (1).pdf
Use Case Patterns for LLM Applications (1).pdfUse Case Patterns for LLM Applications (1).pdf
Use Case Patterns for LLM Applications (1).pdf
M Waleed Kadous
 
Document Based Data Modeling Technique
Document Based Data Modeling TechniqueDocument Based Data Modeling Technique
Document Based Data Modeling Technique
Carmen Sanborn
 
Google File System
Google File SystemGoogle File System
Google File System
vivatechijri
 
A Case Study Of A Reusable Component Collection
A Case Study Of A Reusable Component CollectionA Case Study Of A Reusable Component Collection
A Case Study Of A Reusable Component Collection
Jennifer Strong
 
Tech leaders guide to effective building of machine learning products
Tech leaders guide to effective building of machine learning productsTech leaders guide to effective building of machine learning products
Tech leaders guide to effective building of machine learning products
Gianmario Spacagna
 
NamingConvention
NamingConventionNamingConvention
NamingConvention
Jabed Hossain
 
DOC-20210303-WA0017..pptx,coding stuff in c
DOC-20210303-WA0017..pptx,coding stuff in cDOC-20210303-WA0017..pptx,coding stuff in c
DOC-20210303-WA0017..pptx,coding stuff in c
floraaluoch3
 
BigDataDebugging
BigDataDebuggingBigDataDebugging
BigDataDebugging
Asi Lifshitz
 
191
191191
Assessment item 1 File Systems and Advanced Scripting .docx
Assessment item 1 File Systems and Advanced Scripting .docxAssessment item 1 File Systems and Advanced Scripting .docx
Assessment item 1 File Systems and Advanced Scripting .docx
davezstarr61655
 
Practical machine learning
Practical machine learningPractical machine learning
Practical machine learning
Faizan Javed
 

Similar to LangChain + Docugami Webinar (20)

5010
50105010
5010
 
Reengineering PDF-Based Documents Targeting Complex Software Specifications
Reengineering PDF-Based Documents Targeting Complex Software SpecificationsReengineering PDF-Based Documents Targeting Complex Software Specifications
Reengineering PDF-Based Documents Targeting Complex Software Specifications
 
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap"Running Open-Source LLM models on Kubernetes",  Volodymyr Tsap
"Running Open-Source LLM models on Kubernetes", Volodymyr Tsap
 
Company Visitor Management System Report.docx
Company Visitor Management System Report.docxCompany Visitor Management System Report.docx
Company Visitor Management System Report.docx
 
Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...
Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...
Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...
 
Introductionto Xm Lmessaging
Introductionto Xm LmessagingIntroductionto Xm Lmessaging
Introductionto Xm Lmessaging
 
Tech challenges in a large scale agile project
Tech challenges in a large scale agile projectTech challenges in a large scale agile project
Tech challenges in a large scale agile project
 
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
 
Ad507
Ad507Ad507
Ad507
 
Use Case Patterns for LLM Applications (1).pdf
Use Case Patterns for LLM Applications (1).pdfUse Case Patterns for LLM Applications (1).pdf
Use Case Patterns for LLM Applications (1).pdf
 
Document Based Data Modeling Technique
Document Based Data Modeling TechniqueDocument Based Data Modeling Technique
Document Based Data Modeling Technique
 
Google File System
Google File SystemGoogle File System
Google File System
 
A Case Study Of A Reusable Component Collection
A Case Study Of A Reusable Component CollectionA Case Study Of A Reusable Component Collection
A Case Study Of A Reusable Component Collection
 
Tech leaders guide to effective building of machine learning products
Tech leaders guide to effective building of machine learning productsTech leaders guide to effective building of machine learning products
Tech leaders guide to effective building of machine learning products
 
NamingConvention
NamingConventionNamingConvention
NamingConvention
 
DOC-20210303-WA0017..pptx,coding stuff in c
DOC-20210303-WA0017..pptx,coding stuff in cDOC-20210303-WA0017..pptx,coding stuff in c
DOC-20210303-WA0017..pptx,coding stuff in c
 
BigDataDebugging
BigDataDebuggingBigDataDebugging
BigDataDebugging
 
191
191191
191
 
Assessment item 1 File Systems and Advanced Scripting .docx
Assessment item 1 File Systems and Advanced Scripting .docxAssessment item 1 File Systems and Advanced Scripting .docx
Assessment item 1 File Systems and Advanced Scripting .docx
 
Practical machine learning
Practical machine learningPractical machine learning
Practical machine learning
 

Recently uploaded

Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
kalichargn70th171
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
Karya Keeper
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Peter Caitens
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Paul Brebner
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Tier1 app
 

Recently uploaded (20)

Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
 

LangChain + Docugami Webinar

  • 1. The Document Engineering Company LangChain Webinar: Lessons from Deploying LLMs with LangSmith Jean Paoli @jeanpaoli Taqi Jaffri @tjaffri Mike Palmer Zubin Wadia @zubinwadia
  • 2. Topics 1. Intros 2. Real-World Challenges using LLMs with Documents i. Real documents are more than flat Text ii. Documents are Knowledge Graphs iii. Building Complex Chains with the LangChain Expression Language iv. Debugging Complex Chain Failures in Production 3. Summary: End to end LLM Ops … deploy / run / trace / correct / finetune / repeat
  • 3. Who we are... • Generative AI for Business Documents. Founded 2018. • Leverage open source and our own LLMs trained on millions of business documents to create a full XML data representation of complex documents in their entirety, delivering immediate value to frontline business users. • Document as data can be used to generate insights and reports, create new documents, or drive line- of-business applications. Free trial at www.docugami.com/trial • Customers in many sectors, including insurance, real estate, health, professional services. Jean Paoli Co-founder, CEO Pioneer in document engineering; co-creator of XML, .docx, .xlsx, .pptx; started four $1B+ businesses at Microsoft Mike Palmer Co-founder, Head of Technologies Senior engineering manager at Microsoft; co-created Microsoft InfoPath. Zubin Wadia Product Manager Making documents matter to people and systems – 100+ products over 20 years. MIT, ImageWork, CiviGuard. Taqi Jaffri Co-founder, Head of Product Principal Product Manager at Microsoft; co-created the AI driving Microsoft presence in physical stores.
  • 4. Challenge 1: Real documents are more than flat text Real Documents are Structurally Complex: Headings, Lists, Tables, Headers/Footers, Complex Reading Orders, Figures, etc. Mitigations: 1. Structurally chunk the document to find structural elements. 2. Stitch together reading order flow with language models. 3. Sub-chunk for RAG using document structural elements rather than simple tiling or text splitting.
  • 5. Challenge 2: Documents are Knowledge Graphs Document structures and spatial relationships contain semantics that are often lost in simple text-based retrieval Mitigations: 1. XML hierarchical Knowledge Graph representation for inherent per- document semantics added to vector store for RAG 2. Schema normalization across sets of similar documents
  • 6. Example XML hierarchical Knowledge Graph Represents structural relationships as well as per-chunk semantic labels
  • 7. Retrieval Augmented Generation (RAG) w/ Semantic Chunk Metadata from Docugami XML Vector DB Knowledge Base e.g., business documents Step 1: Indexing / Ingestion Embedding Model converts chunks to embeddings Data Loader reads text from Knowledge Base and creates chunks Vector DB offers fast lookup of chunks semantically similar to any given string, e.g. a question Question Step 2: Querying Similar Chunks in Knowledge Base (possibly contain answers) -- improved with additional information from Docugami XML Knowledge Graph Chat History Answer (sourced in Knowledge Base) Metadata from Docugami XML LangSmith Run traces
  • 8. Challenges 1 & 2 CODE WALK-THROUGH https://rebrand.ly/docugami_semantic_rag
  • 9. Challenge 3: Building Complex Chains with the LangChain Expression Language Real-world chains can get complicated with parallel branches, output parsers, few shot examples, conditional sub-chains, etc. Question “What were the total midmarket gross sales for Mexico in 2014?” Generate SQL Query SQL DB (read-only) Table schema and sample rows Run SQL Query Explainers (in parallel) Result Explainer Query Explainer (for non- technical users) SELECT SUM("Gross Sales") FROM financial_data WHERE Segment = "Midmarket" AND Country = "Mexico" AND Year = 2014; Syntax Error? (pysqlite3.dbapi2.O perationalError) no such table: financial_data Attempt Fixup SELECT SUM("Gross Sales") FROM "Financial Data" WHERE Segment = "Midmarket" AND Country = "Mexico" AND Year = 2014; "[(451890.0,)]" The total midmarket gross sales for Mexico in 2014 were $451,890. Sum of 'Gross Sales' for the 'Midmarket' segment in Mexico for the year 2014. Sample code: https://rebrand.ly/docugami_complex_chain
  • 11. Challenge 4: Debugging Complex Chain Failures in Production Identifying what went wrong, where… Common Failures: 1. Invalid SQL that could not be automatically fixed, leading to chain failure 2. Token overflow (table schema too large) 3. LLM rate limit reached 4. LLM call failed with GPU OOM (for self-hosted models) 5. Exception in custom python RunnableLambda 6. Exception in custom output parser TIP: If you have a link to a detailed call stack for an exception, you can add it to the failed run as metadata for later investigation. You can also add other information useful to investigate the failure later. TIP: Name all runnable lambdas and pass config to conditionally-invoked runnables to correctly link and name. Reference: cookbook | example
  • 12. 1. Deploy Model (we self-host a custom LLM) 2. Regularly look at failed and user-disliked runs 3. Add some problematic runs to dataset a) Failed runs e.g. with syntax errors b) Runs with negative user feedback 4. Fix runs in dataset a) Tip: use larger LLM to propose fixes b) Tip: validate that fixes are syntactically correct e.g. by checking SQL syntax 5. Add some examples to few shot set for in-context learning 6. Fine tune model on updated dataset 7. Redeploy (go back to #1) Summary: Docugami’s End to end LLM Ops with LangChain + LangSmith
  • 13. Q&A
  • 15. Docugami API 1.Docs: https://help.docugami.com/home/docugami-api 2.Things to try: a) Upload docs (DOCX, DOC, digital or scanned PDF) b) Download processed XML (with semantic metadata tags) c) Build reports to identify key chunks d) Use the LlamaHub Docugami loader to load docs for RAG, with report metadata 3.Free trials available!
  • 16. Example: Extracting Custom Data from a Document Set Improved significantly via structural chunking and key metadata associated with all chunks
  • 17. Example: Authoring Assistance Based on Your Documents Improved significantly via structural chunking and key metadata associated with all chunks
  • 18. Example: Workflows Triggered by Auto-Extracted Data Improved significantly via structural chunking and key metadata associated with all chunks