If your language model can write JSON, it can build complex agent workflows and execute them securely.
$ npm install @amitdeshmukh/ax-crew @ax-llm/ax @ax-llm/ax-tools
The old way vs. the AxCrew way
Without AxCrew
With AxCrew
// Example: Customer support crew with ACE learning.
// SupportAgent delegates policy questions to
// PolicyLookup and learns from supervisor feedback.
import { AxCrew } from '@amitdeshmukh/ax-crew';
// ACE is optional. Without it, agents
// work perfectly — they just don't
// learn between sessions.
const crew = new AxCrew({
crew: [{
name: "PolicyLookup",
description: "Finds relevant company policies",
signature: "issue:string -> policy:string",
provider: "openai",
providerKeyName: "OPENAI_API_KEY",
ai: { model: "gpt-5.4" },
functions: ["SearchKnowledgeBase"]
}, {
name: "SupportAgent",
description: "Resolves support tickets",
signature: "ticket:string -> response:string",
provider: "anthropic",
providerKeyName: "ANTHROPIC_API_KEY",
ai: { model: "claude-sonnet-4-6" },
agents: ["PolicyLookup"],
functions: ["CreateTicket", "SendEmail"],
// Optional: ACE makes agents learn
ace: {
persistence: {
playbookPath: "./playbook.json"
}
}
}]
});
await crew.addAllAgents();
const support = crew.agents.get("SupportAgent")!;
await support.initACE(); // optional
// Resolve a ticket
const { response } = await support.forward({
ticket: "Charged twice for my sub"
});
// Teach it — remembers next time
await support.applyOnlineUpdate({
example: { ticket: "charged twice" },
prediction: { response },
feedback: "Always offer a refund"
});
// ACE learns rules from human feedback
// and persists them across sessions.
// This file is auto-managed.
{
"sections": {
"billing": {
"bullets": [
{
"text": "Always offer a
refund for billing
errors",
"source": "feedback"
},
{
"text": "Escalate repeat
billing issues to
finance team",
"source": "feedback"
}
]
},
"tone": {
"bullets": [
{
"text": "Use empathetic
language for
frustrated customers",
"source": "feedback"
}
]
}
}
}
Everything you need to ship multi-agent systems. Nothing you don't. Built with AxLLM.
Define your entire crew in JSON. Agents, providers, tools, sub-agents — all config.
Agents learn from feedback. Playbooks persist and improve over time.
Agents write and run code in AxJSRuntime. Permission-controlled, data never leaves your environment.
Agents read and write to a shared key/value store. Coordinate without ceremony.
Connect any MCP server. STDIO, HTTP SSE, Streamable HTTP — all three transports.
Per-agent and crew-level metrics. Tokens, requests, estimated USD — always visible.
Works with every major provider
16 skill files auto-install into Claude Code & Codex.
Ask your AI to build an agent crew. It just works.
Install
$ npm install @amitdeshmukh/ax-crew @ax-llm/ax @ax-llm/ax-tools
Create crew.ts
// Example: RLM data analyzer with sandboxed code execution.
// Agent writes JS to analyze your data locally —
// your data never leaves your environment.
import { AxCrew } from '@amitdeshmukh/ax-crew';
import { AxJSRuntime, AxJSRuntimePermission } from '@ax-llm/ax';
// AxJSRuntime: sandboxed code execution.
// The agent writes JS to analyze your data,
// but runs it locally in a controlled sandbox.
// Your data never leaves your environment.
// Permissions control what code can access.
const runtime = new AxJSRuntime({
permissions: [
AxJSRuntimePermission.TIMING,
// No network, no filesystem, no eval
// — only what you explicitly allow.
]
});
const crew = new AxCrew({
crew: [{
name: "Analyzer",
description: "Analyzes data with code execution",
// DSPy signature: typed inputs → typed outputs
signature: "data:string, query:string -> answer:string",
provider: "anthropic",
providerKeyName: "ANTHROPIC_API_KEY",
ai: { model: "claude-sonnet-4-6" },
// "axagent" = RLM mode: the agent reasons,
// writes code, executes it, and iterates.
executionMode: "axagent",
axAgentOptions: {
// "data" is treated as semantic context —
// compressed and managed automatically,
// never sent raw to the LLM.
contextFields: ["data"],
// The sandboxed runtime from above
runtime,
maxTurns: 20,
// Auto-prune failed reasoning paths
// and re-evaluate with hindsight
contextManagement: {
errorPruning: true,
hindsightEvaluation: true
}
}
}]
});
await crew.addAllAgents();
const analyzer = crew.agents.get("Analyzer")!;
// The agent will:
// 1. Read the data via context fields
// 2. Write JS code to analyze it
// 3. Execute in the sandbox
// 4. Iterate if errors occur
// 5. Return a typed answer
const { answer } = await analyzer.forward({
data: salesCSV, // your data stays local
query: "Which region grew fastest in Q1?"
});
console.log(answer);
console.log(crew.getCrewMetrics());
Run
$ export ANTHROPIC_API_KEY=sk-ant-... $ npx tsx crew.ts
No framework to learn. No boilerplate to write.
Just JSON and your imagination.™