Let's Build a "Chat With PDF” app using Langchain(TS/JS), AI SDK, Pinecone DB, Open AI & Next.js 13

Raj talks tech August 27, 2023
Video Thumbnail

Raj talks tech

View Channel

About

No channel description available.

Video Description

✨ Update ✨ Looks like Pinecone has removed namespaces from free-tier, so I pushed recent changes to https://github.com/rajeshdavidbabu/pdf-chat-ai-sdk and removed the name-spaces and tested the code its still working ! 🥹 🚀 Troubleshooting: For " Error [InsufficientQuotaError]: 429 You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors." I had to delete all my old API keys and created a new one + charged my credits for about 10 dollars. If you have questions jump on the discord link https://discord.gg/4zpS4Zsz56 ------------------ A beginner friendly and full-tutorial on how to build a “Chat with PDF” using Langchain, AI SDK, Pinecone DB, Open AI and Next.js 13. Github: https://github.com/rajeshdavidbabu/pdf-chat-ai-sdk (without AI SDK - Github: https://github.com/rajeshdavidbabu/pdf-chat-ai) Timecode: 0:00 - Intro 01:08 - How to make your LLMs smarter ? 02:29 - Tech-stack walkthrough 04:20 - App Architecture 05:53 - Breakdown of app into steps 07:16 - Step 1: Setup Next.js 13 and shadcn app 08:54 - Step 2: Building chat UI components 14:44 - Step 3: Setting up API keys and ENV config 16:55 - Step 4: Setup Pinecone DB client 18:40 - Step 5: Embed PDF and store on Pinecone DB 24:18 - Step 6: LLM Templates and models 25:55 - Step 7: Building chains using Langchain 31:14 - Step 8: Prepare chat-endpoint 32:53 - Step 9: Build a streaming chat UI 36:09 - Step 10: Streaming the sources information

You May Also Like

Upgrade Your iPhone Experience

AI-recommended products based on this video

Loading...
ESR for iPhone 14 Pro Case MagSafe, Shockproof Military-Grade Protection, Scratch-Resistant Back, Classic Hybrid Magnetic Case Compatible with iPhone 14 Pro 6.1 inch, Clear Purple

ESR for iPhone 14 Pro Case MagSafe, Shockproof Military-Grade Protection, Scratch-Resistant Back, Classic Hybrid Magnetic Case Compatible with iPhone 14 Pro 6.1 inch, Clear Purple

(12,774)
$16.99
FREE delivery Sat, Sep 20 on your first order
400+ bought in past month
Loading...
ESR for iPhone 14 Pro Screen Protector, Tempered Glass with Easy Installation Frame, Military-Grade Protection, Ultra Tough, Scratch Resistant, 3 Pack

ESR for iPhone 14 Pro Screen Protector, Tempered Glass with Easy Installation Frame, Military-Grade Protection, Ultra Tough, Scratch Resistant, 3 Pack

(42,149)
$10.99
FREE delivery Sat, Jun 14 on your first order
100+ bought in past month
Loading...
5 Pack [MFi Certified] iPhone Charger 3ft,USB to Lightning Cable 3 Foot,Original Fast iPhone Charging Cord for iPhone 14 Pro Max/iPhone 13 Pro/12 Pro Max/12/11/Se2022/XR/X/8/iPad, White

5 Pack [MFi Certified] iPhone Charger 3ft,USB to Lightning Cable 3 Foot,Original Fast iPhone Charging Cord for iPhone 14 Pro Max/iPhone 13 Pro/12 Pro Max/12/11/Se2022/XR/X/8/iPad, White

(1,512)
$10.39
FREE delivery Sat, Jun 14 on your first order
500+ bought in past month
Loading...
BASESAILOR iPhone 16 16e Car Charger Adapter 3Pack,USB to USBC Connector Type C Female to A Male Cable Converter for iPhone 15 14 Pro Max Plus,Apple Watch 10,Airpods 4,iPad mini 7,Samsung Galaxy S25

BASESAILOR iPhone 16 16e Car Charger Adapter 3Pack,USB to USBC Connector Type C Female to A Male Cable Converter for iPhone 15 14 Pro Max Plus,Apple Watch 10,Airpods 4,iPad mini 7,Samsung Galaxy S25

(7,876)
$11.99
FREE delivery Sat, Jun 14 on your first order
500+ bought in past month
Loading...
Magnetic Wireless Charger for iPhone - 3 in 1 Mag-Safe Charging Station for Multiple Devices Apple - Charger Stand Dock for Apple Watch iPhone 16 15 14 13 12 Pro Max Plus Airpods

Magnetic Wireless Charger for iPhone - 3 in 1 Mag-Safe Charging Station for Multiple Devices Apple - Charger Stand Dock for Apple Watch iPhone 16 15 14 13 12 Pro Max Plus Airpods

(750)
$59.99
PrimeFREE delivery Sat, Jun 14
Loading...
4-in-1 Wireless Magnetic Power Bank 10800mAh Portable Charger with iWatch Charger, QC4.0+20W PD Fast Charging USB C Battery Pack for Magsafe, iPhone 16/15/14/13/12 Series, Apple Watch etc. (White)

4-in-1 Wireless Magnetic Power Bank 10800mAh Portable Charger with iWatch Charger, QC4.0+20W PD Fast Charging USB C Battery Pack for Magsafe, iPhone 16/15/14/13/12 Series, Apple Watch etc. (White)

(581)
$42.95
PrimeFREE delivery Sat, Jun 14
Loading...
eazpower for Magsafe Power Bank 10000mAh, Magnetic Battery Pack Wireless, 20W PD Fast Charging, Compact Portable Charger with Built-in Cables and Stand for iPhone 16/15/14/13/12/ Apple Watch/Airpods

eazpower for Magsafe Power Bank 10000mAh, Magnetic Battery Pack Wireless, 20W PD Fast Charging, Compact Portable Charger with Built-in Cables and Stand for iPhone 16/15/14/13/12/ Apple Watch/Airpods

(330)
$39.99
PrimeFREE delivery Sat, Jun 14
200+ bought in past month
Loading...
soundcore by Anker P20i True Wireless Earbuds, 10mm Drivers with Big Bass, Bluetooth 5.3, 30H Long Playtime, IPX5 Water-Resistant, 2 Mics for AI Clear Calls, 22 Preset EQs, Customization via App

soundcore by Anker P20i True Wireless Earbuds, 10mm Drivers with Big Bass, Bluetooth 5.3, 30H Long Playtime, IPX5 Water-Resistant, 2 Mics for AI Clear Calls, 22 Preset EQs, Customization via App

(61,759)
$29.99
FREE delivery Sat, Jun 14 on your first order
4K+ bought in past month
Loading...
Anker USB C Charger Cable (6ft 100W, 2Pack), USB 2.0 Type C Fast Charging Cable for iPhone 15 / 15Pro / 15Plus / 15ProMax MacBook Pro 2020, iPad Pro 2020, iPad Air 4, Samsung Galaxy S23+/S23 Ultra ClimatePartner certified

Anker USB C Charger Cable (6ft 100W, 2Pack), USB 2.0 Type C Fast Charging Cable for iPhone 15 / 15Pro / 15Plus / 15ProMax MacBook Pro 2020, iPad Pro 2020, iPad Air 4, Samsung Galaxy S23+/S23 Ultra ClimatePartner certified

(44,904)
$17.99
FREE delivery Wed, Aug 20 on your first order
6K+ bought in past month
Loading...
soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel

soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel

(39,496)
$52.99
FREE delivery Sun, Oct 19
3K+ bought in past month
Loading...
soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel

soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel

(30,156)
49.98
PrimeFREE delivery Saturday, June 14
500+ bought in past month
Loading...
Spigen Case for Galaxy S25 Case, Tough Armor (Ai) MagFit [Wireless Charging] Compatible with MagSafe - Black

Spigen Case for Galaxy S25 Case, Tough Armor (Ai) MagFit [Wireless Charging] Compatible with MagSafe - Black

(2,126)
$28.99
FREE delivery Sat, Jun 14 on your first order
500+ bought in past month
Loading...
Spigen Case for iPhone 16 Case, Tough Armor Designed for Apple iPhone 16 - Black

Spigen Case for iPhone 16 Case, Tough Armor Designed for Apple iPhone 16 - Black

(126)
$22.99
FREE delivery Sat, Jun 14 on your first order
50+ bought in past month
Loading...
Spigen Case for iPhone 16 Pro Case, Tough Armor [MagFit] Compatible with MagSafe - Black

Spigen Case for iPhone 16 Pro Case, Tough Armor [MagFit] Compatible with MagSafe - Black

(341)
$32.99
FREE delivery Sat, Jun 14 on your first order
Loading...
Spigen Case for iPhone 16 Plus Case, Tough Armor (AI) [MagFit] Compatible with MagSafe - Black

