Skip to main content

What is Distri?

Distri is a composable AI agent runtime written in Rust. You can run it as a standalone server, invoke agents directly from the CLI, or embed the SDK to stream real-time agent experiences inside your product.

Three steps to ship an agent

1. Define your agent

Create agent.md using the maps demo as a template.

2. Run the server

Start distri serve to expose HTTP and SSE APIs (A2A-compatible).

3. Integrate your product

Embed the <Chat /> component or call the HTTP endpoints.

This demo showcases embedding distri directly within a Maps application, integrating with Tools. See the guide for full instructions.

Sample interactive experience in Maps

A2A compatibility and core HTTP routes

Distri implements the A2A JSON-RPC spec for agent invocation. Core endpoints:

  • GET /agents/{agent_name}/.well-known/agent.json — Agent Card (A2A)
  • POST /agents/{id} — A2A JSON-RPC requests (streams via SSE when enabled)
  • GET /agents — List registered agents
  • GET /agents/{id} — Get agent definition (includes tools)
  • POST /webhook/agent — Trigger agent with a structured payload

See Running as a standalone server for the full route list (threads, tasks, workflows, TTS, etc.).

Using distri in CLI mode

distri -h
Usage: distri [OPTIONS] [COMMAND]

Commands:
list List available agents
list-tools List available tools
run Run agent in interactive chat mode or execute a single task
serve Start the server (API only by default, use --ui to enable web interface)
toolcall Call a specific tool directly (equivalent to /toolcall slash command)
publish Publish a plugin to the DAP registry
validate-prompt Validate custom agent prompt templates
generate-prompt Generate and print the planning prompt for an agent with a given task
generate-response Generate and stream the LLM response with parsed tool calls (without agent loop execution)
help Print this message or the help of the given subcommand(s)

Options:
-c, --config <CONFIG> Path to the distri.toml configuration file
-v, --verbose Verbose output
--agent <AGENT> Agent name to use (defaults to 'distri')
--input <INPUT> Input data as JSON string or text
-h, --help Print help
-V, --version Print version

Sample execution

distri run search_agent --task "who is the prime minister of singapore"
⏺ Thought for 2.2 seconds

⏺ search({ "query": "current prime minister of Singapore", "limit": 1})
⏺ Thought for 1.3 seconds

⏺ final({ "input": "The current Prime Minister of Singapore is Lawrence Wong, who assumed office in 2024."})
The current Prime Minister of Singapore is Lawrence Wong, who assumed office in 2024.

Highlights

  • Built in Rust for fast, predictable execution.
  • Operate agents via CLI, API-only server, or embedded UI.
  • Extend the runtime with modular plugins and MCP-compatible tools.
  • Stream events, tool calls, and final answers into any experience.

Next steps