Building RAG (Retrieval Augmented Generation) apps usually starts with PDFs. 📄 But let’s be honest: users really want to chat with live URLs—documentation, wikis, and blogs. 🌐

I spent this weekend adding a Web Scraper to my RAG Starter Kit. Here is the technical breakdown of how I built it, so you can do it too. 👇

🛑 The Problem with Scraping for LLMs

You can’t just fetch(url) and pass the HTML to GPT-4.

  1. Too much noise: Navbars, footers, and ads waste tokens. 💸
  2. Context Window: Raw HTML is huge and confuses the model.
  3. Headless Browsers: Tools like Puppeteer are heavy and often timeout on serverless functions (like Vercel). ⏳

🛠 The Stack

  • Framework: Next.js 14
  • Scraper: Cheerio (via LangChain). It parses HTML like jQuery…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help