Directory Structure
- Python
- TypeScript
Agent Code
run Function
- Python
- TypeScript
- Signature:
def run(agent: AgentContext) -> None: - Called periodically based on
runtimeIntervalMinutes - Receives
AgentContextwith session data and SDK methods - Returns
void(no return value)
unwind Function
- Python
- TypeScript
- Signature:
def unwind(agent: AgentContext, positions: list[CurrentPosition]) -> None: - Called when you ask the agent to unwind positions
- Optional unwind logic for the provided positions
- Returns
void(no return value)
DESCRIPTION.md
Every agent must include aDESCRIPTION.md file alongside circuit.toml. This Markdown file is displayed to users in the Circuit UI.
circuit.toml
Thecircuit.toml file defines your agent’s metadata, asset requirements, execution settings, and deployment configuration. It must be in the root of your agent directory.
Full Example
Field Reference
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name shown in the Circuit UI (32 characters or less). Cannot be changed after first publish — see Agent Identity below. |
tagline | string | Yes | Brief subtitle shown on agent cards (32 characters or less) |
walletType | string | Yes | "ethereum" or "solana" |
allowedExecutionModes | string[] | Yes | Array of "auto" and/or "manual". First entry is the default for circuit run. |
runtimeIntervalMinutes | number | Yes | How often run() is called (in minutes). Interval starts after previous run completes. |
version | string | Yes | Semver version (major.minor.patch). Must be incremented before each circuit publish. |
filesToInclude | string[] | No | Extra files/directories to upload (for monorepo setups). Relative paths from agent directory. |
filesToExclude | string[] | No | Files in agent directory to exclude from upload. |
imageUrl | string | No | Agent icon URL. Defaults to "https://cdn.circuit.org/agents/default". |
deploymentRegionOverride | string | No | Override deployment region. Allowed values: "us-east-1" or "eu-central-1". Defaults to "us-east-1". |
Deployment Regions
| Allowed values | Default when omitted |
|---|---|
us-east-1, eu-central-1 | us-east-1 |
[startingAsset] Section
Defines the token a user must hold to start a session.
| Field | Type | Required | Description |
|---|---|---|---|
network | string | Yes | Network identifier (e.g., "ethereum:1", "solana", "hypercore:perp") |
address | string | Yes | Token contract address. For native tokens: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" (EVM) or "11111111111111111111111111111111" (Solana). For Hyperliquid perps: "USDC". |
minimumAmount | string | Yes | Minimum balance in raw units (wei, lamports, etc.). For hypercore:perp + USDC, use 8 decimal places (Circuit raw units; matches Hyperliquid USDC weiDecimals). |
Common Configurations
EVM agent with ETH on mainnet:Agent Identity
Your agent’s identity on Circuit is derived from itsname. Once you run circuit publish, the name is used to generate a permanent slug that links all future publishes, version history, sessions, and state to that agent. Changing the name after publishing will create a brand-new agent — the original agent and all its history will remain under the old name.
If you need to rename a published agent, create a new agent with the desired name and re-publish. The old agent can be left as-is or removed from the dashboard.
Notes
- The
versionfield follows semver. You must increment it before eachcircuit publish— publishing will fail if the version is not greater than the previously published version. filesToIncludepaths are relative to the agent directory. Use../../utilsto include shared code from a monorepo root. See Multi-Agent Monorepo.allowedExecutionModesorder matters — the first entry is used as the execution mode when running locally withcircuit run.
Next Steps
- Execution Model — How sessions and the run loop work
- Multi-Agent Monorepo — Share code across multiple agents