← All sessions, cheat sheets & labs
Week 6 · Field guide · Decision matrix

Which tool, when

The whole field guide on one page. Not a ranking, a decision: every tool mapped to the constraint that should make you reach for it, and nothing before then.

The one rule

Start with the simplest thing that works.

Every tool here earns its place by removing a real, named constraint: a cost you cannot hold, a failure you cannot catch, a scale you cannot serve. Add it then, not before. A tool adopted early is a dependency you now operate, debug, and pay for while it solves a problem you did not have yet.

Course principle

The architecture is the product. Frameworks come and go (Humanloop sunset, AutoGen folded into the Microsoft Agent Framework, Promptfoo acquired). The decisions you make about the code / model boundary, the budget, the threat model, and the eval loop outlive all of them.

The decision path

Ask these in order.

  1. Do you even need a model here?If a rule, a lookup, or plain code answers it, do that. The cheapest, most reliable call is the one you never make.
  2. Workflow or agent?Most tasks want a fixed workflow. Reach for an agent only when the task must decide its own steps at runtime. Start with the five workflow patterns.
  3. Vendor SDK or framework?A single agent on OpenAI wants the OpenAI Agents SDK. Reach for LangGraph or a multi-agent framework only when the control flow outgrows what the SDK can express.
  4. Have you put a number on it?Before you add a gateway or a cache, know your per-request cost and latency budget. Optimize against the number, not a hunch.
  5. Can you catch it when it breaks?No tool ships without tracing and an eval that fails on a regression. Observability and evals are not week-five polish, they are the seatbelt.

The matrix

Reach for it when.

Week 1 · Orchestration & the boundary
ToolReach for it when
LangGrapha multi-step or branching flow needs explicit control, durable state, or human-in-the-loop.
CrewAIa task genuinely splits into distinct roles and you want a multi-agent crew fast.
OpenAI Agents SDKa single agent on OpenAI wants tool use, memory, and tracing with no framework tax.
Microsoft Agent Frameworkenterprise multi-agent in a .NET or Azure shop.
Pydantic AIa Python team wants type-safe agents with validated outputs.
Instructoryou need reliable, schema-validated structured output (in TS, Zod does this).
DSPyyou have a metric and want prompts optimized against it, not hand-written.
Week 2 · Context & retrieval
ToolReach for it when
LlamaIndexa document-heavy RAG pipeline with many sources needs connectors and query engines.
Haystackyou want explicit, testable RAG pipelines over ecosystem size.
Vector databasesyou need similarity search: start with pgvector, move only when a constraint forces it.
Cohere Rerankretrieval returns too much noise and you need precision on the top few.
Week 3 · Cost, latency & reliability
ToolReach for it when
LiteLLMyou want one OpenAI-shaped API over many providers, with budgets and fallbacks, self-hosted.
Portkeyyou want routing, caching, guardrails, and observability in one gateway.
OpenRouteryou want the widest model catalog with zero infrastructure.
Semantic cachingrepetitive or overlapping queries let you skip the model on a near-match.
vLLM & Ollamadata must stay in your infra, or volume makes self-hosting cheaper than API calls.
Week 4 · Agent architecture & security
ToolReach for it when
NeMo Guardrailsyou need structured, auditable input/output/dialog rails declared in config.
Lakera Guarduntrusted input reaches your prompts and you want managed injection and PII detection.
Guardrails AIyou want composable output validators with automatic repair.
Llama Guard & Rebuffyou want open-weight, self-hosted safety and injection classifiers.
MCPyou have multiple tools or data sources to expose to agents through one standard.
Week 5 · Evals & observability
ToolReach for it when
Langfuseyou want open-source, self-hosted tracing, prompt versioning, and evals.
LangSmithyou build on LangChain or LangGraph and want the richest native tracing.
Arize Phoenixyou want built-in eval metrics and drift detection out of the box.
Ragasyou need to score a RAG pipeline on faithfulness and relevance.
Promptfooyou want CI-runnable regression and red-team tests from a config file.
DeepEvala Python team wants evals that feel like pytest.
Braintrustyou want a managed eval workflow with datasets and experiment history.
Heliconeyou want logging and cost dashboards by changing one line.
OpenTelemetryyou want to instrument once and stay backend-agnostic.

Principles that outlive any tool

Four things the churn cannot take.

  1. Start simple.Workflow before agent, code before model, one provider SDK before a framework.
  2. Validate the boundary.Never trust raw model output. Schema-check every input and output, in code.
  3. Evals before optimization.You cannot improve, cache, or route what you do not measure. Build the ruler first.
  4. Do not marry a vendor.A thin seam (a gateway, your own llm.ts) keeps every choice above reversible.