Skip to content
NanoFleet NanoFleet

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:

ToolDescription
webSearchSearch the web
webFetchFetch a URL and extract content
readFileRead a file from the workspace
writeFileWrite a file to the workspace
editFileEdit a file with string replacement
listDirList files in a directory
execShellExecute a shell command (disabled by default)

Note: execShell is disabled by default for security. Enable it by setting SHELL_TOOL_ENABLED=true in 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 — requires ANTHROPIC_API_KEY
  • Google: gemini-2.0-flash, gemini-2.5-pro — requires GOOGLE_GENERATIVE_AI_API_KEY
  • OpenRouter: 600+ models (Llama, Qwen, Mistral, DeepSeek…) — requires OPENROUTER_API_KEY. Prefix the model ID with openrouter/: e.g. openrouter/meta-llama/llama-3.3-70b-instruct
  • MiniMax: minimax-m2.5 — requires MINIMAX_API_KEY. Prefix the model ID with minimax/: 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:

StateDescription
runningContainer is active and accepting requests
stoppedContainer is stopped, workspace preserved
errorContainer exited with an error
deployingContainer 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.