Multi-Agent System

Imagine you need to plan a family vacation. You'd want someone to research destinations, someone else to compare flight prices, another person to find hotels, and someone to build the itinerary. In real life, you'd do all of that yourself. With Meggy's multi-agent system, you create specialized agents that handle each part — and they work together automatically.

Multi-agent isn't about having one AI that does everything. It's about having a team of AI agents, each focused on what they do best, collaborating to get complex jobs done while you do something else.

Agent Architecture

The agent system is composed of several core components:

Execution Strategies

Every agent has a sandbox field that determines its isolation level. The executor implements a strategy pattern with three options:

Strategy Isolation Use Case
InProcess None — runs in the main Electron process Fast, trusted agents that need full API access
ChildProcess Process-level — runs as a spawned Node.js worker Untrusted agents with budget and memory limits
Docker Container-level — runs inside a Docker container Maximum isolation for experimental or risky agents

Pipeline and Engine Modes

Agents can operate in two execution modes, depending on how structured the task is:

Pipeline mode is for tasks with a clear sequence of steps. You define a directed acyclic graph (DAG), and the Pipeline Executor resolves the topological order, running steps in parallel where dependencies allow. Each step can be a local agent action or a remote agent call via the A2A client. Think of it as a recipe — Meggy follows the steps in order.

Engine mode is for open-ended tasks. The agent receives a goal, plans its approach, and iterates with tool calls until the objective is met or the budget is exhausted. Think of it as giving your agent a problem and letting it figure out the solution.

Danger Assessment

Before any agent executes, Meggy scores its risk level based on:

Agents classified as dangerous require explicit human approval before each execution cycle. You're always in the loop for high-risk actions.

The A2A Protocol

Meggy implements the Agent-to-Agent (A2A) protocol using JSON-RPC 2.0:

This means agents running on different Meggy instances can collaborate — one instance's agent can delegate a research task to another instance's specialized agent.

Blueprint System

Every agent is defined by a blueprint — a shareable template that captures everything about how the agent works:

Blueprints can be exported as .agent.md files for sharing and version control. Found a useful agent configuration? Export it, share it with a friend, or save it for later.