Reusable components
Define an agent once, pass it props, and use it in different workflows. Components can return text, JSX, or async results.
AML is a TypeScript framework for building AI agents. Write reusable JSX components to connect agents, give them tools, and pass their results to the next step.
WeeklyStandup.tsx
<Agent provider={codex}>
<Mcp use={slack} />
post our weekly standup:
{synthesis}
</Agent>
why aml
Most AI SDKs are designed around chat: send a message, call a model, stream a response. Agentic workflows need much more around that conversation. Agents need tools, permissions, somewhere to run, and files they can keep between runs. AML brings those pieces together in reusable JSX components, with TypeScript for branching and data flow.
Define an agent once, pass it props, and use it in different workflows. Components can return text, JSX, or async results.
Use OpenCode, Codex, GitHub Copilot, GLM, or Pi. Choose a provider for each agent in the tree.
Run commands in a Sandbox and keep files between runs with a Workspace. AML acquires and releases both.
Inspect agent turns, tool calls, timings, and failures through structured traces. Set limits and cancel runs from your application.
how it works
AML resolves nested components before the agent that consumes their results. JSX defines dependencies; TypeScript handles branching and data transformation. <Parallel /> runs independent branches concurrently.
Tools are granted to individual agents. Sandboxes and workspaces apply to the components nested inside them, and AML handles their setup and cleanup.
parallel-review.tsx
explicit concurrency, composed results
import { Agent, Parallel, System, Tool } from "@aml-jsx/sdk"
function CorrectnessLane() {
return <Agent provider={OpenCode}>
<Tool use={ReadSource} />
Review src/index.ts for correctness defects.
</Agent>
}
function MaintainabilityLane() {
return <Agent provider={OpenCode}>
Review src/index.ts for maintainability issues.
</Agent>
}
function Review() {
return (
<Agent provider={OpenCode}>
<System>Synthesize evidence without inventing findings.</System>
<Parallel>
<CorrectnessLane />
<MaintainabilityLane />
</Parallel>
Produce the final review.
</Agent>
)
}
const result = await runtime.evaluate(<Review />)Start with an agent. Add a Sandbox when it needs an execution environment, and a Workspace when its files need to survive the run. Configure each through its own provider.
integrations
Use OpenCode, Codex, GitHub Copilot, GLM, or Pi with local execution, Docker, Daytona, or Modal. Keep files locally or in S3-compatible storage. Providers let you change the agent, execution environment, or storage without rewriting the workflow.
providers
all from @aml-jsx/sdk
agent
sandbox
workspace
agent · sandbox · workspace
import {
Agent, AmlRuntime, Sandbox, Workspace,
opencodeAgent,
localSandbox,
s3Workspace,
} from "@aml-jsx/sdk"
const provider = opencodeAgent({ model: "opencode-go/deepseek-v4-flash" })
const sandbox = localSandbox({ workspace: "./project" })
const workspace = s3Workspace({ bucket: "agent-workspaces" })
const runtime = new AmlRuntime()
await runtime.evaluate(
<Workspace id="thread-42" load save={{ include: ["**/*.md"] }} provider={workspace}>
<Sandbox provider={sandbox} access="read-write">
<Agent provider={provider}>Summarize this repository.</Agent>
</Sandbox>
</Workspace>,
)Provider combinations require compatible agent executables, sandbox images, and credentials. Check provider compatibility →
bring your own
The same contracts are open to custom providers.
reference
Compose agents, tools, and resources in JSX. Keep application logic in TypeScript.
Nest an Agent inside another Agent to pass its result into the parent's prompt. AML finishes the child before starting the parent. Use evaluate() inside a component when your application needs to inspect or transform a result before continuing.
Read the full guide →<Agent provider={Editor}>
Write a release brief from this review:
<Agent provider={Reviewer}>Review the latest changes.</Agent>
</Agent>get started
Add AML to a Node.js 26+ TypeScript project. To run OpenCode, install its CLI and configure model credentials.
step 1
$ npm install @aml-jsx/sdkCoding with an agent?
$ npx skills add we-are-singular/aml --skill aml-jsxstep 2
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "@aml-jsx/sdk"
}
}step 3
import { Agent, AmlRuntime, opencodeAgent } from "@aml-jsx/sdk"
const runtime = new AmlRuntime({
agentProvider: opencodeAgent({}),
})
const result = await runtime.evaluate(
<Agent>Summarize this repository.</Agent>,
)
console.log(result)Save as workflow.tsx in your project.
contributing
Try AML on a project. Star the repo if it’s useful, and tell us what you’d change.