Documentation menu
Start here
IntroductionGetting startedWrite an agentProject anatomyUnderstand Ayjnt
Harness engineeringTwo runtimesHuman interfacesHow agents workHost bridgeAgent capabilities
Callable methodsState & SQLiteSessions & memorySchedulingWorkflowsDurable executionInter-agent RPCSub-agentsToolsInterfaces & integrations
Browser clientRouting & middlewareVoiceBrowser toolsMCPEmailObservabilityCLI
Command overviewnewdevrunbuildcompilemigratedeployAPI reference
AgentAgentClientWorkflow classesLocal & cloudMigrationsExamplesFile conventions
The public API starts with a small set of files. Their location determines routing, generated types, and runtime behavior.
The whole project at a glance
Start with agent.ts. Add neighboring files only when the
agent needs that interface or capability. Folder paths become routes;
the final URL segment chooses a durable instance.
my-agent/
├── agents/
│ ├── app.tsx # optional home dashboard at /
│ ├── middleware.ts # applies to every route
│ ├── inventory/
│ │ ├── agent.ts # /inventory/:instance
│ │ ├── app.tsx # browser interface
│ │ ├── tools.ts # isolated workerd tools
│ │ ├── tools.host.ts # permissioned Bun host tools
│ │ ├── workflow.ts # co-located durable workflow
│ │ └── docs.md # route documentation
│ └── orders/
│ └── agent.ts # /orders/:instance
├── cli.ts # terminal interface
├── package.json
└── tsconfig.jsonFiles and where to learn them
| File | Purpose | Learn it |
|---|---|---|
agent.ts | State, lifecycle, callable methods, and behavior in workerd. | Write an agent → |
app.tsx | Browser UI with a generated, route-bound hook. | Browser client → |
agents/app.tsx | Home dashboard or cross-agent interface at /. | Human interfaces → |
tools.ts | Model tools executed beside the agent in workerd. | Tools → |
tools.host.ts | Explicit file, shell, database, and Bun host capabilities. | Host bridge → |
workflow.ts | Co-located durable, multi-step work. | Workflows → |
middleware.ts | Inherited authentication, logging, and request policy. | Routing & middleware → |
docs.md | Agent-specific documentation behind the same middleware. | Route docs ↓ |
cli.ts | Foreground terminal program powered by Bun. | Run command → |
Routing
agents/research/agent.ts is available at
/research/:instance. The instance segment identifies durable
state: /research/acme and /research/personal are
independent agents.
Route groups
Parenthesized folders organize code and apply middleware without becoming
part of the URL. For example,
agents/(internal)/review/agent.ts still maps to
/review/:instance.
Route documentation
A neighboring docs.md is served at
/inventory/docs and passes through the same middleware as the
agent. Use it for operator instructions or an agent-specific contract;
use this website’s tutorials for framework concepts.