Agent Orchestration Plugin
The @memoryblock/plugin-agents package transforms a single monitor into a powerful, multi-agent orchestrator. It allows any block to discover, programmatically scaffold, and query sub-agents natively.
Installation
mblk add agents
How It Works
Instead of forcing a single LLM context window to handle massive, disparate tasks (e.g., coding, reviewing, and deployment), you can instantiate lightweight, purpose-built sub-agents.
When an orchestrator block needs help, it uses the query_agent tool. This spawns the sub-agent in an isolated, headless background process (using our native daemon mode), feeds it the task, and intercepts its final output to pipe back to the master block’s context window.
This completely eliminates context contamination. The master block only sees the final result, not the sub-agent’s scratchpad or intermediate tool outputs.
Tools Provided
1. list_agents
Discovers all existing blocks/agents available within the blocks/ directory.
- Parameters: None.
- Output: A formatted list of agents and their current sleeping/active statuses.
2. create_agent
Programmatically scaffolds a brand new sub-agent.
- Parameters:
name: Safe identifier (e.g.,code-reviewer)description: The system instruction / goal for the agentmodel: Optional LLM model override (defaults to current provider)
- Output: Success message confirming sandbox creation.
3. query_agent
Spawns an agent, sends it an instruction, and waits for its response.
- Parameters:
agent_name: Target agent to wake up.prompt: The specific task or question.
- Output: The final response text generated by the sub-agent.
Secure Delegation
All requested sub-agents created via create_agent are forcibly sandboxed by default (sandbox: true). This ensures that even if you delegate a dangerous task to an AI, its capability to mutate your root file system is physically restricted to its own directory unless explicitly permitted by you during execution.