og.rsts.dev
← writing

Pick the Engine, Then the Framework

Listen 0:00 / 0:00

There are two right answers to which agent framework to use: the one an enterprise standardizes on, and the one a builder bets on. LangGraph is the defensible institutional standard. My personal path is Pi as the engine and Flue as the framework on top of it. Here is the strongest case for both, and the layer that matters more than either.

Pick the Engine, Then the Framework
Contents

There are two right answers to “which agent framework should we use?” They are not the same answer, and I have stopped thinking that is a problem.

One answer is for an institution. It has to be staffed, governed, audited, and still running in five years when the people who chose it have moved on. The other answer is for a builder. It has to get out of the way, stay close to the model, and let one person ship something real on a Saturday.

I read a good October harness report this week. It ranks languages, runtimes, and every framework worth naming, and it lands where a lot of enterprise analysis lands: pick the mature, batteries-included option for production and keep the interesting one as a side bet. I agree with most of it. I also made a different choice for my own work, and I want to lay out both cases at full strength before I explain why.

The meta-point everyone agrees on

The report’s best line is not a recommendation. It is a warning: the harness is the part you will most likely replace in two to three years. I made a version of that argument in You’re Renting the Model. Own the Harness. The model is a rental. The harness is what you own. But owning something you will rebuild in three years means the real question is which layer you bet on underneath it, and who is doing the betting.

An institution bets on the standard. A builder bets on the engine. Both bets are rational.

The case for the standard

Here is the strongest version of the LangGraph argument, stated more generously than most of its own fans state it.

LangGraph models an agent as an explicit graph. Nodes, edges, and state you can draw on a whiteboard and hand to a reviewer. In a regulated environment that is not ceremony. It is the difference between “the model decided” and “the system moved from this state to that state because this condition held.” An auditor can read a graph. An auditor cannot read a loop that improvises.

It has checkpointers, so a run can stop and resume. It has interrupts, so a human can approve the step that moves money or sends the email, hours or days later. It has LangSmith for tracing and evals, which means the transcript of every model call and tool call exists somewhere an investigator can find it. I went deep on what that checkpointer does and does not guarantee in The Harness Is Becoming the Runtime, and the honest summary is that it is a serious, production-shaped design.

Then the part that matters most to an enterprise and least to a builder. LangChain and LangGraph reached 1.0 (opens in new tab) a year ago, with a public commitment to no breaking changes until 2.0. It runs in Python and in TypeScript. There is a large pool of engineers who already know it, a vendor that will answer the phone, consultants who can staff a program, and a long list of production references. When a large organization picks one framework for hundreds of teams, the best tool is often not the winner. The winner is the one everyone can hire for, govern, and support at 2 a.m. That is not a timid decision. It is an architecture decision, and a sound one.

The same logic applies in the TypeScript world to Mastra (opens in new tab): an Apache-2.0 core, workflows, memory, evals, and tracing in one coherent framework, with named enterprise customers. If you need one thing that works this quarter, it is a reasonable default.

The case against, also at full strength

Now the builder’s side, argued just as hard.

A graph DSL is a cost when the work is a loop. Most agents I build are a model, a handful of tools, some context, and a stopping condition. Expressing that as nodes and edges adds a layer between me and the model, and every layer is one more place where a new model capability has to be wrapped before I can use it. The frameworks that grew up before agents became autonomous still carry some of that shape.

Then there is ecosystem gravity. LangGraph’s center of mass is Python, and the TypeScript port follows it. I write TypeScript every day. I want the agent to feel like the rest of my code, not like a translation of someone else’s.

And the supply chain is real for everyone. In June, more than 140 Mastra packages on npm were backdoored (opens in new tab) with a credential stealer. That is not a Mastra problem as much as a reminder: a batteries-included framework is a lot of batteries to trust. The more surface you import, the more surface you have to pin, verify, and watch.

None of that makes the standard wrong. It makes it a trade.

My path: the engine first

The choice I made for my own work starts one layer down.

Pi (opens in new tab) is a minimal, MIT-licensed agent toolkit: a unified model API, an agent loop, and a coding agent on top. It is past 1.0 and shipping a release about every week (opens in new tab), and it is the engine under OpenClaw. It does very little, deliberately. It talks to many providers, it runs the loop, and it lets packages extend it.

The reason I care is convergence. When independent projects start building on the same engine, the engine becomes the standard and the framework becomes the ergonomics. That is the layer I want my bet on, because it is the layer least likely to be replaced when the next framework arrives.

Why Flue on top

The framework I am leaning toward is Flue (opens in new tab), from the team behind Astro, the framework this blog runs on. Open its runtime’s package manifest and the first two dependencies are Pi’s agent core and Pi’s model layer. Flue’s own docs put it plainly: it builds on Pi, the open agent harness behind OpenClaw (opens in new tab).

What Flue adds is a programming model I already know. An agent is a function. You compose its harness with hooks:

'use agent';
import { useModel, useSandbox, useSkill, useTool } from '@flue/runtime';
import { local } from '@flue/runtime/node';
import triage from '../skills/triage/SKILL.md';
import { openIssue, searchCode } from '../tools/github.ts';

