Braj Kishore
JourneyVaultML FoundationsAI PM GuideAgenticNewsWork With MeMentorshipPulseNow
Say hi

Hiring · Building · Investing

Have a system — or a team —that needs to scale?

info@avyxon.ai

Usually replies within a day · track record here

JourneyVaultML FoundationsAI PM GuideAgenticNewsWork With MeMentorshipPulseNow
LinkedInXYouTubeSubstackInstagramThreadsFacebookDiscordGitHubTopmate
© 2026 Braj Kishore · Bengaluru, INThink Big · Start Small · Scale Fast
Agentic engineering
Lesson 09Patterns

Frameworks, honestly

You do not need a framework survey. You need to say, in one sentence per option, what it buys and what it costs. And you need to defend choosing none of them, in front of someone who has already picked one.

Ask someone which framework they use and you learn very little. Ask what is this framework load-bearing for — which part of the system would fall over without it — and you learn almost everything. That second question is what separates a good answer from a merely fluent one.

If the answer is “the loop”, you could have written that yourself. The previous lesson has it in about forty lines. If the answer is “a human approves a step and the process may span a restart”, that is a real capability, and you should pay for it.

So framework choice is a reversibility decision, not a technology preference. How hard would it be to leave?

Everything below was checked at the source while this page was written. Framework claims rot faster than anything else in this curriculum: two of the facts in the trap section were true in a different form a year ago.

Interactive · the prior question, on one screen

Where a framework earns its place, and where it is an afternoon

Not which framework — whether. Read the verdict row left to right: it escalates from “write it” to a capability nothing on the table actually sells you. Select any column for the full version, hedges included.

If you write it yourself
About forty lines — the previous lesson has it
Plain handlers, with the binding in one thin adapter
A dataclass and a dict, until two branches write one field
Persisting is easy; resuming correctly after a deploy is not
Idempotency is yours either way
What a framework adds
A graph runtime you now debug through
A native tool API you would port on the way out
Declared merge semantics rather than improvised ones
interrupt() persists state and waits indefinitely
Not claimed anywhere in the documentation
Verdict
Write it
Own the seam
Depends
Pay for it
Nobody sells it

One column is a real purchase. One is a seam to defend. The column on the right is the one people believe they bought and did not.

What each one is load-bearing for

Select the capabilities you actually need. The useful discovery is usually not which option wins. It is how often the honest answer is that nothing on the table clears the bar.

Interactive · filter by what you need

Which of these earns its place, for your requirements

Select the capabilities you actually require. The table re-sorts, and each option explains itself against your selection rather than in general. Selecting nothing is also an answer.

For this set, LangGraph is the strongest fit at 2 of 2. Read its cost line before you take that as advice — the score measures coverage, not whether the coverage is worth what it charges you.

  • LangGraph2 / 2 on your selection

    A typed StateGraph with reducers, plus checkpointers that persist graph state per thread and stores that persist across threads.

    • Earns itDurable human-in-the-loop

      This is the one thing on the table that is genuinely hard to write yourself. interrupt() can be called inside node code, persists state and waits indefinitely; you resume with Command(resume=value) from a different process hours later.

    What it costs · A graph abstraction you now debug through, and a persistence model whose guarantees are narrower than the word “checkpoint” suggests.

  • Claude Agent SDK1 / 2 on your selection

    Claude Code as a library in Python and TypeScript: the same agent loop, tools, context management, permissions, hooks, subagents and MCP support.

    • PartlyDurable human-in-the-loop

      Permissions gate tool execution and sessions can be resumed or forked, but this is approval inside a session rather than a durable interrupt across restarts.

    What it costs · Claude-only, and it is a harness rather than an orchestrator — no graph, no shared typed state across steps.

  • MS Agent Framework1 / 2 on your selection

    The direct successor to both AutoGen and Semantic Kernel, by the same teams, in .NET, Python and Go — agents, graph-based workflows, middleware, telemetry.

    • PartlyDurable human-in-the-loop

      It advertises state management for long-running and human-in-the-loop scenarios, but the interrupt-and-resume story is less battle-tested in public than LangGraph's.

    What it costs · Azure-shaped defaults, and Microsoft's second framework consolidation in three years. Go is still public preview.

  • No framework0 / 2 on your selection

    Roughly eighty lines around the API: a loop, a tool dispatch table, an iteration cap, a repeat detector.

    • NoDurable human-in-the-loop

      You can persist a run and wait, but resuming correctly across deploys, retries and partial side effects is the hard part, and it is exactly what you would be rebuilding.

    What it costs · You write persistence, tracing, parallelism and human gates yourself — each of which is real work when you actually need it.

  • CrewAI0 / 2 on your selection

    Flows give deterministic control flow — @start, @listen, @router — over typed Pydantic state; Crews are the autonomous role-based unit that runs inside a step.

    • NoDurable human-in-the-loop

      Not what it is for. If a person must approve a step and the process may span a restart, this is the wrong tool.

    What it costs · Token overhead from role narration, and failure attribution that is genuinely hard: model, prompt or data?

  • smolagents0 / 2 on your selection

    A deliberately small library whose README claims the agent logic fits in about a thousand lines, with first-class support for agents that write actions as Python code rather than JSON.

    • NoDurable human-in-the-loop

      No persistence layer, no interrupt, no resumption. Not the problem it set out to solve.

    What it costs · Small by design, so most of what the others provide is simply absent. The code-agent approach also needs a sandbox you must actually run.

