Haystack (by deepset) is Volume 14’s orchestration capstone: production-minded pipelines and components for NLP and RAG—retrievers, readers, rankers, generators—composable as explicit graphs. It sits beside LangChain and LlamaIndex as a battle-tested search/RAG framework.
After this lecture you leave Vol. 14 with retrieval + stores + orchestration literacy, ready for Volume 15 AI Agents.
Learning Objectives
By the end of this lesson, students should be able to:
- Describe Haystack pipelines as directed graphs of components.
- Wire a minimal RAG pipeline (embedder, retriever, generator).
- Contrast Haystack pipelines with LangChain LCEL and LangGraph agents.
- Explain document stores and component I/O contracts.
- Synthesize a Vol. 14 stack choice: store + orchestration + agent path.
- Articulate how Vol. 14 skills feed Volume 15 agent design.
Haystack is an open-source framework for building production search and RAG systems. Applications are pipelines: components (embedders, retrievers, rankers, generators, routers) connected so data flows through an explicit, testable graph.
Framework Capstone Comparison
| Framework | Best mental model | Vol 15 bridge |
|---|---|---|
| LangChain | Runnable app glue | Tools + chains → agents |
| LangGraph | Stateful agent graphs | Direct agent control plane |
| LlamaIndex | Indexes & query engines | Retrieval inside agents |
| CrewAI / AutoGen | Multi-agent teams/chats | Multi-agent systems |
| PydanticAI | Typed agent I/O | Reliable tool contracts |
| Haystack | Search/RAG pipelines | Retrieval subgraphs for agents |
Minimal RAG Pipeline Sketch
Volume 14 → Volume 15 Bridge
Chunks & retrieval
Vectors at scale
Pipelines & agents
Loops, tools, memory
Haystack pipelines are excellent retrieval subgraphs inside larger agents: an agent (LangGraph/PydanticAI/Crew) can call a Haystack RAG pipeline as a tool, then plan next actions with Volume 15 patterns—memory, reflection, multi-agent handoffs.
Strengths
- Explicit, testable pipelines
- Strong IR/RAG heritage
- Clear component contracts
- Production search mindset
Tradeoffs
- Less “agent playground” than CrewAI
- Pipeline design overhead
- Need document store ops
- Ecosystem overlaps others
“One orchestration framework must do everything.” Mature stacks mix: Haystack or LlamaIndex for retrieval pipelines, LangGraph for agent control, PydanticAI for typed tool I/O, Qdrant/Milvus for vectors. Composition beats monoculture.
Knowledge Check
- Short Answer: What is a Haystack pipeline? Answer: A graph of components connected to process data for search/RAG.
- True/False: Components have defined inputs/outputs you connect. Answer: True.
- Multiple Choice: Haystack is especially associated with: (a) only CSS, (b) production search/RAG pipelines, (c) CUDA drivers. Answer: (b).
- Short Answer: Name one component type in a RAG pipeline. Answer: Embedder, retriever, ranker, prompt builder, generator (any).
- True/False: Haystack replaces the need for Volume 15 agent concepts. Answer: False.
- Multiple Choice: A good Vol 15 pattern is to treat RAG pipelines as: (a) illegal, (b) tools/subgraphs for agents, (c) only batch ETL. Answer: (b).
- Short Answer: Why prefer explicit pipelines? Answer: Testability, clarity, production debugging.
- Short Answer: Name two other 14.3 frameworks and their focus. Answer: e.g. LangGraph=state graphs; CrewAI=role crews; PydanticAI=typed agents (any two).
- Multiple Choice: Mixing frameworks is: (a) always forbidden, (b) often pragmatic, (c) only for CNNs. Answer: (b).
- True/False: Volume 14 ends by bridging into AI Agents (Vol. 15). Answer: True.
Key Takeaways
- Haystack builds explicit RAG/search pipelines from composable components.
- It caps Vol. 14 orchestration beside LangChain, LlamaIndex, and agent frameworks.
- Retrieval pipelines become tools inside Volume 15 agents.
- Choose stores (14.2) and orchestrators (14.3) by control, scale, and typing needs.
- Next volume: AI Agent—loops, tools, memory, multi-agent systems.
Capstone: Teams propose a full stack—one vector DB from 14.2 + one primary orchestrator from 14.3 + how an agent in Vol 15 will call RAG as a tool. 5-minute architecture pitches.
Lab: Implement the indexing + RAG pipelines above on a 10-document corpus; swap InMemory for a Module 14.2 store if time allows.
Recap: Haystack pipelines close Volume 14’s orchestration story. Continue to Volume 15 — AI Agent.