SDK and CLI for building Boxy agents
Project description
boxy-agent
Build Boxy agents as ordinary Python packages.
boxy-agent gives you a clean authoring SDK, a packaging flow, and a local runtime contract for agents that wake on events, read context, call tools, emit follow-up events, and return structured results. The same contract powers Boxy's first-party agents.
Why boxy-agent
- Start from plain Python instead of a custom DSL
- Define exactly what data, tools, and events your agent is allowed to use
- Package agents as installable wheels
- Run agents through a consistent event-driven contract
- Keep the authoring surface small enough to learn quickly, but strict enough to ship reliably
Quickstart
Install the CLI with uv:
uv tool install "boxy-agent[packaging]"
boxy-agent --help
If you prefer not to install it globally, use uvx:
uvx --from "boxy-agent[packaging]" boxy-agent --help
Create your first agent:
boxy-agent create-agent automation --project-dir ./email-ops-agent
cd ./email-ops-agent
uv sync
Build a wheel:
uv run boxy-agent package --project-dir . --output-dir ./dist
Install the packaged wheel into the environment where you want to run it, then inspect and execute it:
uv pip install ./dist/*.whl
uv run boxy-agent list-agents --json
uv run boxy-agent run --agent email-ops-agent --event-json '{"type":"start"}'
You can also pass the event as a file:
uv run boxy-agent run --agent email-ops-agent --event-file ./event.json
Event input must decode to a JSON object with:
type: required non-empty stringdescription: optional stringpayload: optional object
boxy-agent run prints a JSON report with the run status, last output, and emitted traces.
What You Build
A Boxy agent project is a normal Python package with Boxy metadata in pyproject.toml.
Minimal layout:
my-agent/
pyproject.toml
src/
my_agent/
__init__.py
agent.py
Minimal metadata:
[project]
name = "my-agent"
version = "0.1.0"
description = "My Boxy agent"
requires-python = ">=3.12"
dependencies = ["boxy-agent>=0.2.0a2,<0.3.0"]
[build-system]
requires = ["setuptools>=69.0"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
package-dir = { "" = "src" }
[tool.setuptools.packages.find]
where = ["src"]
[tool.boxy_agent.agent]
name = "my-agent"
description = "My Boxy agent"
version = "0.1.0"
type = "automation"
module = "my_agent.agent"
expected_event_types = ["start"]
[tool.boxy_agent.capabilities]
data_queries = []
boxy_tools = []
builtin_tools = []
event_emitters = []
Minimal agent:
from boxy_agent import AgentExecutionContext, AgentResult, agent_main
@agent_main
def handle(exec_ctx: AgentExecutionContext) -> AgentResult:
return AgentResult(
output={
"event_type": exec_ctx.event.type,
"message": "hello from boxy-agent",
}
)
Entrypoint rules:
- your configured module must define exactly one function decorated with
@agent_main - the entrypoint must be synchronous
- it must accept exactly one positional execution-context argument
- that argument must not have a default
Two Agent Styles
boxy-agent supports two agent types:
automation: event-driven agents that react to triggers and can declare tool accessdata_mining: analysis-oriented agents that read data, generate insights, and emit events, but cannot declareboxy_tools
Type-specific rules:
automationagents must declare non-emptyexpected_event_typesdata_miningagents must not declareexpected_event_typesdata_miningagents must not declareboxy_tools
The CLI scaffold uses data-mining as the command-line name and writes data_mining into project metadata.
Capabilities
Every agent declares the capabilities it needs up front:
data_queries: named read/query interfaces exposed by the host runtimeboxy_tools: named host actions the agent may invokebuiltin_tools: package-provided tools available in the runtimeevent_emitters: outbound event types the agent may emit
Declared capabilities are validated against the shipped capability catalog during compile and package time. That means an agent fails fast when it asks for a capability that the target runtime does not expose.
SDK Features
The main authoring surface includes:
agent_mainAgentExecutionContext,AgentEvent,AgentResult,AgentMetadata,AgentCapabilitiescompile_agent,package_agentquery_data,list_data_queriescall_boxy_tool,list_boxy_toolscall_builtin_tool,list_builtin_toolsemit_eventmemory_get,memory_set,memory_deletetraceterminatellm_chat_complete
Typical usage patterns:
- use
query_datato pull context from Boxy-connected sources - use
call_boxy_toolto request side effects through the host runtime - use
call_builtin_toolfor package-provided tools - use memory helpers for session or persistent state
- use
emit_eventto schedule downstream work - use
tracefor structured diagnostics
Some SDK surfaces are public but intentionally unconfigured in the standalone runtime by default:
boxy_agent.sdk.llm.chat_complete- built-in
web_search
They stay public because Boxy runtimes can provide them. In a standalone SDK runtime they fail explicitly until a host/runtime provider is configured.
CLI
Main commands:
boxy-agent create-agent <automation|data-mining> --project-dir <dir>boxy-agent package --project-dir <dir> --output-dir <dir>boxy-agent list-agents [--json] [--registry-file <file>]boxy-agent run --agent <name> [--registry-file <file>] (--event-json '<json>' | --event-file <file>)
Use --registry-file when you want runtime discovery to come from explicit packaged-agent registry records instead of only the current Python environment.
Examples
Reference example projects live in this repository:
examples/automationexamples/data_mining
They are meant to stay representative of the published authoring flow.
Develop From Source
If you cloned the boxy-agent source repository:
uv sync --all-extras --dev
uv run ruff format --check .
uv run ruff check .
uv run pyright
uv run pytest
Run the CLI directly from the checkout:
uv run boxy-agent --help
Capability Catalog
The CLI and compile/package APIs load the packaged capability catalog from src/boxy_agent/capability_catalog.toml.
Treat that catalog as the shipped contract for discoverable data queries, Boxy tools, and built-in tools. It is generated data and should not be edited by hand.
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 boxy_agent-0.2.0a2.tar.gz.
File metadata
- Download URL: boxy_agent-0.2.0a2.tar.gz
- Upload date:
- Size: 41.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad2a34d2152d273ec6e5961bbcac91bdcac265a249d07cb2103b884b0a8c18b1
|
|
| MD5 |
b88bc3d13f3712fe129e1e9292c98492
|
|
| BLAKE2b-256 |
97af4ce76be5bd27fb041f4ea518fefbca236c547aa972a4c76fe924374377c0
|
Provenance
The following attestation bundles were made for boxy_agent-0.2.0a2.tar.gz:
Publisher:
boxy-agent-release.yml on boxy-ai/boxy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
boxy_agent-0.2.0a2.tar.gz -
Subject digest:
ad2a34d2152d273ec6e5961bbcac91bdcac265a249d07cb2103b884b0a8c18b1 - Sigstore transparency entry: 1091008186
- Sigstore integration time:
-
Permalink:
boxy-ai/boxy@deac5cea506c0b34fafb9c931fe5833c9dc08b3e -
Branch / Tag:
refs/tags/boxy-agent-v0.2.0a2 - Owner: https://github.com/boxy-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
boxy-agent-release.yml@deac5cea506c0b34fafb9c931fe5833c9dc08b3e -
Trigger Event:
push
-
Statement type:
File details
Details for the file boxy_agent-0.2.0a2-py3-none-any.whl.
File metadata
- Download URL: boxy_agent-0.2.0a2-py3-none-any.whl
- Upload date:
- Size: 51.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8445b068a0a75c9bf355c52a674cc2112bd89ddcbbc5c45818e6df2796f901c
|
|
| MD5 |
f7a91f8e0e4324e09c06fad84578732e
|
|
| BLAKE2b-256 |
6841c58b38bd53dcf84af4cba2e758339dff71d12685d86c57aa4d9ad05641dd
|
Provenance
The following attestation bundles were made for boxy_agent-0.2.0a2-py3-none-any.whl:
Publisher:
boxy-agent-release.yml on boxy-ai/boxy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
boxy_agent-0.2.0a2-py3-none-any.whl -
Subject digest:
c8445b068a0a75c9bf355c52a674cc2112bd89ddcbbc5c45818e6df2796f901c - Sigstore transparency entry: 1091008190
- Sigstore integration time:
-
Permalink:
boxy-ai/boxy@deac5cea506c0b34fafb9c931fe5833c9dc08b3e -
Branch / Tag:
refs/tags/boxy-agent-v0.2.0a2 - Owner: https://github.com/boxy-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
boxy-agent-release.yml@deac5cea506c0b34fafb9c931fe5833c9dc08b3e -
Trigger Event:
push
-
Statement type: