07. Frameworks & Libraries
Other Frameworks (LlamaIndex, Semantic Kernel, Haystack, PydanticAI, Mastra)
Beyond LangChain, LangGraph, CrewAI, AutoGen, Agents SDK, and ADK, several frameworks cover important niches: LlamaIndex (data/RAG), Semantic Kernel (enterprise plugins/planners), Haystack (production search pipelines), PydanticAI (typed Python agents), and Mastra (TypeScript agents/workflows). Choose by hardest problem — or compose retrieval + orchestration.
What you will learn
- State each framework’s primary sweet spot in one sentence
- Pick a stack from a product constraint (RAG, .NET, TS, types)
- Explain when to compose frameworks instead of forcing one
- Map these tools to Module 07 frameworks you already know
- Answer interview questions with short, solid answers
Definition
“Other frameworks” here means production-relevant agent/LLM toolkits that complement Module 07’s core stack. They are not leftovers — each owns a sharp niche: indexing data, enterprise plugins, search pipelines, typed Python agents, or TypeScript-first agent apps.
A strong engineer does not memorize every API. They map product pain → framework strength, and know when to combine a retrieval layer with a separate orchestrator.
Introduction
This lesson (#10 in Frameworks & Libraries) closes Module 07 after Google ADK. You have depth on major orchestration kits; now survey adjacent options you will see in job posts and RFCs.
Next module: Programming & Technologies — starting with Python for Agentic AI.
Why this survey matters
- Interviews often ask “why not X?” across many names
- Real systems mix retrieval frameworks with agent runtimes
- Language ecosystem (.NET vs Python vs TS) can decide the stack
- Avoid forcing LangChain/CrewAI into every problem
- Know enough to evaluate vendors and open-source PRs
LlamaIndex
- Center of gravity: ingest, index, retrieve, and query your data
- Strong parsers, indices, retrievers, query engines (and agents/workflows)
- Best when document/RAG quality is the hardest problem
- Often paired with LangGraph / Agents SDK / PydanticAI for orchestration
- Think “data framework that grew agents,” not a crew metaphor first
Semantic Kernel
- Microsoft SDK for embedding AI into apps (C#, Python, Java)
- Plugins (skills/functions), planners, and memory as first-class ideas
- Natural fit for Azure OpenAI, Microsoft 365, and .NET shops
- Can sit beside AutoGen for multi-agent collaboration layers
- Enterprise governance and plugin security matter as much as prompts
Haystack
- deepset’s component + pipeline framework for search, RAG, and NLP apps
- Explicit, debuggable pipelines — production operability is the pitch
- Strong when retrieval/search quality and deployability beat agent novelty
- Plays well with enterprise vector stores and modular components
- Choose Haystack for pipeline clarity; LlamaIndex for data-centric indexing depth
PydanticAI
- Lightweight, type-safe Python agents built around Pydantic models
- Structured outputs and tool arguments as typed contracts
- Excellent with FastAPI teams that already live in Pydantic v2
- Lower abstraction than LangChain — readable agent code
- Great for validated tool I/O even if another kit owns multi-agent graphs
Mastra
- TypeScript-first framework for agents, workflows, RAG, memory, and evals
- Control-flow primitives (then / branch / parallel) for JS/TS apps
- Fits Node/Next-style product teams who want agents in the TS monorepo
- Growing ecosystem with studio/tooling for iteration
- Pick Mastra when TS is non-negotiable; otherwise compare with Agents SDK TS
Decision map
Start from the constraint that hurts most — not from the framework with the loudest Twitter thread.
- Complex documents / knowledge agents → LlamaIndex (or Haystack pipelines)
- Enterprise .NET / Azure plugins → Semantic Kernel
- Typed Python agents + structured I/O → PydanticAI
- TypeScript product agents/workflows → Mastra
- Durable graphs / crews / handoffs → LangGraph, CrewAI, Agents SDK, ADK (prior lessons)
Compose frameworks
Production systems often split layers: your API edge, a retrieval/data kit, an orchestration kit, and typed contracts or enterprise plugins where needed.
- Do not force one framework to own RAG + multi-agent + UI streaming poorly
- Keep auth, budgets, and HITL in your edge regardless of kit
- Pin versions; evaluate on your docs and eval set, not demos
- Swap the orchestration layer later if retrieval quality is already solved
Map to Module 07
- LlamaIndex/Haystack ≈ retrieval depth beside LangChain/LangGraph apps
- Semantic Kernel ≈ Microsoft enterprise peer to AutoGen’s multi-agent focus
- PydanticAI ≈ typed alternative/complement to heavy Python agent stacks
- Mastra ≈ TS peer mindset to Python CrewAI/Agents SDK ecosystems
- All still need Module 05 tool safety and Module 06 pattern literacy
Failure modes
- Framework shopping without a written bottleneck
- Using a RAG kit as a poor multi-agent orchestrator (or the reverse)
- Ignoring language constraints (.NET team forced into Python-only kits)
- No evals — switching stacks every sprint
- Skipping your own authZ because the SDK has “plugins”
Program / implementation notes
For a portfolio project, pick one niche kit and one orchestrator at most. Document why. Module 08 will ground the languages, APIs, and databases these frameworks sit on.
- Next: Python for Agentic AI (Module 08)
Advantages and limitations
- Advantage: niche excellence beats generic one-size frameworks
- Advantage: clear interview stories (“we chose X because…”)
- Advantage: composition keeps layers swappable
- Limitation: more names to track — focus on decision criteria
- Limitation: overlapping features cause analysis paralysis
- Limitation: every kit still needs your evals, obs, and security
Key points
- LlamaIndex = data/RAG-first; agents optional around knowledge.
- Semantic Kernel = enterprise plugins/planners for Azure/.NET.
- Haystack = modular production search/RAG pipelines.
- PydanticAI = typed Python agents and structured I/O.
- Mastra = TypeScript agents, workflows, RAG, evals.
- Compose retrieval + orchestration; choose by bottleneck.
FAQs
LlamaIndex or Haystack for RAG?
Both are strong. LlamaIndex leans data/indexing/query engines; Haystack leans explicit component pipelines and search ops. Prototype both on your corpus if unsure.
Is PydanticAI a multi-agent framework?
It shines at typed single-agent (and agent) loops with structured outputs. For heavy multi-agent graphs you may pair it with or prefer LangGraph/CrewAI/Agents SDK.
Semantic Kernel vs AutoGen?
Semantic Kernel embeds AI into apps via plugins/planners/memory. AutoGen focuses on multi-agent messaging/teams. Many Microsoft stacks use both ideas together.
Should TS teams use Mastra or OpenAI Agents SDK?
Compare on workflow primitives, RAG/evals tooling, and model lock-in. Mastra is TS-framework-complete; Agents SDK is strong if you want OpenAI-native handoffs/guardrails/tracing.
Interview questions
- Name five “other” frameworks and one strength each.
Answer LlamaIndex (RAG/data), Semantic Kernel (enterprise plugins), Haystack (search pipelines), PydanticAI (typed Python agents), Mastra (TypeScript agents/workflows).
- How do you choose among them?
Answer Identify the bottleneck — retrieval quality, .NET/Azure integration, typed contracts, or TS runtime — then pick the niche kit; use Module 07 orchestrators for complex control flow.
- Can you combine LlamaIndex with LangGraph?
Answer Yes — common pattern: LlamaIndex for ingest/retrieve, LangGraph (or another orchestrator) for durable multi-step agent control.
- When prefer Haystack over a general agent framework?
Answer When production search/RAG pipeline clarity and operability matter more than multi-agent collaboration features.
- Why do teams like PydanticAI?
Answer Structured outputs and tools as Pydantic models reduce parsing bugs and fit FastAPI codebases with less framework ceremony.
- What mistake do juniors make with framework choice?
Answer Picking by popularity instead of constraint — then rewriting when RAG, language ecosystem, or typing needs never matched the kit.
Related topics
Practice task
Complete each numbered practice step in a notebook or doc before opening the next lesson.
- Write one-sentence sweet spots for LlamaIndex, Semantic Kernel, Haystack, PydanticAI, and Mastra.
- For a “PDF-heavy support copilot on Azure/.NET,” pick 1–2 frameworks and justify in 3 bullets.
- For a “Next.js product with typed tool results,” pick 1–2 frameworks and justify in 3 bullets.
- Draw a compose diagram: edge + retrieval kit + orchestrator for one of those products.
- Answer interview questions 1, 2, and 3 in two sentences each.