export function Triage() {
  useModel('anthropic/claude-sonnet-4-6');
  useSandbox(local());
  useSkill(triage);
  useTool(openIssue);
  useTool(searchCode);
  return `Triage a bug report end-to-end: reproduce it,
diagnose the root cause, and attempt a fix.`;
}

That excerpt is trimmed from the Flue README (opens in new tab). Three things in it matter to me. Skills are plain SKILL.md files, the same shape I already use every day in my own assistant. The sandbox is a hook, so it can be local, virtual, or a remote container. And the deploy target is open: Node, Cloudflare Workers, GitHub Actions, GitLab CI, and more. It also ships an OpenTelemetry adapter, a Postgres adapter, and MCP support, so the parts an enterprise cares about are not afterthoughts.

That is the experience side of the argument, and it is a real good. When the agent reads like the rest of your code, more of your people can build one.

The durability contract is the enterprise argument

The part that convinced me is not the hooks. It is a page of documentation most people will skip.

Flue’s durability guide (opens in new tab) defines a contract for accepted work. Every input is recorded before any model work begins, and every accepted submission reaches exactly one terminal outcome: completed, failed, or aborted, no matter how many crashes happen in between. Recorded tool results never run again. An interrupted tool call is not blindly retried, because the runtime cannot know which of its side effects already happened. It settles with an explicit unknown-outcome error that the model sees and can react to.

Then the sentence that earns my trust: Flue records that a tool ran and what it returned, never the effect itself. The discipline is at-least-once execution over exactly-once recording, and if your tool sends a payment or posts a message, you make it idempotent and key it on a stable id.

That is the control side of the argument, coming from the builder’s tool. A framework that tells you exactly where its guarantee ends is easier to audit than one that implies it has none. I would rather design around an honest boundary than discover a hidden one in an incident review.

Language and runtime, briefly

I covered the language question in Python Won’t Run Your Bank, so here is the short version. An agent step is a model call measured in seconds and a tool call measured in hundreds of milliseconds. Your orchestration code is a rounding error next to that. Language speed barely matters for agent logic, so TypeScript wins on streaming, JSON, typed tool schemas, and the number of people who can read it. Rust earns its place in the hot paths around the agent: sandboxes, parsers, gateways, high-density workers.

I use Bun for everything local: installs, tests, scripts, and this blog’s whole pipeline. In production I would still default to Node LTS until the full stack, including observability agents and the durability adapter, has run on Bun under real load. Keep the code runtime-agnostic and that switch becomes a deploy change.

What stays constant whichever harness wins

This is where the two answers meet. Whether the institution runs LangGraph and the builder runs Flue on Pi, the long-lived assets are the same, and none of them belong to the harness.

Tool contracts. Define tools once with a schema and expose them over MCP. That is the main hedge against harness churn, because any harness can call them.

A model gateway. Routing, fallbacks, budgets, redaction, and logging in one place, so swapping a model or a framework does not mean re-plumbing every call.

Traces. Every model call, tool call, and token count captured with OpenTelemetry, stored where audit and evals can reach it.

Evals in CI. Run them before every harness or model upgrade, against real traces, not demos.

Supply-chain hygiene. Lockfiles, exact pinned versions, a one-to-two-week delay before adopting a fresh release, and an allowlist for extensions. That last one applies to Pi packages and MCP servers as much as anything, since both execute code that shapes the agent’s behavior.

Get those right and the harness becomes the replaceable component the report says it is. Get them wrong and no framework will save you.

Two paths, one foundation. Full description below.

Image description

Two paths, one foundation: the institution's standard (LangGraph plus LangSmith) and my path (Flue as the framework on Pi as the engine) side by side, both sitting on the same constants: MCP tool contracts, a model gateway, OpenTelemetry traces, and evals in CI

What I have not solved

Flue is young. It is on its second major version, moving fast, and its roadmap belongs to a framework team with its own priorities. Pi’s durable story is still being worked out, and the experimental pieces will change under me. I accept that churn for my own projects. I would not ask an organization of hundreds of engineers to accept it today.

My preference is a builder’s lean, not a production verdict. If I were choosing one framework for many teams that need to ship next quarter, the standard has advantages I cannot wave away: stability commitments, hiring, support, and references. LangGraph is a defensible choice, and I think the people who make it are usually right for their context.

The thing I am most confident about is that these two paths do not have to compete. With the constants in place, an agent prototyped on Flue and an agent hardened on LangGraph can call the same tools, through the same gateway, under the same traces. The framework stops being a religion and becomes a dependency.

Run the bake-off yourself

Pick one representative agent: one approval step and one tool with a real side effect. Build it in Flue and in whatever your runner-up is. Then kill the process in the middle of the tool call, three times. Count the duplicated effects, the lost work, and how long recovery took.

Then write the one-page runbook for moving that agent to the other framework. If it takes more than a few weeks, the problem is not the framework you picked. It is the boundaries you drew around it.

If this was useful, read The Harness Is Becoming the Runtime for how durable execution moved into the agent loop, and You’re Renting the Model. Own the Harness. for why the harness is the layer you actually own.

Find me on X @orestesgarcia (opens in new tab) or LinkedIn (opens in new tab).