Frameworks vs architectures
The agent ecosystem exploded: open-source orchestrators, RAG toolkits, role-based "crews," and first-party SDKs from OpenAI, Anthropic, Google, and Microsoft. Naming ten libraries impresses nobody. Showing you know which control model each owns — and when to skip frameworks entirely — does. For a focused Q&A on Deep Agents vs LangChain vs LangGraph and the app types you can build, see Deep Agents, LangGraph & LangChain — Q&A.
Read this after Agentic architectures and Agentic patterns. Architecture chooses the loop; the framework implements it. Pair with RAG and Prompt engineering for the surrounding stack.
LangGraph control plane.
LlamaIndex · Haystack.
CrewAI · multi-role.
Labs + cloud natives.
How to choose in an interview
- Knowledge only → RAG stack (RAG + LlamaIndex/Haystack); agent framework optional.
- Unknown action sequence + side effects → tool loop; LangGraph or a provider Agents SDK.
- Approvals, resume, long runs → graph/workflow with checkpoints (LangGraph + queue/Temporal).
- Explicit specialist roles for a demo → CrewAI / supervisor pattern; harden before prod.
- One model vendor forever → that vendor's agent SDK (less glue, more lock-in).
- TypeScript product surface → Mastra or Vercel AI SDK + your own orchestration discipline.
LangGraph (and LangChain)
LangGraph is the production-oriented control plane in the LangChain ecosystem: you define a state graph (nodes + edges), run an agent/tool cycle as graph steps, and optionally checkpoint state for resume and human-in-the-loop interrupts. Deep Agents is the opinionated harness on top (planning, filesystem, subagents) — full Q&A in Deep Agents, LangGraph & LangChain.
- Best for — stateful agents, branching, retries, HITL, multi-step tools with clear stop conditions.
- Strengths — durable state, conditional routing, LangSmith/observability path, Python + JS/TS.
- Trade-offs — steeper learning curve than "crew" APIs; easy to over-graph simple RAG.
- LangChain — still useful for model/tool adapters and chains; for serious agents, prefer LangGraph's explicit graph over sprawling LCEL soup.
LlamaIndex and Haystack
LlamaIndex shines when the hard problem is data: connectors, chunking, indexes, query engines, and workflows that wrap retrieval + agents. Think document copilots, research over corpora, and RAG agents that need strong ingest.
- Best for — RAG-first products, heterogeneous document sources, retrieval eval loops.
- Agents — available, but don't pick LlamaIndex only to get a tool loop — pick it for the data plane.
- Haystack — pipeline-first (nodes/pipelines), strong for production RAG in Python; good interview alternative when "modular pipelines" fit the story.
LlamaIndex mental model
Documents → Nodes (chunks) → Indexes → Retrievers → Query engines / Workflows. Agents sit on top of query engines. If your pain is ingest quality, start here; if your pain is HITL refunds, start with LangGraph.
CrewAI and AutoGen / AG2
CrewAI models work as a crew of role-playing agents (researcher, writer, reviewer) with sequential or hierarchical processes. Fast to demo multi-agent collaboration.
- Best for — prototypes, content/research pipelines with clear roles, stakeholder-friendly mental model.
- Watch-outs — token cost, non-determinism, weaker "enterprise control" story than graphs unless you add your own guards.
- AutoGen / AG2 — conversational multi-agent pioneer; still useful for research patterns. For new Microsoft-aligned work, prefer Microsoft Agent Framework (AutoGen + Semantic Kernel lineage consolidated).
Provider and cloud agent SDKs
OpenAI Agents SDK
Agents, tools, handoffs, guardrails, sessions, and first-party tracing. Lowest friction if you're already on OpenAI models and want a managed loop. Often provider-flexible via adapters, but the gravity stays OpenAI.
Claude Agent SDK (Anthropic)
Anthropic-first agent runtime emphasizing tool use, longer autonomous runs, and tightly integrated Claude capabilities (files/code/computer-use style features depending on product). Prefer when Claude is the model of record.
Google ADK
Code-first agents aimed at Gemini / Vertex paths, with multi-agent and emerging interoperability (e.g. A2A-style protocols). Natural default for GCP shops.
Microsoft Agent Framework
Enterprise/.NET + Python successor direction from Semantic Kernel and AutoGen: Azure alignment, MCP/A2A-style integrations, org-friendly packaging. Default when the interviewer says "we're a Microsoft stack."
Typed Python and TypeScript options
Pydantic AI
FastAPI-like DX: typed dependencies, structured outputs, agent definitions that feel like application code. Strong when your backend is already Pydantic/FastAPI and you want agents that don't fight the type system.
Mastra / Vercel AI SDK
Vercel AI SDK dominates streaming UI + model plumbing in TS/Next. Mastra pushes further into agent workflows for TypeScript products. Interview angle: frontend/streaming excellence ≠ durable multi-day agents — you may still need a workflow engine.
Others worth naming
- smolagents (HF) — minimal agents; great for learning loops, not a full platform.
- Agno / Phidata-line tools — agent-centric, data/tool oriented; mention if relevant to the prompt.
- Haystack — covered above for RAG pipelines.
- Raw provider SDKs — still valid for a single tool-calling loop with your own max-steps.
Comparison cheat sheet
| Framework | Control model | Sweet spot | Watch-out |
|---|---|---|---|
| LangGraph | Graph + state | Production agents, HITL | Overkill for FAQ RAG |
| LlamaIndex | Indexes + workflows | Document / RAG agents | Not primarily a crew runtime |
| Haystack | Pipelines | Modular RAG prod | Less "agent buzz" API |
| CrewAI | Roles / crew | Multi-role prototypes | Cost + eval discipline |
| OpenAI Agents SDK | Agent + handoffs | OpenAI-centric apps | Ecosystem gravity |
| Claude Agent SDK | Tool-centric agent | Claude-first autonomy | Vendor path |
| Google ADK | Agents + tools | GCP / Gemini | Vendor path |
| MS Agent Framework | Enterprise agents | .NET / Azure | Stack coupling |
| Pydantic AI | Typed agents | Python services | Younger ecosystem than LC |
| Mastra / AI SDK | TS workflows / UI | Next.js products | Pair with durable backend |
What no framework gives you for free
- AuthZ / tenancy — tool credentials per user; never a shared admin key.
- Sandboxing — code/shell/browser isolation and egress allowlists.
- Idempotency — retries must not double-charge (see durable patterns in Agentic architectures).
- Eval suite — golden goals, trajectory metrics, safety cases.
- Cost controls — max steps, model tiers, kill switches.
- Prompt/version ops — templates as code; see Prompt engineering.
Thin adapter layer
Wrap framework calls behind your interfaces (AgentRuntime.run(goal, tools, policy)). Business tools stay framework-agnostic plain functions. When LangGraph/CrewAI/API shifts, you swap the adapter — not 40 product call sites.
Version pinning and upgrades
Pin framework + model versions in CI; run golden trajectories before bumping. Framework 0.x releases break graphs and tool schemas — treat upgrades like dependency major versions, with rollback flags.
Migration and lock-in playbook
Assume you will change frameworks once. Design for that day:
- Week 0 — extract tools as plain functions; no framework imports inside domain code.
- Week 1 — define
AgentRuntimeinterface:run(goal, tools, policy) → RunResult. - Week 2 — implement adapter for current framework; golden trajectories pass.
- Cutover — feature flag 5% traffic to new orchestrator; compare task success and $/run.
- Exit — delete old adapter when metrics match for 2 weeks.
| Lock-in vector | Risk | Mitigation |
|---|---|---|
| Prompt format proprietary | Hard to switch models | Store prompts as your templates; map at edge |
| Trace SaaS only | Blind without vendor | OTel export required |
| Tool schema DSL | Rewrite all tools | JSON Schema / OpenAPI as source of truth |
| Checkpoint format | Can't resume old runs | Own run store; framework checkpoint optional |
In your interview
Prompts: "Which framework would you use?" "LangChain vs LlamaIndex?" "Design a multi-agent research system" "We're on Azure/GCP/OpenAI — what do you pick?"
What to say out loud
"I'd pick the control model first. For a durable support agent with refunds, LangGraph with checkpoints and HITL before write tools — or the OpenAI Agents SDK if we're standardized on OpenAI and want faster delivery. Knowledge answers go through RAG with LlamaIndex-style ingest. I wouldn't start with CrewAI for production money movement; I'd use roles later if evals show a single agent thrashing. Either way we own tool ACL, sandboxes, max steps, and a golden-task suite."
- Name 2 frameworks max with a reason — not a laundry list.
- Tie the choice to stack constraints (language, cloud, model vendor).
- Admit trade-offs (speed vs control vs lock-in).
- Separate RAG libraries from agent runtimes.
- Mention what you'd build if frameworks disappeared tomorrow (plain tool loop).
Cost and delivery levers
Extended decision matrix
| Constraint | Pick | Why |
|---|---|---|
| Need HITL + resume in Python | LangGraph (+ Temporal if days-long) | Checkpoints, interrupts |
| Docs/PDF hell | LlamaIndex / Haystack | Data plane strength |
| Stakeholder demo next week | CrewAI or OpenAI Agents SDK | Fast roles / handoffs |
| All-in on Anthropic | Claude Agent SDK | Ecosystem fit |
| GCP / Gemini | Google ADK | Vertex path |
| .NET / Azure | MS Agent Framework | Org standard |
| FastAPI typed services | Pydantic AI | DX + schemas |
| Next.js streaming UI | Vercel AI SDK ± Mastra | Frontend path |
| Strict multi-cloud + compliance | Thin custom loop + Temporal | Minimal lock-in |
Framework exit drill
Failure modes to mention
Call out at least one dependency failure (DB down, cache stampede, queue lag, region outage) and your mitigation (timeouts, retries with jitter, degraded mode, circuit breaker).
Interview Q&A by level
Practice saying these out loud for agentic frameworks. Interviewers grade clarity and judgment more than buzzwords.
Match depth to the bar: define → trade off → operate. Don't dump principal answers in an entry-level screen.
Wrapping up
Agentic frameworks are accelerators for known patterns: graphs, crews, RAG workflows, and vendor agent loops. Learn the landscape well enough to choose deliberately — then spend your interview capital on tools, safety, durability, and measurement.