This page covers the practical guide for building agents. For the full specification and validation rules, see Agents Specification.
Agent Architecture
An agent manifest (agent.mjs) declares everything the agent needs: which tools to use, which model to target, how the agent should behave, and how to verify it works.
Agent Manifest
Each agent is defined by anagent.mjs file with export const main:
Three Content Layers
Agents separate concerns into three distinct layers that shape how the agent thinks, understands, and acts.Persona
Field:
systemPromptWho the agent IS. Defines personality, expertise, and behavioral boundaries.“You are a crypto research analyst who provides data-driven insights…”Explanations
Field:
promptsHow tools work. Provides context about data formats, API quirks, and interpretation guidance.“CoinGecko returns prices in the base currency. Always convert to USD for comparison…”Instructions
Field:
skillsStep-by-step workflows. Guides the agent through multi-tool sequences for complex tasks.“Step 1: Search token by name. Step 2: Fetch OHLCV data. Step 3: Calculate metrics…”| Layer | Field | Purpose | Example |
|---|---|---|---|
| Persona | systemPrompt | Who the agent IS | ”You are a crypto research analyst…” |
| Explanations | prompts | How tools work | ”CoinGecko returns prices in…” |
| Instructions | skills | Step-by-step workflows | ”Step 1: Search token. Step 2: Fetch OHLCV…” |
Tool Cherry-Picking
Tools use the full ID format:namespace/type/name. This lets you pick exactly the tools an agent needs from any provider — no need to include an entire provider’s toolkit.
simplePrice and coinMarkets might be enough.
Agent Tests
Every agent must have a minimum of 3 tests. This ensures the agent’s tool selection and output quality are verified across different usage scenarios.
| Level | Field | What it checks | Deterministic? |
|---|---|---|---|
| Tool Usage | expectedTools | Did the agent call the right tools? | Yes |
| Content | expectedContent | Does the output contain expected keywords? | Partial |
| Quality | Manual review | Is the output coherent and useful? | No |
expectedToolsis deterministic — the agent must call exactly these tools for the given input.expectedContentis a partial check — the response should contain these strings, but additional content is fine.- Quality review is manual — read the output and verify it makes sense as a coherent answer.
Directory Structure
Each agent lives in its own directory within the catalog’sagents/ folder:
agent.mjs file is the entry point. Prompts and skills are referenced by relative path from the manifest and follow the same format as schema-level skills and prompt architecture.