| name | letta-fleet-management |
| description | Manage Letta AI agent fleets declaratively with kubectl-style CLI. Use when creating, updating, or managing multiple Letta agents with shared configurations, memory blocks, tools, folders, canary deployments, multi-tenancy, and bulk operations. |
| license | MIT |
lettactl
kubectl-style CLI for managing Letta AI agent fleets declaratively.
When to Use
- Deploying multiple agents with shared configurations
- Managing agent memory blocks, tools, and folders
- Applying templates to existing agents
- Running canary deployments before promoting to production
- Multi-tenant agent management (B2B / B2B2C)
- Bulk messaging across agent fleets
- Importing/exporting agents between environments
- Analyzing agent memory health (self-diagnosis)
- Calibrating agents with first-message boot sequences
- Programmatic fleet management via SDK
Core Workflow
- Define agents in
fleet.yaml
- Apply with
lettactl apply -f fleet.yaml
- Verify with
lettactl get agents and lettactl describe agent <name>
Fleet YAML Structure
shared_blocks:
- name: company-context
description: Shared company knowledge
limit: 5000
from_file: ./context/company.md
shared_folders:
- name: brand_docs
files:
- "docs/*.md"
mcp_servers:
- name: firecrawl
type: sse
server_url: "https://sse.firecrawl.dev"
auth_header: "Authorization"
auth_token: "Bearer ${FIRECRAWL_API_KEY}"
agents:
- name: support-agent
description: Customer support assistant
tags:
- "tenant:acme-corp"
- "role:support"
system_prompt:
from_file: ./prompts/support.md
llm_config:
model: google_ai/gemini-2.5-pro
context_window: 128000
reasoning: true
first_message: "Initialize and confirm readiness."
memory_blocks:
- name: persona
description: Agent personality
limit: 2000
value: "You are a helpful support agent."
agent_owned: true
archives:
- name: knowledge_base
description: Long-term knowledge storage
shared_blocks:
- company-context
shared_folders:
- brand_docs
tools:
- send_email
- search_docs
- "tools/*"
mcp_tools:
- server: firecrawl
tools: ["scrape", "crawl"]
See reference/fleet-config.md for full schema.
CLI Commands
Apply Configuration
lettactl apply -f fleet.yaml
lettactl apply -f fleet.yaml --dry-run
lettactl apply -f fleet.yaml --match "*-prod"
lettactl apply -f fleet.yaml --canary
lettactl apply -f fleet.yaml --promote
lettactl apply -f fleet.yaml --recalibrate
Inspect Resources
lettactl get agents
lettactl get agents -o wide
lettactl get agents --tags "tenant:acme"
lettactl get blocks --shared
lettactl get tools --orphaned
lettactl describe agent <name>
Messaging
lettactl send <agent> "Hello"
lettactl send <agent> "Hi" --stream
lettactl send --all "support-*" "Update"
lettactl send --tags "role:support" "Hi"
lettactl messages list <agent>
lettactl messages reset <agent>
lettactl messages compact <agent>
Import / Export
lettactl export agent <name> -f yaml
lettactl export agents --all
lettactl import agent-export.yaml
Fleet Reporting
lettactl report memory
lettactl report memory --analyze
See reference/cli-commands.md for all options.
Canary Deployments
Test changes on isolated copies before promoting to production:
lettactl apply -f fleet.yaml --canary
lettactl send CANARY-support-agent "test msg"
lettactl apply -f fleet.yaml --promote
lettactl apply -f fleet.yaml --cleanup
See reference/canary-deployments.md.
Multi-Tenancy
Tag agents for B2B and B2B2C filtering:
agents:
- name: acme-support
tags:
- "tenant:acme-corp"
- "role:support"
- "env:production"
lettactl get agents --tags "tenant:acme-corp"
lettactl send --tags "tenant:acme-corp,role:support" "Policy update"
See reference/multi-tenancy.md.
Self-Diagnosis
Analyze agent memory health fleet-wide:
lettactl report memory
lettactl report memory --analyze
Reports fill percentages, stale data, redundancy, missing knowledge, and split recommendations. See reference/self-diagnosis.md.
Agent Calibration
Prime agents on creation with a boot message:
agents:
- name: support-agent
first_message: "Review your persona and confirm you understand your role."
Recalibrate existing agents after updates:
lettactl apply -f fleet.yaml --recalibrate
lettactl apply -f fleet.yaml --recalibrate --recalibrate-tags "role:support"
See reference/agent-calibration.md.
Template Mode
Apply configuration to existing agents matching a pattern:
lettactl apply -f template.yaml --match "*-draper"
Uses three-way merge: preserves user-added resources while updating managed ones. See reference/template-mode.md.
SDK Usage
import { LettaCtl } from 'lettactl';
const ctl = new LettaCtl({ lettaBaseUrl: 'http://localhost:8283' });
await ctl.deployFromYaml('./fleet.yaml');
const config = ctl.createFleetConfig()
.addSharedBlock({ name: 'kb', description: 'Knowledge', limit: 5000, from_file: 'kb.md' })
.addAgent({
name: 'support-agent',
description: 'Support AI',
system_prompt: { from_file: 'prompts/support.md' },
llm_config: { model: 'google_ai/gemini-2.5-pro', context_window: 32000 },
shared_blocks: ['kb'],
tags: ['team:support'],
})
.build();
await ctl.deployFleet(config);
await ctl.sendMessage('agent-id', 'Hello', {
onComplete: (run) => console.log('Done:', run.id),
});
await ctl.deployFromYaml('./template.yaml', { match: '*-prod' });
See reference/sdk-usage.md for full API.