Build a RAG Chatbot on Your Own Documents
Ship a chatbot that answers from your PDFs and docs, with citations, using embeddings, a vector store and an LLM API.
What you'll be able to do
- Chunk and embed documents sensibly
- Store and search vectors with Postgres + pgvector
- Write a grounded answer prompt with citations
- Evaluate answer quality with a small test set
- Deploy with streaming responses
The curriculum
5 modules · 14 lessons · 166 minutes
Module 1How RAG works2 lessons
- Retrieval vs fine-tuningFree preview10 min
- Architecture walkthroughFree preview12 min
Module 2Ingestion3 lessons
- Extracting text from PDFs11 min
- Chunking strategies14 min
- Embeddings and metadata12 min
Module 3Retrieval3 lessons
- pgvector setup13 min
- Similarity search and top-k11 min
- Hybrid search with keywords12 min
Module 4Generation3 lessons
- The grounded answer prompt13 min
- Citations users can check10 min
- Saying "I don't know"8 min
Module 5Quality and shipping3 lessons
- A 30-question eval set15 min
- Streaming UI in Next.js16 min
- Costs and caching9 min
Who it's for
Developers who want to put an LLM over private knowledge without making things up.
Requirements
- •JavaScript/TypeScript
- •Basic SQL
- •An LLM API key
Start now with free tutorials
Free guides on the same topic, available to read today.
Build with LLM APIs.
Your first Claude API call in TypeScript and Python
Install the SDK, make a request, stream the answer and cut costs with prompt caching, in about ten minutes.
Build with LLM APIs.
RAG in plain English (and a minimal implementation)
How retrieval-augmented generation lets an LLM answer from your documents, and the smallest version you can build today.
You might also like
Give your AI tools.
AI Agents with Tool Use
Build agents that call your functions, loop until the job is done, and stay inside the guardrails you set.
Prompts that land.
Prompt Engineering Masterclass
Go from vague questions to reliable, structured prompts that work across ChatGPT, Claude and Gemini.
Zero to shipped.
Claude Code from Zero to Shipping
Use an AI agent in your terminal to plan, write, test and ship real features, without losing control of your codebase.