Skip to main content

Agent Management

Viben CLI provides comprehensive tools for managing AI agents and orchestrating Agent Swarms - coordinated groups of specialized agents that work together to evolve your codebase.

Multi-Agent Orchestration

In the Agent Swarm x Code Evolution paradigm, multiple agents collaborate with different specializations:

Agent RoleDescription
ArchitectDesigns system structure and evaluates architectural decisions
ImplementerWrites and modifies code based on task specifications
ReviewerReviews code changes and provides quality feedback
TesterGenerates and runs tests, validates implementations
OptimizerApplies FileEvo to iteratively improve code quality metrics

Swarm Coordination

Quick Swarm Commands

# Start a swarm session for a task
viben swarm start --task "implement-auth"

# List active swarm agents
viben swarm status

# Configure swarm roles
viben swarm config --roles architect,implementer,reviewer

Key Concepts

ConceptDescription
AgentAn independent AI assistant instance with its own configuration, memory, and sessions
SwarmA coordinated group of agents working together on related tasks
TemplateA regular agent marked with isTemplate: true, used as a blueprint for creating new agents
MemoryAgent's long-term memory (MEMORY.md + daily logs)
SessionAgent's conversation history and state
Workspace ConfigProject-specific agent type configuration (e.g., .claude/)

Architecture Overview

Viben CLI
+---------------------------------------------------------+
| Agent Template (Reusable agent configuration template) |
| │ |
| └── Agent Instance (Independent agent instance) |
| ├── config.yaml (Agent configuration) |
| ├── mcp_servers.json (MCP configuration) |
| ├── skills/ (Agent-specific skills) |
| ├── memory/ (Agent memory) |
| │ ├── MEMORY.md (Main memory) |
| │ └── YYYY-MM-DD.md (Daily logs, append-only) |
| ├── .agentrc (Startup configuration) |
| ├── .agent_history (Command history) |
| └── .agent_sessions/<session_id>/ (Sessions) |
+---------------------------------------------------------+

Agent Directory Structure

Each agent is stored in ~/.viben/agents/<agent-id>/:

~/.viben/agents/<agent-id>/
├── config.yaml # Agent configuration
├── mcp_servers.json # MCP servers configuration
├── skills/ # Agent-specific skills
├── memory/ # Agent memory
│ ├── MEMORY.md # Main memory file (structured knowledge)
│ ├── 2024-01-15.md # Daily log (append-only)
│ ├── 2024-01-16.md # Read today + yesterday at session start
│ └── ...
├── .agentrc # Agent startup configuration
├── .agent_history # Command history
└── .agent_sessions/ # Session storage
└── <session_id>/
├── config.yaml # Session configuration
└── messages.rollout.jsonl # Message history (JSONL)

Runtime Config Merging

When an agent runs, configuration is merged in the following order:

1. ~/.viben/agents/<id>/config.yaml # Agent base configuration
2. <project>/.claude/ (or other type) # Workspace agent type config
3. Command line arguments # Runtime overrides

For example: Running agent main in /projects/my-app directory will first load ~/.viben/agents/main/config.yaml, then overlay /projects/my-app/.claude/ configuration.

Agent vs Template

Templates are regular agents with the isTemplate: true flag. They serve as blueprints for creating new agents.

AspectAgentTemplate
PurposeActive AI assistant instanceReusable configuration blueprint
Storage~/.viben/agents/<id>/~/.viben/agents/<id>/ (same location)
Config FlagisTemplate: false (default)isTemplate: true
MemoryHas memory and sessionsInitial structure only
UsageDirect interactionCreate new agents via --from-template

Quick Commands

# List all agents
viben agent list

# List templates only
viben agent list --templates

# Create a new agent
viben agent create my-agent

# Create from template
viben agent create my-agent --from-template coding-assistant

# Clone existing agent
viben agent create my-agent --clone existing-agent

# Mark an agent as a template
viben agent update my-agent --is-template true

# Show agent details
viben agent show my-agent

# Configure agent
viben agent config my-agent set model gpt-4

# Remove agent
viben agent remove my-agent

# Set default agent
viben agent set-default my-agent

# Check agent status
viben agent status

Command Output Formats

All agent commands support the --json flag for machine-readable output:

Human-readable output:

Agents:
main* claude-code 3 sessions ~/.viben/agents/main/
my-agent claude-code 1 session ~/.viben/agents/my-agent/
research-bot gemini 0 sessions ~/.viben/agents/research-bot/

* = current agent

JSON output (--json flag):

{
"success": true,
"data": {
"current": "main",
"agents": [
{
"id": "main",
"name": "Main Agent",
"type": "claude-code",
"path": "~/.viben/agents/main/",
"session_count": 3,
"memory_size": "5.6 KB"
}
]
}
}

Supported Agent Types

TypeDescription
claude-codeClaude Code (Anthropic)
cursorCursor AI
geminiGoogle Gemini
codexOpenAI Codex
windsurfWindsurf
ampAmp
opencodeOpenCode
qwen-codeQwen Code
droidDroid

Next Steps