Scoped memory
Tenant, workspace, user, role, and session lanes backed by SQLite/FTS retrieval and leakage tests.
control layer for AI agents
Muster is the control layer where independent AI systems assemble, route through policy, and leave an auditable trail.
Many moving parts. One controlled runtime.
pnpm --package=@musterhq/cli dlx muster demo
Muster does not try to be the AI. Muster controls how AI behaves.
20-second tour
The CLI demo shows the loop Muster is built around: a prompt enters the harness, scoped memory is recalled, a governed run completes, tokens are recorded, and integrity can be checked from the terminal.
the agent harness you can audit $ muster demomuster demo — provisioned an isolated workspace and a live stub model service. > Where do we deploy? (recalled 1 scoped memory) Muster deploys to uat-erp.example.com (recalled from scoped memory). > Summarize the day's work. Demo run complete. Every token above is real, recorded to the ledger. run model in out est cost$ waste session------------------------------------------------------------------------------------------------run_2f9c41a8 demo/demo-model 48.1k 412 ~ 0.0061 6.2x ! oneshotrun_5b1e07d3 demo/demo-model 1.8k 128 ~ 0.0004 - oneshot totals by model runs in out cost$ waste-runs--------------------------------------------------------------------------------demo/demo-model 2 49.9k 540 0.0065 1 ! integrity check: OK — 2 runs, 0 corrupt, 0 duplicate, 0 drift, 0 poisoned.That was a real run loop: scoped memory recall, token ledger, integrity verification. $ muster benchmarkscenario turns naive muster reduction replay-overhead--------------------------------------------------------------------------------------codebase-refactor-20 21 84.6k 42.7k 49.6% 90.5%incident-triage-30 31 144.9k 60.5k 58.2% 93.6%erp-data-audit-40 41 205.5k 79.5k 61.3% 95.1%research-synthesis-25 26 160.0k 67.7k 57.7% 92.3%long-support-thread-50 51 280.8k 104.9k 62.7% 96.1%--------------------------------------------------------------------------------------AGGREGATE 170 875.8k 355.2k 59.4% 94.2% Muster reduced naive token cost by 59.4% across these scenarios.Deterministic — no model calls.$
The problem
Long-running agents accumulate state. Without a harness, context grows, token costs disappear, memory becomes unsafe, tools get called without governance, and learning happens without tests.
The solution
Muster keeps governance outside the model provider. The agent can use tools, memory, MCP servers, browsers, and app surfaces, but the harness owns the ledger and boundaries.
Tenant, workspace, user, role, and session lanes backed by SQLite/FTS retrieval and leakage tests.
Every run records usage, estimates cost where pricing is known, and flags replay waste.
Feedback becomes replayable fixtures before it is promoted into behavior.
Typed tool bundles with declared permissions, secrets, setup guidance, and tests.
Tools, flows, subagents, browser actions, and channel adapters share one evidence trail.
Definitions
A governed agent harness is the control layer around an AI agent: memory scope, token accounting, tool policy, provider routing, channel boundaries, and eval evidence. Muster is an AI agent harness for production systems where a long-running assistant may use MCP tools, browser automation, Frappe / ERPNext context, Slack or Telegram channels, and private model routes without losing the audit trail.
The open-source TypeScript harness for scoped memory, token ledger, MCP policy, channel adapters, and eval-gated learning.
MCP servers become safer when install, auth, allowlists, result caps, and token visibility sit outside the model.
Frappe AI needs DocType, field, workflow, role, and permission context instead of generic ERP answers.
Use cases
Use Muster where agents need persistent context, governed tools, and an audit trail across real systems.
Route browser-capable work through setup, evidence capture, and approval-aware tool policy.
Build module, DocType, field, workflow, and docs context through a plugin instead of bloating the core binary.
Attach MCP servers with include/exclude policy, result caps, circuit breakers, and OAuth setup.
Connect app events and web clients to governed runs through the gateway and surface packages.
Keep memory, sessions, token spend, feedback, and evals visible over days or weeks.
Capability packs
Muster is not only a terminal chat. It ships setup surfaces, readiness checks, and policy boundaries for channel operators, MCP servers, providers, browser work, and app-specific packs.
Bring the same governed run loop behind real team and customer surfaces.
Connect external tools with explicit setup links, env checks, OAuth guidance, include/exclude policy, and result caps.
Run web QA, browser evidence capture, Playwright-style inspection, and enterprise web-app flows through the same audit trail.
Build context around sites, installed apps, modules, DocTypes, fields, reports, scripts, workflows, and production runbooks.
Keep governance outside the model provider while routing to cloud, open-source, private, local, and CLI-auth runtimes.
Use governed runs for reports, dashboards, generated docs, data checks, release notes, and repeatable eval evidence.
How it works
The CLI and gateway feed the same run loop. Providers answer; Muster owns the scoped memory, token ledger, MCP policy, capability packs, flows, and eval evidence.
Terminal chat, webhook channels, and web surfaces enter one governed envelope.
Routes to cloud APIs, Gemini, open-source/self-hosted servers, aggregators, Pi, private endpoints, and optional CLI-auth runtimes.
Capability packs, MCP servers, browser tools, and flows are policy-wrapped.
Scoped SQLite/FTS memory and token records stay local and inspectable.
Integrity checks and eval fixtures keep learning and automation testable.
Proof
Deterministic measurement — no model is called. Across 5 realistic agent tasks (170 turns), a naive replay-everything harness sends 876k tokens; Muster sends 355k — a 59.4% reduction, up to 62.7% on the longest threads. Reproduce with muster benchmark.
| scenario | turns | naive | muster | reduction |
|---|---|---|---|---|
| codebase-refactor-20 | 21 | 84.6k | 42.7k | 49.6% |
| incident-triage-30 | 31 | 144.9k | 60.5k | 58.2% |
| erp-data-audit-40 | 41 | 205.5k | 79.5k | 61.3% |
| research-synthesis-25 | 26 | 160.0k | 67.7k | 57.7% |
| long-support-thread-50 | 51 | 280.8k | 104.9k | 62.7% |
| AGGREGATE | 170 | 875.8k | 355.2k | 59.4% |
Positioning
Muster is a harness for governed execution. It can work alongside agent frameworks, workflow graphs, coding agents, MCP servers, and business apps.
The value is not the prompt box; it is scoped memory, token accounting, policy, and verification around the run.
Flows exist, but the wedge is the harness around runs, tools, memory, providers, and learning.
Capability packs, MCP policy, and channel setup make boundaries explicit before tools act.
Route through cloud APIs, Gemini, open-source/self-hosted servers, aggregators, Pi, private endpoints, and optional CLI-auth runtimes without moving governance into the provider.
Muster separates setup plans, readiness checks, and executable adapters so teams can see what is configured before an agent acts.
Good first issues include docs, examples, Frappe packs, provider adapters, MCP workflows, evals, and demo assets.
Muster is open source and early. The useful next contributions are concrete: examples, demo videos, Frappe packs, provider adapters, MCP auth tests, browser automation recipes, and eval suites.
pnpm --package=@musterhq/cli dlx muster demo