And it's fucking simple.
Seriously. This is the whole thing:
import { useInput, useModel } from "@opencomputer/agent";
export default function Agent() {
const input = useInput();
useModel("anthropic/claude-sonnet-4.6");
return `Be concise and practical. Current request: ${input.text}`;
}
That's an agent. Not a diagram of an agent. Not a "reference architecture." An agent. It's deployed to production at the bottom of this page in four commands.
An agent is a function. It takes an input and returns instructions. That's it. Something else runs the loop, calls the model, executes the tools, streams the tokens, keeps the conversation around, and versions your deploys. That something else is a runtime. You don't write runtimes. You write functions.
You have been told that building an agent means:
It doesn't. All of that is infrastructure pretending to be your product. Your product is the function.
Input comes in. Your function runs. It says "here's the model, here are the tools, here's what to do." The runtime does the rest. Ordinary code, ordinary control flow. Want a tool only when the user asks for research? That's an if statement:
export default function Agent() {
const input = useInput();
useModel("anthropic/claude-sonnet-4.6");
if (input.text?.includes("research")) {
useTool("web-search");
useSubagent("researcher");
}
return "Answer directly. Research and verify when you can.";
}
No graph. No YAML. No node types. You already know how to write this. You've been writing it since your first if.
You edit a file. It's live. That's the whole feedback loop.
npm run dev
Watches your agent code, syncs every save to a development environment, prints you a URL. Open the playground, talk to your agent, change a line, talk to it again. Session history is kept, every turn is inspectable, and nothing you do in dev touches production. If you've used Vite, you've used this.
npm run deploy -- --alias production
Builds an immutable deployment and points production at it. Sessions that are already running keep the code they started with. Roll back by moving the alias. That's the entire deployment story and it fits in one line, which is how you know it's not lying to you.
There is no server for you to run. There is no server for you to keep running. There is no 3am page because the agent loop OOM'd. Serverless means serverless.
The model is a string. Change the string.
useModel(
needsDeepReview
? "anthropic/claude-sonnet-4.6"
: "anthropic/claude-haiku-4.5",
);
provider/model. Pick per request if you want. Pick a cheaper one for the easy path and a smarter one for the hard path. When a better model ships next month, you change a string and redeploy. You never see a provider API key. It never ends up in your repo. Your agent is your code, not your vendor's SDK.
Because of course they are. JSON Schema in, whatever you want out:
import { defineTool } from "@opencomputer/agent";
export const latestStories = defineTool({
name: "latest_hacker_news_stories",
description: "Fetch the current top Hacker News stories",
input: { type: "object", properties: { limit: { type: "number" } } },
async run({ input }) {
const ids = await fetch(
"https://hacker-news.firebaseio.com/v0/topstories.json"
).then((r) => r.json());
return ids.slice(0, input.limit ?? 10);
},
});
Then useTool(latestStories) in your agent. Need an MCP server? useMcpServer(...). Need to delegate? useSubagent(...). Need instructions bundled with files? Put a SKILL.md next to the agent. Every capability is one line, and it's only attached when your code says so.
Four steps. You own step 2. If your architecture diagram has more boxes than this list has numbers, the boxes are the problem.
npm create @opencomputer/start@latest my-agent
cd my-agent && npm install
npx --package @opencomputer/cli opencomputer login
npm run dev
Edit opencomputer/agents/hello-world/agent.ts. Save. Talk to it. Then:
npm run deploy -- --alias production
You now have an agent in production. It took less time than reading this page. Go build the actual thing you wanted to build.
Read the docs · Quickstart · OpenComputer
This page is one HTML file with five lines of CSS, which is four more than it needs. Shamelessly in the spirit of motherfuckingwebsite.com. Built on OpenComputer.