Skip to main content

SDK for building hosted multi-agent Mash applications.

Project description

mashpy

Mash is an SDK and host runtime for building self-hosted multi-agent applications. It gives app developers a Python AgentSpec contract, a host API for composing agents and workflows, a FastAPI server for deployment, and a CLI/REPL for talking to a running host.

What Is Mash?

Mash is organized around three surfaces:

  • SDK and runtime: define agents, tools, skills, workflows, memory, and request execution.
  • API server: serve a Mash host over HTTP, including request streaming, workflow routes, and telemetry.
  • CLI: connect to a running host, open an interactive REPL, inspect sessions, and run workflows.

pilot/ is the in-repo example host app. It uses the same public Mash contracts that external host apps use, and adds Pilot-specific REPL commands such as /changelog [N].

What Is In This Repo?

src/mash/                  Mash package: SDK, runtime, API, CLI, workflows
pilot/                     Example Mash host app built on the SDK
docs/rfcs/                 Protocol and design RFCs
tests/                     Mash and Pilot test suites
Dockerfile                 Base image for Mash host deployments

Quick Start

Create and activate the repo environment:

uv venv
uv sync
source .venv/bin/activate

Run the main test suites:

uv run --extra dev pytest -q tests/mash
uv run --extra dev pytest -q tests/pilot

Run Pilot Locally

Start the Pilot host:

mash host serve --host-app pilot.spec:build_host --host 127.0.0.1 --port 8001

In another terminal, connect the Mash CLI:

mash connect --api-base-url http://127.0.0.1:8001 --api-key secret --agent pilot
mash status
mash agents

Open the Pilot REPL, which includes Pilot-only commands such as /changelog [N]:

pilot repl

The API server also serves the telemetry UI at:

Build Your Own Host

A Mash app defines one or more AgentSpecs and returns a host from build_host():

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 helpful.",
        )


def build_host():
    return HostBuilder().primary(PrimaryAgent()).build()

Serve it with:

mash host serve --host-app my_app:build_host --host 0.0.0.0 --port 8000

For containerized deployments, use the root Dockerfile as the base host image and configure startup with MASH_HOST_APP, MASH_DATA_DIR, and MASH_DATABASE_URL.

Documentation Map

  • Mash package: package overview and boundaries.
  • Runtime: host composition, request execution, persistence, structured output, and runtime internals.
  • Workflows: code-defined workflows, dynamic publishing, task state, and DBOS orchestration.
  • Skills: filesystem and inline skills plus dynamic skill registration.
  • API: HTTP surface, request/response shapes, telemetry, and dynamic publishing endpoints.
  • CLI: mash commands and REPL slash commands.
  • LLM providers: provider adapters, normalized LLM contracts, and provider-native structured output.
  • Masher: built-in workflow-only trace digest and online eval worker.
  • Pilot: example host composition and Pilot-specific REPL behavior.

Other useful module guides:

Development

Use the focused module READMEs above as the source of truth when changing a subsystem. For cross-surface behavior, update tests across the relevant layers:

  • runtime changes: tests/mash/runtime
  • API changes: tests/mash/api
  • CLI/REPL changes: tests/mash/cli
  • workflow changes: tests/mash/workflows
  • Pilot changes: tests/pilot

Before handing off broad changes, run:

uv run --extra dev pytest -q tests/mash
uv run --extra dev pytest -q tests/pilot

RFCs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mashpy-0.3.8.tar.gz (205.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mashpy-0.3.8-py3-none-any.whl (250.4 kB view details)

Uploaded Python 3

File details

Details for the file mashpy-0.3.8.tar.gz.

File metadata

  • Download URL: mashpy-0.3.8.tar.gz
  • Upload date:
  • Size: 205.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mashpy-0.3.8.tar.gz
Algorithm Hash digest
SHA256 d8696f339037dd87e8dfc7a453a0816781fe7a7fe60cebcb3bb381e5f9dde009
MD5 adb3dc818e2f1665612ad46525b47207
BLAKE2b-256 57eedf61d1bf2e0d075dc8aaa0d5051d9a16f23e743ac6191acab3daf8677015

See more details on using hashes here.

Provenance

The following attestation bundles were made for mashpy-0.3.8.tar.gz:

Publisher: publish.yml on imsid/mashpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mashpy-0.3.8-py3-none-any.whl.

File metadata

  • Download URL: mashpy-0.3.8-py3-none-any.whl
  • Upload date:
  • Size: 250.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mashpy-0.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c3fd609c24f28a3722788a5dfbb88c8b9c566fac13ec91081a59acb9237389e6
MD5 d12800278829d8fdffecb875defc4d96
BLAKE2b-256 532a5cc96e3529bee0cf4af1dff0274f81e24a9db9ed6b787f2facf86edad19f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mashpy-0.3.8-py3-none-any.whl:

Publisher: publish.yml on imsid/mashpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page