SDK for building hosted multi-agent Mash applications.
Project description
Mash
A Python SDK and host runtime for building self-hosted multi-agent applications.
Mash gives you a Python AgentSpec contract for defining agents, a HostBuilder
for composing them into a multi-agent host, a FastAPI server for deployment, and
a CLI/REPL for interacting with a running host.
Install
pip install mashpy
Requires Python >= 3.10. Set your LLM provider key:
export ANTHROPIC_API_KEY=... # or OPENAI_API_KEY or GEMINI_API_KEY
What Mash Provides
- Multi-agent composition — define a primary agent, add specialized subagents, and compose workflows behind a single host. Agents delegate to each other without a separate coordination layer.
- Durable harness — requests execute through a durable engine and are recorded as replayable runtime events. Retries, restarts, and long-running work just work.
- Human-in-the-loop — agents can pause for approval or ask users questions mid-execution. Interactions survive host restarts.
- Workflows — ordered task sequences with structured output, defined in code or published dynamically at runtime.
- Observability — span trees, trace analysis, telemetry API, built-in dashboard, and CLI trace inspection. No external APM needed.
- Self-hosted interfaces — HTTP API with streaming, CLI, and interactive REPL. Deploy locally, in Docker, or on any cloud.
┌─────────────────────────────────────────┐
│ Durable Request │
│ │
│ ┌─ context ─── memory ──┐ │
│ │ │ │
request ────────► │ │ Agent Loop │ ──► signals │
(cli/api) │ │ think → act → observe │ │ │
│ │ │ ▼ │
│ └─ tools ───── skills ──┘ structured │
workflow ───────► │ ▲ output │
(schedule/trigger)│ │ user interaction │
│ ▼ (approval / ask-user) │
│ │
│ resumable · replayable │
└─────────────────────────────────────────┘
See the product brief for a deeper look at each capability.
Quick Start
1. Define an agent
# my_agent/spec.py
from mash.core.config import AgentConfig
from mash.core.llm import AnthropicProvider
from mash.runtime import AgentSpec, HostBuilder
from mash.skills import SkillRegistry
from mash.tools import ToolRegistry
class PrimaryAgent(AgentSpec):
def get_agent_id(self) -> str:
return "primary"
def build_tools(self) -> ToolRegistry:
return ToolRegistry()
def build_skills(self) -> SkillRegistry:
return SkillRegistry()
def build_llm(self):
return AnthropicProvider(app_id="primary")
def build_agent_config(self) -> AgentConfig:
return AgentConfig(
app_id="primary",
system_prompt="You are a helpful assistant.",
)
def build_host():
return HostBuilder().primary(PrimaryAgent()).build()
2. Serve it
mash host serve --host-app my_agent.spec:build_host --port 8000
3. Connect
mash connect --api-base-url http://127.0.0.1:8000 --api-key secret --agent primary
mash repl
Key Concepts
| Concept | What it is |
|---|---|
| AgentSpec | Abstract contract defining one agent (id, tools, skills, LLM, config) |
| HostBuilder | Fluent builder that composes agents and workflows into an AgentHost |
| ToolRegistry | Register callable tools; built-ins include Bash, AskUser, InvokeSubagent |
| SkillRegistry | Markdown instruction bundles loaded on demand via a meta-tool |
| LLMProvider | Adapters for Anthropic, OpenAI, and Gemini |
| WorkflowSpec | Ordered task chains with structured output, orchestrated by DBOS |
Example: Mash Pilot
Mash Pilot is a full example host app built on the Mash SDK. It demonstrates multi-agent composition, custom REPL commands, workflows, and deployment. Use it as a reference when building your own host.
Build with a Coding Agent
This repo includes CLAUDE.md so coding agents like Claude Code,
Codex, and Cursor can scaffold a Mash-powered agent from a natural language
prompt. Copy it into your project or point your agent at this repo to get
started. The Pilot agent also includes
a build-mash-agent skill for interactive agent scaffolding.
Documentation
- Product brief — what Mash offers and where it fits
- Deployment guide — Docker, cloud, horizontal scaling
- Building agent CLIs — custom CLI development
- CLAUDE.md — full SDK reference for coding agents
- Package overview — subsystem boundaries and module guides
- Contributing — development setup, tests, repo structure
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mashpy-0.4.8.tar.gz.
File metadata
- Download URL: mashpy-0.4.8.tar.gz
- Upload date:
- Size: 215.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af97c5aedd1e98131e86b6b71a101d3a5770e1597e255756ec327c3103470c96
|
|
| MD5 |
5d7d189897b0d80b6c392baa062d9b3e
|
|
| BLAKE2b-256 |
d2704fd741fe541fafad1487b2c1a051851b8d34565b4747bb61766c51ddd48b
|
Provenance
The following attestation bundles were made for mashpy-0.4.8.tar.gz:
Publisher:
publish.yml on imsid/mashpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mashpy-0.4.8.tar.gz -
Subject digest:
af97c5aedd1e98131e86b6b71a101d3a5770e1597e255756ec327c3103470c96 - Sigstore transparency entry: 1761055098
- Sigstore integration time:
-
Permalink:
imsid/mashpy@ee2a3978fea978b37ddd7af6b51cf193f9b65c86 -
Branch / Tag:
refs/tags/v0.4.8 - Owner: https://github.com/imsid
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ee2a3978fea978b37ddd7af6b51cf193f9b65c86 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mashpy-0.4.8-py3-none-any.whl.
File metadata
- Download URL: mashpy-0.4.8-py3-none-any.whl
- Upload date:
- Size: 261.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fc7ab371fbbc2dc2c498fc09592b33b40cd80429caf925d867945412f23edd6
|
|
| MD5 |
1d6eff8f98c734af3cab549b15c77286
|
|
| BLAKE2b-256 |
fcfb52f810facedff60ac3fa49b6e5ff82b22adc2db141966d8f717c322acb86
|
Provenance
The following attestation bundles were made for mashpy-0.4.8-py3-none-any.whl:
Publisher:
publish.yml on imsid/mashpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mashpy-0.4.8-py3-none-any.whl -
Subject digest:
7fc7ab371fbbc2dc2c498fc09592b33b40cd80429caf925d867945412f23edd6 - Sigstore transparency entry: 1761055262
- Sigstore integration time:
-
Permalink:
imsid/mashpy@ee2a3978fea978b37ddd7af6b51cf193f9b65c86 -
Branch / Tag:
refs/tags/v0.4.8 - Owner: https://github.com/imsid
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ee2a3978fea978b37ddd7af6b51cf193f9b65c86 -
Trigger Event:
release
-
Statement type: