b4run: Next.js Conventions for LangGraph Agents
A young TypeScript repo that borrows Next.js file conventions for LangGraph agents. It solves a real pain, but it is early and you should read the source before shipping.
What you will learn
- What b4run is and why the Next.js analogy matters for LangGraph agents
- How to install it and scaffold a minimal agent route
- Where the convention-over-configuration approach actually saves time
- The limitations you will hit in a young, low-adoption repo
- Which related tools on SynapsFlow are worth pairing with it
What is cacheplane/b4run, and why does the Next.js comparison matter?
If you have built anything with LangGraph, you know the shape of the work: you define a state schema, wire nodes and edges into a graph, compile it, and then write your own thin server layer to expose it. None of that is hard, but every project does it slightly differently, and the boilerplate grows as your agent count does. cacheplane/b4run is an attempt to fix that by borrowing the one convention system most TypeScript developers already know: Next.js.
The pitch is in the repo's own one-line summary — build LangGraph agents like Next.js apps. That means file-based structure and framework-managed wiring instead of hand-rolled graph assembly. The repo is written in TypeScript and surfaced on GitHub Trending, which tells you it is finding an audience among people already living in the Next.js ecosystem. What it does not tell you is maturity: this is a young project, and you should treat it as one.
Why the analogy lands: Next.js won a generation of developers not because routing was hard, but because conventions removed a hundred small decisions. LangGraph has the opposite problem — it gives you powerful primitives and leaves the project shape to you. b4run bets that the missing piece is not more graph features but a standard way to lay agents out on disk.
That is a bet worth taking seriously. If you have ever opened a LangGraph repo and had to read three files just to find where the agent is defined, you are the target user.
How do you install b4run and scaffold your first agent?
Because b4run is a young repo, treat the install as a starting point rather than a guarantee. The standard path for a TypeScript project is a package install from your package manager of choice, then a scaffold step. You should confirm the exact package name and CLI command against the repository's README before you run anything, since a project at this stage can rename things between commits.
# Check the repo README for the current package name and CLI
npm install <package-name-from-readme>
# or
yarn add <package-name-from-readme>
The mental model to hold onto is the Next.js one. In Next.js, a file in a routes directory becomes a route. With b4run, the promise is that a file in an agents directory becomes an agent, and the framework handles the LangGraph assembly and the server exposure for you. That is the whole value proposition: you write the agent logic, the convention writes the plumbing.
A minimal example, following that model, looks roughly like this in spirit — a single file that exports your graph definition, with the framework responsible for compiling and serving it:
// agents/support.ts (illustrative shape, verify against the README)
import { defineAgent } from "<package-name-from-readme>";
export default defineAgent({
state: { messages: [] },
nodes: {
respond: async (state) => {
// your LangGraph node logic here
return { messages: [...state.messages] };
},
},
});
Do not copy that verbatim and expect it to run. The point is the shape: one file, one exported agent, no manual graph compilation and no bespoke HTTP handler. If that is what b4run delivers, it removes the layer most teams rewrite badly on every project.

If you are already running multiple agents and want them to cooperate rather than sit in separate repos, the patterns in running Claude, Gemini, and Codex as one team are a useful complement to a convention layer like this one.
Where does the Next.js analogy actually help — and where does it break?
The analogy helps most at the project-structure level. Next.js taught a generation that file location can carry meaning, and that is exactly the ambiguity LangGraph leaves open. If b4run enforces a directory convention for agents, tools, and state, then onboarding a new engineer becomes reading the tree instead of reading a wiki. That is a real, if unglamorous, win.
It helps less at the runtime level. Next.js has a strong opinion about rendering and data fetching; LangGraph's interesting complexity lives in graph topology, state transitions, and checkpointing. A file convention can standardize where an agent lives, but it cannot decide whether your agent should be a single node or a branching graph with human-in-the-loop interrupts. Expect b4run to give you a clean front door and still leave the hard modeling to you.
There is a second place the analogy strains: the Next.js comparison invites expectations of a mature plugin ecosystem, deployment targets, and years of battle-testing. b4run has none of that yet. The repo is young, the star count is modest, and the surface area is small. That is not a criticism so much as a calibration — you are an early adopter here, not a late one.
One thing the analogy does get right is the audience. Next.js developers are comfortable with convention-driven frameworks and skeptical of configuration sprawl. If that describes you, b4run will feel familiar on day one. If you come from a Python-first LangGraph background, the TypeScript framing is the bigger adjustment.
What are the real limitations, and should you adopt it now?
The honest answer is: adopt it for experiments, not for production without a read-through. The concrete limitations are the ones that come with any young repo. Documentation may lag the code. The API may change between commits. There is no long track record of production deployments you can lean on, and the community around it is small enough that you may be the one filing the first issue for your edge case.
There is also the usual framework trade-off. Convention-over-configuration is a gift until you need to do something the convention did not anticipate, at which point you are reading framework internals to escape the abstraction. With a mature framework, that escape hatch is documented. With a young one, you are reading source. Budget for that.
So who should try it? Teams already building LangGraph agents in TypeScript who feel the boilerplate pain and want a standard project shape. Teams that want to prototype several agents quickly and are comfortable pinning a commit. And anyone curious about where the agent-framework layer is heading, because the Next.js-style convention bet is a reasonable one.
Who should wait? Teams shipping regulated or high-stakes agents that need a stable API contract and a support story. For those, the safer move is to keep your LangGraph assembly explicit and revisit b4run when it has more mileage.
If you want to go deeper on the surrounding ecosystem while you evaluate it, two SynapsFlow pieces are worth your time: the case for a coding agent as the runtime and a rules layer for AI-written code, which addresses the same convention-versus-chaos tension from a different angle. And if your agents touch the browser, giving Claude Code real eyes on the web pairs naturally with a structured agent project.
The bottom line: b4run is a small, young, TypeScript repo with a sharp idea — bring Next.js conventions to LangGraph agents. The idea is sound and the pain it targets is real. Just go in with your eyes open about maturity, and read the README before you read this article twice.
Source and attribution
GitHub Trending
cacheplane/b4run: Build LangGraph agents like Next.js apps.
Discussion
Add a comment