Spigen Case for iPhone 16 Plus Case, Tough Armor (AI) [MagFit] Compatible with MagSafe - Black

(818)
$29.99
FREE delivery Sat, Jun 14 on your first order
Loading...
Magnetic Wireless Charger for iPhone: Fodable 3 in 1 Charging Station for Multiple Apple Devices - Travel Charging Pad Dock for Apple Watch iPhone 16 15 14 13 12 Pro Max Plus & Airpod Global Recycled Standard

Magnetic Wireless Charger for iPhone: Fodable 3 in 1 Charging Station for Multiple Apple Devices - Travel Charging Pad Dock for Apple Watch iPhone 16 15 14 13 12 Pro Max Plus & Airpod Global Recycled Standard

(656)
$49.99
PrimeFREE delivery Sat, Jun 14
100+ bought in past month
Loading...
Magnetic Wireless Charger for iPhone - 3 in 1 Mag-Safe Charging Station for Multiple Devices Apple - Charger Stand Dock for Apple Watch iPhone 16 15 14 13 12 Pro Max Plus Airpods

Magnetic Wireless Charger for iPhone - 3 in 1 Mag-Safe Charging Station for Multiple Devices Apple - Charger Stand Dock for Apple Watch iPhone 16 15 14 13 12 Pro Max Plus Airpods

(750)
$59.99
PrimeFREE delivery Sat, Jun 14
Loading...
for Magsafe Car Mount【20 Strong Magnets 】Magnetic Phone Holder for Car Phone Holder Mount Dash【360°】Cell Phone Mount for Car Accessories,Car Mount for iPhone 16 Pro Max 15 14 13 12 Plus MagSafe Cases

for Magsafe Car Mount【20 Strong Magnets 】Magnetic Phone Holder for Car Phone Holder Mount Dash【360°】Cell Phone Mount for Car Accessories,Car Mount for iPhone 16 Pro Max 15 14 13 12 Plus MagSafe Cases

(11,563)
$16.98
FREE delivery Tue, Jun 17 on your first order
3K+ bought in past month
Loading...
BASESAILOR iPhone 16 16e Car Charger Adapter 3Pack,USB to USBC Connector Type C Female to A Male Cable Converter for iPhone 15 14 Pro Max Plus,Apple Watch 10,Airpods 4,iPad mini 7,Samsung Galaxy S25

BASESAILOR iPhone 16 16e Car Charger Adapter 3Pack,USB to USBC Connector Type C Female to A Male Cable Converter for iPhone 15 14 Pro Max Plus,Apple Watch 10,Airpods 4,iPad mini 7,Samsung Galaxy S25

(7,876)
$11.99
FREE delivery Sat, Jun 14 on your first order
500+ bought in past month
Loading...
8BitDo Charging Dock for Xbox Wireless Controllers, Xbox Charging Station with Magnetic Secure Charging for Xbox Series X|S and Xbox One Controller - Officially Licensed (Black)

8BitDo Charging Dock for Xbox Wireless Controllers, Xbox Charging Station with Magnetic Secure Charging for Xbox Series X|S and Xbox One Controller - Officially Licensed (Black)

(281)
$34.99
FREE delivery Sat, Jun 14 on your first order
Loading...
3 in 1 Charging Station for Samsung, Wireless Charger for Samsung S25/S25+/S24/S23/S22/Z Fold/Z Flip Series/Galaxy Watch/Buds Charging Dock Stand(Without Adapter)

3 in 1 Charging Station for Samsung, Wireless Charger for Samsung S25/S25+/S24/S23/S22/Z Fold/Z Flip Series/Galaxy Watch/Buds Charging Dock Stand(Without Adapter)

(3)
$36.99
PrimeFREE delivery Sat, Jun 14
Loading...
3 in 1 Charging Station for iPhone, Wireless Charger for iPhone 16 15 14 13 12 11 X Pro Max & Apple Watch - Charging Stand Dock for AirPods Global Recycled Standard

3 in 1 Charging Station for iPhone, Wireless Charger for iPhone 16 15 14 13 12 11 X Pro Max & Apple Watch - Charging Stand Dock for AirPods Global Recycled Standard

(30,415)
$30.39
Prime
1K+ bought in past month
Loading...
3 in 1 Charging Station for iPhone, Wireless Charger for iPhone 16 15 14 13 12 11 X Pro Max & Apple Watch - Charging Stand Dock for AirPods (Blue) Global Recycled Standard

