Skip to content

Scaffold Agents (Python)

☕ Looking for Java? See Java Scaffold | 📘 Looking for TypeScript? See TypeScript Scaffold

Generate agents with meshctl scaffold

The easiest way to create an agent:

meshctl scaffold

This launches an interactive wizard that guides you through:

  • Agent name and type
  • Capabilities and tools
  • Output directory

The generated code includes placeholder tools—you'll need to edit main.py to implement your logic.

CLI Mode

For scripting or when you know what you want:

# Basic tool agent
meshctl scaffold basic --name my-agent

# LLM-powered agent
meshctl scaffold llm --name emotion-analyzer \
  --vendor openai --response-format json

# LLM provider (zero-code)
meshctl scaffold llm-provider --name claude-provider \
  --vendor claude --model anthropic/claude-sonnet-4-5

Agent Types

Subcommand Description Use Case
basic Basic agent with @mesh.tool Services, utilities, data processing
llm LLM-powered with @mesh.llm AI assistants, text analysis
llm-provider Zero-code LLM wrapper Expose LLM as mesh capability
api FastAPI gateway (@mesh.route) HTTP APIs that call mesh tools

Generated Files

my-agent/
├── main.py           # Agent code - edit this to add your logic
├── requirements.txt  # Add your dependencies here
├── Dockerfile        # Container build (ready to use)
├── helm-values.yaml  # Kubernetes config
└── README.md

After scaffolding: Edit main.py to implement your tool logic. The placeholder returns "Not implemented".

Generate Docker Compose

# Generate docker-compose.yml for all agents in directory
meshctl scaffold --compose

# With observability stack (registry + Redis + Tempo + Grafana)
meshctl scaffold --compose --observability

Local Tracing Setup

Use --compose --observability even if you run agents locally. Start the infrastructure with docker compose up -d, then run agents with meshctl start—they auto-connect to the Docker registry. This enables meshctl call --trace and meshctl trace.

Preview Before Creating

# Dry run - see what would be generated
meshctl scaffold basic --name my-agent --dry-run

More Options

# See all scaffold options
meshctl scaffold --help

Next Steps

Continue to Run Agents →