All 29 lessons
Foundations: what RAG is and a working pipeline
Better retrieval: chunking and search
Answers you can trust, measure and debug
Production in a company
Agentic RAG
Frameworks: LangChain, LangGraph and LangSmith
- 24. The RAG toolbox: what each library does and why you import it
- 25. The framework landscape: LangChain, LangGraph, LlamaIndex, Haystack
- 26. Lab: Ask Brightline in LangChain
- 27. Lab: agentic RAG as a LangGraph graph
- 28. Lab: tracing, evaluating and monitoring with LangSmith
- 29. Wrap-up: your production agentic RAG checklist
12 min
The framework landscape: LangChain, LangGraph, LlamaIndex, Haystack
Map what each RAG framework gives you, what it hides, and when plain Python is the better choice.
By the end of this lesson you can
- Say what LangChain, LangGraph, LlamaIndex and Haystack each centre on
- Map this course's plain-Python pipeline to framework components
- Decide when a framework helps and when plain Python is better
From earlier lessons · 1 of 2
Why does plain RAG fail on "What are the main themes across all incident reports?"
Pick one answer.
From earlier lessons · 2 of 2
Where should "How many VPN tickets did Denver open?" go?
Pick one answer.
Your team lead asks: "Should we rewrite Ask Brightline in LangChain?" A colleague says LlamaIndex is better for RAG. Another says use LangGraph for agents. A third says frameworks hide too much. All four are partly right.
What every framework gives you
Strip away the names, and every RAG framework offers the same building blocks. You wrote each of them by hand in this course.
- Loaders read PDFs, web pages, SharePoint and databases into documents with metadata.
- Splitters chunk them, like lessons 6 and 7.
- Embeddings and vector store adapters give one interface over dozens of providers, like lessons 4 and 9.
- Retrievers search with k, filters, hybrid and MMR, like lessons 8-10.
- Prompts and model wrappers cover lesson 12's generation step.
- Agents and graphs run loops with tools, like lessons 20 and 21.
The value is mostly in the integrations: you swap a vector database or model provider by changing one line. The cost is abstraction: the prompt and the exact calls are hidden one layer down.
Four frameworks, four centres of gravity
- LangChain is a large library of components and integrations. Since version 1.0 its core is small, and older chains moved to a separate
langchain-classicpackage. Lesson 26 rebuilds Ask Brightline with it. - LangGraph is, in its own docs' words, a low-level orchestration framework for long-running, stateful agents. You draw the workflow as a graph of nodes and edges over shared state, with persistence, human review and streaming built in. Its docs note it doesn't require LangChain. Lesson 27 builds the grade-and-retry agent in it.
- LlamaIndex describes itself as a toolkit for building LLM-powered agents over your data. It centres on data readers, indexes such as
VectorStoreIndex, and query engines over them. It's strong when ingestion and indexing are the hard part. - Haystack, from deepset, builds pipelines of components: fixed graphs you wire yourself, plus agents when you need flexibility. It suits teams that want explicit, inspectable pipelines.
LangSmith is different: it isn't a framework but a tracing and evaluation service. It works with or without LangChain, and lesson 28 uses it.
When to use a framework, and when not
Reach for a framework when you need many integrations (five document sources, two vector stores, a model you might swap), or graph features like checkpoints and human approval steps. It also helps when your team already knows it.
Stay with plain Python when the pipeline is small and you need to see every prompt. Anthropic's agent guide makes the same point: frameworks can hide the prompts and responses you need to debug, so start with direct API calls and understand what's underneath.
Mixing is common and fine. You might use LangChain loaders and splitters for ingestion, your own retrieval and prompt code, and LangSmith for tracing.
One warning: these libraries change fast. LangChain 1.0 moved imports and renamed agent functions, and tutorials from 2024 often fail on current versions. Pin your versions, and check the docs' date before copying code.
Match
Match each team situation to a sensible choice
Pick an item on the left, then its match on the right.
Worth keeping
- Every framework packages the same stages you built: load, split, embed, retrieve, prompt, loop.
- Frameworks pay off through integrations and graph features, and cost you visibility.
- LangGraph runs stateful agent graphs and doesn't require LangChain.
- Pin versions and check doc dates; these libraries change quickly.
Next lab rebuilds Ask Brightline in LangChain, in about 30 lines. One import from a 2024 tutorial will fail on the first run. You'll see why, and what replaced it.
Leaderboard
Loading…
50 XP for each lesson you finish, 10 for each right answer. Names show only for learners who turn on Show me on leaderboards.
Sources for this lesson (5)
Each fact in the lesson is marked with the number of the page it comes from.