Most AI projects fail. Yours doesn’t have to.
Reserve your spot today and get a production-ready Agent Blueprint in just 3 weeks
6
spots‍
‍available
Register for Your Agent Blueprint
About
Capabilities
Custom AgentsReliable RAGCustom Software DevelopmentEval Driven DevelopmentObservability
LangChainCase StudiesFocused Lab
Contact us
Back
Tutorials

Chat With Your PDFs PART 1: An End-to-End LangChain Tutorial

Focused CEO, Austin Vance, shows you how to build a chat application with LangChain to ingest and query PDFs

Aug 12, 2024

By
Austin Vance
Share:

A common use case for developing AI chat bots is ingesting PDF documents and allowing users to ask questions, inspect the documents, and learn from them. In this tutorial we will start with a 100% blank project and build an end-to-end chat application that allows users to chat about the Epic Games vs Apple Lawsuit. There's a lot of content packed into this one video so please ask questions in the comments and I will do my best to help you get past any hurdles.

In Part 1 You will Learn:

  • Create a new app using ‪@LangChain‬ 's LangServe
  • ingestion of PDFs using ‪@unstructuredio‬
  • Chunking of documents via ‪@LangChain‬'s SemanticChunker
  • Embedding chunks using ‪@OpenAI‬'s embeddings API
  • Storing embedded chunks into a PGVector a vector database
  • Build a LCEL Chain for LangServe that uses PGVector as a retriever
  • Use the LangServe playground as a way to test our RAG
  • Stream output including document sources to a future front end.

In Part 2 we will focus on:

  • Creating a front end with Typescript, React, and Tailwind
  • Display sources of information along with the LLM output
  • Stream to the frontend with Server Sent Events

In Part 3 we will focus:

  • Deploying the Backend application to ‪@DigitalOcean‬ & ‪@LangChain‬'s LangServe hosted platform to compare
  • Add LangSmith Integrations
  • Deploying the frontend to ‪@DigitalOcean‬'s App Platform's App Platform

In Part 4 we will focus on:

  • Adding Memory to the ‪@LangChain‬ Chain with PostgreSQL
  • Add Multiquery to the chain for better breadth of search
  • Add sessions to the Chat History

Github repo

https://github.com/focused-labs/pdf_rag

Chapters

0:00 - Intro
0:49 - Start a New LangServe Project
2:22 - Start Building the Document Importer
11:40 - Use the Semantic Chunker
17:05 - Install & Use PGVector
26:45 - Build the LLM Chain with LCEL
32:00 - Retrieve Documents from PGVector
36:10 - Complete the Chain
39:35 - Inspect Documents coming back from Retriever
40:40 - Use the Chain in LangServe
42:00 - Add Types to your Chain
43:50 - Use the LangServe Playground
45:00 - Recap
46:40 - Next time we will...

Your message has been sent!

We’ll be in touch soon. In the mean time check out our case studies.

See all projects
/Contact Us

From concept to table: let’s build your loyalty app

Modernize your legacy with Focused

Get in touch
Focused

433 W Van Buren St Suite 1100-C
Chicago, IL 60607
‍work@focused.io
‍
(708) 303-8088

‍

About
Leadership
Capabilities
Case Studies
Focused Lab
Careers
Contact
© 2026 Focused. All rights reserved.
Privacy Policy
Most AI projects fail. Yours doesn’t have to.
Reserve your spot today and get a production-ready Agent Blueprint in just 3 weeks
6
spots‍
‍available
Register for Your Agent Blueprint