smolagentsHugging FaceCrewAI — FlowsCrewAIClaude Agent SDK overviewAnthropic

The trap that costs an afternoon

pip install autogen does not install Microsoft’s AutoGen. That name on PyPI belongs to AG2AI, the community fork — version 0.14.1, released 30 June 2026. That package is itself now on security and critical bug fixes only.

Microsoft’s package is autogen-agentchat. Its repository states plainly that “AutoGen is now in maintenance mode. It will not receive new features or enhancements and is community managed going forward”, and points new users at Microsoft Agent Framework instead.

So: two projects, one name, both in maintenance. Any 2026 tutorial telling you to install autogen is teaching a mistake. Knowing that is a currency signal — you cannot infer it, you can only pick it up by having been in the ecosystem this year.

Microsoft Agent Framework is the successor to both AutoGen and Semantic Kernel. Its own documentation calls it “the direct successor, created by the same teams”, in .NET, Python and Go — Go still in public preview. That page also carries the most honest sentence any framework ships with: “If you can write a function to handle the task, do that instead of using an AI agent.”

LangGraph — the one thing it does better than anyone

A run stops to wait for a human approval. Nobody answers until tomorrow, and the service is redeployed twice overnight. The run has to still be sitting there in the morning. That is human-in-the-loop surviving a process restart, and it is what LangGraph does better than anyone.

interrupt() can be called anywhere in node code. It persists state and, in the documentation’s own words, “waits indefinitely until you resume execution”. You resume by invoking the graph again with Command(resume=value), and that value becomes the return value of the interrupt call. It needs a checkpointer and a stable thread id.

This is genuinely hard to build yourself. It is the strongest single reason to reach for the framework.

escalate.py
from langgraph.graph import StateGraph, START, END
from langgraph.types import interrupt, Command
from langgraph.checkpoint.postgres import PostgresSaver

def confirm_escalation(state):
    # The node RESTARTS FROM THE TOP when resumed: everything above
    # this line runs a second time. Keep side effects below it, or
    # make them idempotent. This is the afternoon it costs people.
    ok = interrupt({
        "question": "Escalate to on-call?",
        "zone": state["zone"],
    })
    if ok:
        page_on_call(state["zone"])        # runs once: after the resume
    return {"escalated": bool(ok)}

builder = StateGraph(State)
builder.add_node("confirm", confirm_escalation)
builder.add_edge(START, "confirm")
builder.add_edge("confirm", END)

with PostgresSaver.from_conn_string(DB_URL) as saver:
    saver.setup()                          # creates tables; idempotent
    graph = builder.compile(checkpointer=saver)
    cfg = {"configurable": {"thread_id": incident_id}}
    graph.invoke({"zone": zone}, cfg)      # pauses here
    # ... a different process, hours later, after a deploy ...
    graph.invoke(Command(resume=True), cfg)
The pause survives a deploy, a crash and a change of process. The comment on line one of the node is not decoration — it is the documented behaviour, and the reason the state read sits after the interrupt rather than before it.
The documented gotcha is the whole afternoon. On resume, the node “restarts from the beginning… so any code before the interrupt runs again”. Any side effect above that line has to be idempotent — safe to run twice — or you will duplicate it. Charge the card above the interrupt and you will charge it twice.

Now be precise about what a checkpointer is not. LangGraph’s persistence layer gives you graph-state snapshots scoped to a thread, plus stores for data shared across threads. Fault tolerance is listed as a use case.

What the documentation does not claim anywhere is automatic retry or exactly-once side effects. The interrupt page puts the idempotency burden explicitly on you.

That is a reasonable design. It is simply not durable execution in the workflow-engine sense, and treating a checkpoint as though it were is how teams discover they have sent two refunds. This distinction is my reading of what the two pages say and do not say; it is worth checking yourself before you repeat it.

CrewAI — and the shape most tutorials get wrong

CrewAI’s Flows give you deterministic control flow — the same path every time — through @start, @listen and @router. State is declared as a Pydantic BaseModel, with a UUID attached to each state so you can track it across runs.

A Crew is the autonomous, role-based unit that runs inside a Flow step. So: deterministic orchestration on the outside, model judgement on the inside. That maps directly onto the workflow-versus-agent distinction from earlier in this curriculum.