3 in 1 Charging Station for iPhone, Wireless Charger for iPhone 16 15 14 13 12 11 X Pro Max & Apple Watch - Charging Stand Dock for AirPods (Blue) Global Recycled Standard

(27,328)
$39.99
PrimeFREE delivery Sat, Jun 14
100+ bought in past month
Loading...
FNTCASE for iPhone 13 Phone Case: iPhone 14 Phone Clear Case Magnetic Military Grade Drop Protection Anti Yellowing Cell Phone Cover - Rugged Durable Shockproof Protective Bumper - 6.1 Inch (Clear A) Global Recycled Standard

FNTCASE for iPhone 13 Phone Case: iPhone 14 Phone Clear Case Magnetic Military Grade Drop Protection Anti Yellowing Cell Phone Cover - Rugged Durable Shockproof Protective Bumper - 6.1 Inch (Clear A) Global Recycled Standard

(3,619)
$7.19
FREE delivery Sat, Jun 14 on your first order
100+ bought in past month
Loading...
ESR for iPhone 14 Pro Case MagSafe, Shockproof Military-Grade Protection, Scratch-Resistant Back, Classic Hybrid Magnetic Case Compatible with iPhone 14 Pro 6.1 inch, Clear Purple

ESR for iPhone 14 Pro Case MagSafe, Shockproof Military-Grade Protection, Scratch-Resistant Back, Classic Hybrid Magnetic Case Compatible with iPhone 14 Pro 6.1 inch, Clear Purple

(12,774)
$16.99
FREE delivery Sat, Sep 20 on your first order
400+ bought in past month
Loading...
JETech Full Coverage Screen Protector for iPhone 16e 2025, iPhone 14 6.1-Inch, 9H Tempered Glass Film Case-Friendly, HD Clear, 3-Pack

JETech Full Coverage Screen Protector for iPhone 16e 2025, iPhone 14 6.1-Inch, 9H Tempered Glass Film Case-Friendly, HD Clear, 3-Pack

(7,597)
$8.99
FREE delivery Wed, Aug 20 on your first order
5K+ bought in past month
Loading...
JETech Case for iPhone 14 6.1-Inch, Non-Yellowing Shockproof Phone Bumper Cover, Anti-Scratch Clear Back (Clear)

JETech Case for iPhone 14 6.1-Inch, Non-Yellowing Shockproof Phone Bumper Cover, Anti-Scratch Clear Back (Clear)

(15,389)
$11.99
FREE delivery Sat, Sep 20 on your first order
1K+ bought in past month
Loading...
Apple AirPods Pro 2 Wireless Earbuds, Bluetooth Headphones, Active Noise Cancellation, Transparency, Personalized Spatial Audio, High-Fidelity Sound, H2 Chip, USB-C Charging

Apple AirPods Pro 2 Wireless Earbuds, Bluetooth Headphones, Active Noise Cancellation, Transparency, Personalized Spatial Audio, High-Fidelity Sound, H2 Chip, USB-C Charging

(26,678)
$259.99$194.99
FREE delivery Wed, Aug 20
5K+ bought in past month
Loading...
3 in 1 Charging Station for iPhone, Wireless Charger for iPhone 16 15 14 13 12 11 X Pro Max & Apple Watch - Charging Stand Dock for AirPods Global Recycled Standard

3 in 1 Charging Station for iPhone, Wireless Charger for iPhone 16 15 14 13 12 11 X Pro Max & Apple Watch - Charging Stand Dock for AirPods Global Recycled Standard

(30,415)
$30.39
Prime
1K+ bought in past month
Loading...
3 in 1 Charging Station for iPhone, Wireless Charger for iPhone 16 15 14 13 12 11 X Pro Max & Apple Watch - Charging Stand Dock for AirPods (Blue) Global Recycled Standard

3 in 1 Charging Station for iPhone, Wireless Charger for iPhone 16 15 14 13 12 11 X Pro Max & Apple Watch - Charging Stand Dock for AirPods (Blue) Global Recycled Standard

(27,328)
$39.99
PrimeFREE delivery Sat, Jun 14
100+ bought in past month
Loading...
iPhone 16 15 Charger [Apple MFi Certified] 2 Pack USB C Wall Charger Block 6FT USB C to Type C Cable Compatible with iPhone 16 15 Pro Max,16e, AirPods Pr, iPad Pro12.9/11, Samsung/Android Phones

