Building without a framework

Lesson 3 of 4 in The Framework Landscape: Pick One (or None).

Here is the secret the landscape lesson was circling: the core of every framework on that page is the same ~100-line loop. Call the model with a system prompt and tool schemas. If the response contains tool calls, execute them, append the results, and go again. If it does not — or a stopping condition fires (max turns, budget, explicit done-signal) — stop. That is the whole agent loop, and you can own it end to end.

The vendors say so themselves. Anthropic describes the Claude Agent SDK’s core as gather context → take action → verify work → repeat. Strands positions itself as “build an agent harness and control it end-to-end” — a model, tools, and a prompt around an in-process loop. LangGraph calls itself deliberately low-level. The frameworks differ in the plumbing around the loop, never in the loop.

The loop you would own

  1. Task arrives
  2. Assemble context

    System prompt + task + conversation so far + tool results. This is context engineering — the part that stays hard with or without a framework.

  3. Call the model with tool schemas

    One API request. Function calling is a provider-API feature, not a framework feature.

  4. Tool calls in the response?
  5. Execute tools, append results

    Validate arguments, enforce least privilege, capture output. Your code — visible, loggable, gateable.

  6. Stopping condition hit?

    Max turns, token budget, wall-clock limit, or the model signalling done. Always enforce one in code.

  7. Return the result

You skipped the framework. What do you now own? — Retries and rate limits

Every 429 and 529, every transient timeout, every partial stream. A few dozen lines with exponential backoff — annoying, well-understood, and yours forever.

— State and resumption

Your loop’s state is a message list in memory. The moment you need to survive a crash mid-run, resume tomorrow, or audit step 7 next month, you are building checkpointing — serialize the message list and tool results per turn. This is the single strongest reason teams graduate to LangGraph-shaped tools or durable execution engines.

— Tracing

Print statements stop scaling around the third tool. You will want structured spans per model call and tool execution. You can emit OpenTelemetry yourself — just know the GenAI semantic conventions were still marked Development status in September 2026, so attribute names may shift under you either way.

— Context management

Long-running loops overflow the context window. Truncation, summarization, and compaction are exactly the invisible framework behaviours that cause mysterious quality cliffs — owning them means you decide what the agent forgets, which is a feature, and you must implement it, which is a cost.

— The graduation trigger

The honest heuristic: when your hand-rolled loop grows checkpointing, subagent spawning, and a trace viewer, you have written a framework — an unmaintained one, with a team of one. That is the moment to adopt one deliberately, importing the shape you have already validated. Do it because you hit the wall, not because a star count told you to.

Interactive checkpoint quiz (1 questions) — open this page in a browser to take it.