Agents — Overview
A NanoFleet agent is a Docker container running a Bun/TypeScript runtime built on the Mastra framework. Each agent has its own identity, memory, and tool access — and connects to the outside world through channels.
Architecture
┌──────────────────────────────────────┐
│ NanoFleet Agent │
│ │
│ ┌──────────┐ ┌──────────────────┐ │
│ │ Identity │ │ LLM loop │ │
│ │ SOUL.md │──▶│ (Mastra/Vercel │ │
│ │ STYLE.md │ │ AI SDK) │ │
│ │AGENTS.md │ └────────┬─────────┘ │
│ └──────────┘ │ │
│ ┌────▼────┐ │
│ ┌──────────┐ │ Tools │ │
│ │ Memory │ │ native │ │
│ │ MEMORY.md│ │ + MCP │ │
│ │HISTORY.md│ └─────────┘ │
│ └──────────┘ │
│ │
│ Transport: HTTP (SSE streaming) │
└──────────────────────────────────────┘
Native tools
Every agent has access to these tools by default:
| Tool | Description |
|---|---|
webSearch | Search the web |
webFetch | Fetch a URL and extract content |
readFile | Read a file from the workspace |
writeFile | Write a file to the workspace |
editFile | Edit a file with string replacement |
listDir | List files in a directory |
execShell | Execute a shell command (disabled by default) |
Note:
execShellis disabled by default for security. Enable it by settingSHELL_TOOL_ENABLED=truein the agent’s environment.
Supported models
NanoFleet agents support 600+ models via Mastra’s provider adapters:
- Anthropic:
claude-sonnet-4-6,claude-haiku-4-5,claude-opus-4-6— requiresANTHROPIC_API_KEY - Google:
gemini-2.0-flash,gemini-2.5-pro— requiresGOOGLE_GENERATIVE_AI_API_KEY - OpenRouter: 600+ models (Llama, Qwen, Mistral, DeepSeek…) — requires
OPENROUTER_API_KEY. Prefix the model ID withopenrouter/: e.g.openrouter/meta-llama/llama-3.3-70b-instruct - MiniMax:
minimax-m2.5— requiresMINIMAX_API_KEY. Prefix the model ID withminimax/: e.g.minimax/minimax-m2.5 - vLLM: Self-hosted models via OpenAI-compatible API
Set the model with the AGENT_MODEL environment variable.
Agent lifecycle
Agents in NanoFleet have four lifecycle states:
| State | Description |
|---|---|
running | Container is active and accepting requests |
stopped | Container is stopped, workspace preserved |
error | Container exited with an error |
deploying | Container is being created |
From the dashboard or API:
- Deploy — pull image, create container, start
- Stop — stop container (workspace preserved)
- Resume — restart a stopped container
- Delete — stop + remove container + optionally remove workspace
- Upgrade — pull latest image, recreate container, preserve workspace
Usage and cost tracking
Each agent tracks token usage and estimated cost per LLM call. Totals are shown on the Fleet Dashboard card for each agent and in the agent workspace view.
Cost is calculated using per-model pricing at the time of the call. Supported for all Anthropic, Google, and MiniMax models; OpenRouter models use the reported usage from the API response.