Most tutorials still lead with a bare Crew. That is the demo shape. It produces something impressive in ten minutes, and it leaves you no seam at which to be deterministic about anything.

One honesty note. The CrewAI documentation positions Flows as the coordination layer around Crews. It does not itself declare Flows the production default. That framing is mine, and I think it is right, but do not attribute it to them.

The case for no framework

Two credible sources argue for none, and they argue differently. Anthropic — who ship an agent SDK themselves — recommend starting with the API directly. Many patterns are only a few lines of code. And frameworks “often create extra layers of abstraction that can obscure the underlying prompts and responses, making them harder to debug”. That is a debuggability argument.

The 12-Factor Agents argument is sharper, and it is about a ceiling. Teams reach a 70–80% quality bar with a framework. Then they discover that “80% isn’t good enough for most customer-facing features”, and that getting past it “requires reverse-engineering the framework, prompts, flow”. At which point they start over.

Its two load-bearing principles are own your prompts and own your control flow. Note the condition attached, though. If that ceiling is real for your product, adopting a framework early does not save you the work; it defers it and adds a migration.

For proof that the core is small, look at smolagents: its README claims the agent logic fits in about a thousand lines. Small enough to read in a sitting is a genuine production property, not just a teaching one.

The reconciliation: pick your seam

The position that holds up in practice is neither “framework” nor “no framework”. It is to choose your tool layer independently of your orchestration layer. Tools written against MCP survive a framework migration. Control flow written into a framework does not. That single decision is what makes the next migration a week rather than a quarter.

As of the 2026-07-28 revision, MCP also has something none of the frameworks here offer: a formal deprecation policy, with a twelve-month minimum window. A tool layer with a published deprecation policy outlives an orchestration layer without one. That is a better reason to prefer the protocol than any feature comparison.

The 2026-07-28 MCP SpecificationModel Context Protocol · 28 Jul 2026

What to actually adopt, at your size

Two of these are deliberate skips at seed. Both are the kind of thing a small team adopts because it looks like maturity. Saying why you have not adopted them is the stronger signal.

Interactive · calibrate to your stage

What to actually do about this, at your size

Nearly all guidance on this topic is written for one company size and then read by everyone. Pick yours — the list re-sorts, and what you should deliberately not build drops to the bottom.

  • Control flow you can readNon-negotiable

    The sequence of decisions is in code you wrote, thin enough that a new engineer can trace a run end to end.

    At this stage · The 12-Factor argument bites here: teams reach a 70–80% quality bar and then find that getting past it means reverse-engineering the framework.

  • Tools written against MCPDo it

    The tool layer speaks a protocol rather than a framework's native tool API, so it survives an orchestration change.

    At this stage · Now worth real MCP servers for anything more than one team touches. The protocol has a twelve-month minimum deprecation window, which is longer than most frameworks have offered.

  • A model-swap drillDo it

    A scheduled exercise that swaps the underlying model — and, once, the orchestration layer — and measures what breaks.

    At this stage · Quarterly, on the eval suite. This is where you learn whether the abstraction you adopted is load-bearing or decorative.

  • A graph or workflow frameworkCheap version

    LangGraph, CrewAI Flows, MS Agent Framework — an orchestration layer with typed state, edges and a persistence model.

    At this stage · Adopt it for the one workflow that needs it — usually the one with a human approval step — and leave everything else on the plain loop. Do not standardise on it yet.

  • Durable human-in-the-loopCheap version

    A person can approve a step hours later, after a deploy or a crash, and the run resumes where it paused.

    At this stage · A run row in Postgres with a status and a payload survives a redeploy. That is most of the value, and it is a day's work.

Nothing is optional at this stage. That is itself the finding — the cost of the control set is part of the cost of operating here.

A build decision made on a number

🇸🇬 Singapore / Southeast Asia

Grab — building because of a measured constraint, not a preference

3–4×
external-API P99 over P50
+70pp
Thai document accuracy
1B
parameters, built from scratch

Grab built a custom vision LLM for document processing rather than calling an external API, and published the reason as a number. P99 latency on external APIs “can easily be 3 to 4x the P50 latency, which would not be acceptable for Grab’s large scale rollouts”. The cheap adaptation then failed on a specific axis: LoRA struggled with documents in non-Latin scripts such as Thai and Vietnamese. So they moved to full-parameter fine-tuning, which took Thai accuracy up 70 percentage points and Vietnamese up 40.

The engineering lesson transfers straight to framework choice. A build decision is defensible when it names the specific property the bought option cannot provide, measured. “We wanted more control” is not that. “P99 is three to four times P50 and our rollout cannot absorb it” is. Apply the same test to a framework: name the capability it is load-bearing for, and the number or failure mode that made it necessary. If you cannot name either, you are choosing on taste, and you should choose the thin option.