iPhone 16 15 Charger [Apple MFi Certified] 2 Pack USB C Wall Charger Block 6FT USB C to Type C Cable Compatible with iPhone 16 15 Pro Max,16e, AirPods Pr, iPad Pro12.9/11, Samsung/Android Phones

(321)
$17.99
FREE delivery Sat, Jun 14 on your first order
50+ bought in past month
Loading...
soundcore by Anker P20i True Wireless Earbuds, 10mm Drivers with Big Bass, Bluetooth 5.3, 30H Long Playtime, IPX5 Water-Resistant, 2 Mics for AI Clear Calls, 22 Preset EQs, Customization via App

soundcore by Anker P20i True Wireless Earbuds, 10mm Drivers with Big Bass, Bluetooth 5.3, 30H Long Playtime, IPX5 Water-Resistant, 2 Mics for AI Clear Calls, 22 Preset EQs, Customization via App

(61,759)
$29.99
FREE delivery Sat, Jun 14 on your first order
4K+ bought in past month
Loading...
soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel

soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel

(39,496)
$52.99
FREE delivery Sun, Oct 19
3K+ bought in past month
Loading...
soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel

soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel

(30,156)
49.98
PrimeFREE delivery Saturday, June 14
500+ bought in past month
Loading...
soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel
Amazon's Choice

soundcore by Anker Q20i Hybrid Active Noise Cancelling Headphones, Wireless Over-Ear Bluetooth, 40H Long ANC Playtime, Hi-Res Audio, Big Bass, Customize via an App, Transparency Mode, Ideal for Travel

(30,156)
49.97
PrimeFREE delivery Saturday, June 14
3K+ bought in past month
Loading...
ESR for iPhone 14 Pro Screen Protector, Tempered Glass with Easy Installation Frame, Military-Grade Protection, Ultra Tough, Scratch Resistant, 3 Pack

ESR for iPhone 14 Pro Screen Protector, Tempered Glass with Easy Installation Frame, Military-Grade Protection, Ultra Tough, Scratch Resistant, 3 Pack

(42,149)
$10.99
FREE delivery Sat, Jun 14 on your first order
100+ bought in past month
Loading...
JETech Full Coverage Screen Protector for iPhone 16e 2025, iPhone 14 6.1-Inch, 9H Tempered Glass Film Case-Friendly, HD Clear, 3-Pack

JETech Full Coverage Screen Protector for iPhone 16e 2025, iPhone 14 6.1-Inch, 9H Tempered Glass Film Case-Friendly, HD Clear, 3-Pack

(7,597)
$8.99
FREE delivery Wed, Aug 20 on your first order
5K+ bought in past month
Loading...
[3+3 Pack] iVoler Tempered Glass for iPhone 14 6.1 inch [3 Pack] with [3 Pack] Camera Lens Screen Protector with [Alignment Frame], Anti-Scratch Case Friendly Transparent HD Clear Film

[3+3 Pack] iVoler Tempered Glass for iPhone 14 6.1 inch [3 Pack] with [3 Pack] Camera Lens Screen Protector with [Alignment Frame], Anti-Scratch Case Friendly Transparent HD Clear Film

(36,815)
$11.99
FREE delivery Sat, Jun 14 on your first order
200+ bought in past month
Loading...
3-Pack, XunyLyee Screen Protector for iPhone 13/13 Pro/iPhone 14/ iPhone 16e 2025 6.1 Inch Tempered Glass Film Bubble Free

3-Pack, XunyLyee Screen Protector for iPhone 13/13 Pro/iPhone 14/ iPhone 16e 2025 6.1 Inch Tempered Glass Film Bubble Free

(275)
$7.99
FREE delivery Sat, Sep 20 on your first order
500+ bought in past month
Loading...
FNTCASE for iPhone 13 Phone Case: iPhone 14 Phone Clear Case Magnetic Military Grade Drop Protection Anti Yellowing Cell Phone Cover - Rugged Durable Shockproof Protective Bumper - 6.1 Inch (Clear A) Global Recycled Standard

FNTCASE for iPhone 13 Phone Case: iPhone 14 Phone Clear Case Magnetic Military Grade Drop Protection Anti Yellowing Cell Phone Cover - Rugged Durable Shockproof Protective Bumper - 6.1 Inch (Clear A) Global Recycled Standard

(3,619)
$7.19
FREE delivery Sat, Jun 14 on your first order
100+ bought in past month