How we built a custom vision LLM at GrabGrab Engineering · 4 Nov 2025

What to remember

  1. 1
    Ask what it is load-bearing for

    If the answer is “the loop”, you could have written that. If it is “a human approves a step and the process may span a restart”, that is a real capability with a real price. Name the capability before you name the framework.

  2. 2
    Checkpoints are not durable execution

    LangGraph's persistence gives you graph-state snapshots per thread. The docs do not promise automatic retries or exactly-once side effects. interrupt() explicitly re-runs everything above it in the node, so any side effect up there has to be safe to run twice.

  3. 3
    Two projects, one name, both in maintenance

    pip install autogen gets you AG2AI's fork, not Microsoft's. Microsoft's autogen-agentchat is in maintenance mode and points at Agent Framework. Budget agent scaffolding as a twelve-to-eighteen-month asset, not a foundation.

  4. 4
    Pick the seam, not the side

    Tools against MCP, control flow thin and yours. That decision is what makes the next migration a week rather than a quarter — and MCP now carries a twelve-month minimum deprecation window, which no framework here offers.

Sources

Every source in this lesson

Primary sources wherever one exists. Where a claim is contested or vendor-reported, the lesson says so at the point it is made.

Read
  • Building effective agentsAnthropic · 19 Dec 2024

    “Start by using LLM APIs directly: many patterns can be implemented in a few lines of code.” Frameworks “often create extra layers of abstraction that can obscure the underlying prompts and responses, making them harder to debug.” Worth noting who is saying it.

  • The 2026-07-28 MCP SpecificationModel Context Protocol · 28 Jul 2026

    Why the tool layer is the seam worth defending: MCP now has a stateless core, header-based routing and a formal twelve-month minimum deprecation window. A tool layer with a published deprecation policy outlives a framework that does not have one.

  • How we built a custom vision LLM at GrabGrab Engineering · 4 Nov 2025

    Chen, Sahu, Ng and Yang. A build-versus-buy decision made on a measured number rather than a preference — external-API P99 latency “can easily be 3 to 4x the P50” — and a cheap adaptation (LoRA) that failed on a specific axis and had to be replaced with the expensive one.

Code
  • smolagentsHugging Face

    The README's claim is the useful one: “the logic for agents fits in ~1,000 lines of code”. Also the CodeAgent argument — actions written as Python rather than JSON — with a README-reported 30% fewer steps, which is a vendor claim on their own benchmark.

  • 12-Factor AgentsDex / HumanLayer

    The sharper version of the argument, and it is about a ceiling rather than about taste: teams “get to 70-80% quality bar”, find that “80% isn't good enough for most customer-facing features”, and then discover that getting past it “requires reverse-engineering the framework”. Factors 2 and 8 are the load-bearing ones.

  • microsoft/autogen — maintenance modeMicrosoft

    “AutoGen is now in maintenance mode. It will not receive new features or enhancements and is community managed going forward.” New users are pointed at Microsoft Agent Framework. Installation is autogen-agentchat, never autogen.

  • autogen on PyPI — published by AG2AIPyPI · 0.14.1, 30 Jun 2026

    The trap, confirmed at the source. The autogen name on PyPI belongs to AG2AI, the community fork, not to Microsoft — and that package is itself now on security and critical bug fixes only. Two different projects, both in maintenance, one name.

Docs
  • LangGraph — InterruptsLangChain

    interrupt() pauses the graph, persists state and “waits indefinitely until you resume”. It needs a checkpointer and a thread id. Read the warning: the node “restarts from the beginning… so any code before the interrupt runs again”, and side effects before it must be idempotent.

  • LangGraph — PersistenceLangChain

    What a checkpointer actually is: graph-state snapshots scoped to a single thread, with stores for data across threads. Fault tolerance is listed as a use case. Automatic retries and exactly-once side effects are not claimed anywhere on the page — which is the point.

  • CrewAI — FlowsCrewAI

    Deterministic control flow via @start, @listen and @router, with state as a Pydantic BaseModel and a UUID per state. The docs position Flows as the coordination layer around Crews; they do not themselves declare Flows the production default — that reading is mine.

  • Microsoft Agent Framework overviewMicrosoft Learn

    “The direct successor, created by the same teams” to both Semantic Kernel and AutoGen, in .NET, Python and Go (Go in public preview). Also the most honest sentence any framework ships with: “If you can write a function to handle the task, do that instead of using an AI agent.”

  • Claude Agent SDK overviewAnthropic

    “The same tools, agent loop, and context management that power Claude Code, programmable in Python and TypeScript.” A harness — built-in file and shell tools, hooks, subagents, permissions, sessions, MCP — rather than an orchestrator with a graph and shared typed state.

Lesson 08
Retrieval, honestly
Lesson 10
Evaluating a framework