Magy Docs

Magy Platform

A production-grade multi-agent AI orchestration platform written in Rust. Role-based agents collaborate through NATS JetStream messaging, with cost-aware LLM routing, 4-tier memory, a persistent knowledge graph, and real-time 3D visualization.

7+
Agent Roles
4
Memory Tiers
8
LLM Providers
15+
Built-in Tools
Rust + TokioNATS JetStreamPostgres + pgvectorNext.js 16Three.jsWASM Skills
Up and running in 7 steps

Getting Started

Rust 1.82+
Bun
Docker
PostgreSQL 16+
Redis
NATS 2.10+
01

Clone the repo

git clone https://github.com/anthropics/magy.git && cd magy
02

Start infrastructure

docker compose up -d   # Postgres, Redis, NATS
03

Configure

cp magy.toml.example magy.toml
# Edit magy.toml — set provider API keys, agent config
04

Set API keys

export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."  # optional, for embeddings
05

Run migrations

cargo run -- migrate
06

Start backend

cargo run -- up --config magy.toml   # API on :3011
07

Start frontend

cd magyverse && bun install && bun run dev   # :3000
How it all connects

System Architecture

External EventsTelegram, Webhooks, APIsConnectorsGmail, Slack, Jira, Notion, GDriveNATS JetStreamPub/Sub + Durable StreamsTask SchedulerDirect / Pipeline / FanOut / SwarmAgent RuntimeLlmAgent, CodeAgent, Speculative ExecLLM RouterCost-Aware Tiering + Circuit BreakerToolsFilesystem, Shell, Git, GitHub, HTTP, BrowserMemoryWorking → Episodic → Semantic → ProceduralKnowledge GraphConfidence Decay, Cross-Agent LearningMagyVerse UIWebSocket + SSE → Real-Time 3D World
Text version (accessibility)
External Events → Connectors → NATS JetStream → Task Scheduler
  → Agent Runtime → LLM Router → Tools → Memory → Knowledge Graph → MagyVerse UI

Payload Separation

Critical design rule: Payload::Data(json) never touches the LLM.Payload::Text is for natural language.Payload::Stream for token-by-token output.Payload::Signal for control (heartbeat, ping, cancel, shutdown).

Trait-Driven Design

Core abstractions via Rust traits: Agent (handle, health, shutdown), LlmProvider (complete, stream), Memory (remember, recall, search_semantic), Tool (execute with sandbox), Plugin (init, shutdown), Connector (authenticate, on_event). All async via async_trait.

Autonomous AI teams

Agent System

Architect (Aria)

System design, architecture decisions, task decomposition

Developer (Nova)

Code implementation, file operations, git workflows

QA Engineer (Luna)

Testing, validation, quality assurance

PM

Project coordination, status tracking, prioritization

DevOps

Infrastructure, deployment, monitoring

CodeAgent

Specialized coding agent with diff-aware file editing

CTO (Chief)

Engineering leadership, strategy, cross-agent coordination

Agent Lifecycle

// Each agent is a lightweight Tokio task (8KB overhead, sub-μs spawn)
#[async_trait]
pub trait Agent: Send + Sync + 'static {
    fn id(&self) -> &AgentId;
    fn capabilities(&self) -> &[Capability];
    async fn handle(&self, msg: MagyMessage, ctx: &AgentContext) -> Result<Vec<MagyMessage>>;
    async fn health(&self) -> HealthStatus;  // No LLM involved
    async fn shutdown(&self) -> Result<()>;
}

// AgentContext provides shared resources:
// - LLM router (cost-aware model selection)
// - Tool registry (sandboxed execution)
// - Memory system (4-tier persistence)
// - Knowledge graph (cross-agent learning)
// - Tool result cache (deduplication)

Identity System

PersonalityProfile + ReputationScore. Agents have distinct identities with peer-rated capabilities and configurable personalities.

Speculative Execution

Predicts which tools an agent will call next based on history patterns. Pre-fetches results to eliminate wait time in subsequent rounds.

Loop Detection

Detects and breaks infinite tool-call cycles. Tracks call patterns with configurable thresholds to prevent agents from getting stuck.

Personality & Expertise

Each agent can be configured with personality traits (risk_tolerance, collaboration_style, verbosity) and expertise areas (primary, secondary). These shape how agents approach tasks, communicate, and collaborate.

[agent.personality]
traits = ["methodical", "detail-oriented"]
risk_tolerance = 0.3          # 0.0 conservative → 1.0 aggressive
collaboration_style = "lead"  # lead | contributor | reviewer
verbosity = "concise"

[agent.expertise]
primary = ["rust", "architecture"]
secondary = ["typescript", "devops"]
Learn from every task

Self-Improving Agents

Every agent learns from task completions through a fire-and-forget knowledge loop. After handle() completes, learn_from_interaction() stores an episodic memory summary and — for non-trivial interactions — spawns a background Haiku LLM call to extract knowledge nodes and edges into the shared Knowledge Graph.

KnowledgeLoopAgent handles tasklearn_from_interaction()Extract knowledgeStore in KGNext task arrivesbuild_knowledge_context()Inject into prompt

Knowledge Injection

Before each task, build_knowledge_context() queries the graph for relevant knowledge and injects it into the system prompt.

ConceptsFilesDecisionsPatterns

Confidence Decay

Stale knowledge fades naturally. Frequently reinforced knowledge persists.

score *= e^(-λt)       // exponential decay
reinforcement: score = min(1.0, score + boost)
Per-task git sandboxing

Worktree Isolation

When multiple agents work concurrently, they can conflict on the shared filesystem. Worktree isolation gives each task its own git branch + worktree. Tools are unaware — sandbox.workspace transparently points at the worktree path.

Task Arrivesworktreeenabled?NOShared workdirYESacquire(branch + worktree)Agent works in isolationrelease()on_successAutoMergeCreatePRBranchOnlyon_failureKeepCleanup

Configuration

[[agent]]
id = "nova"
[agent.worktree]
enabled = true
on_success = "create_pr"   # auto_merge | create_pr | branch_only
on_failure = "keep"         # keep | cleanup
base_branch = "main"
worktree_dir = ".worktrees"

On Success

AutoMergeMerge into base with --no-ff, cleanup worktree + branch
CreatePRPush branch, create pull request, remove worktree
BranchOnlyCommit changes, remove worktree, keep branch

On Failure

KeepLeave worktree on disk for debugging (default)
CleanupRemove worktree and delete the branch
Intelligent model selection

LLM Router

Tier 1 · SimpleHaiku / GPT-4.1-mini / Flash$0.25/MTier 2 · ModerateSonnet / GPT-4.1 / Gemini Pro$3/MTier 3 · ComplexOpus / o3 / Gemini Ultra$15/MTier 4 · CriticalOpus + Extended Thinking$15+/MRouting Pipelineclassify(task)candidates_for_tier()sort by composite_scorecircuit_breaker.check()acquire_permit()provider.complete()composite_score = (cost_norm × 0.7) + (latency_norm × 0.3)EWMA latency tracking · min 3 samples · fallback to cost-onlyCircuit BreakerConcurrency LimiterBudget Enforcement

Cost-Aware Adaptive Routing

The router classifies tasks by complexity (simple → moderate → complex → critical) and selects the cheapest capable model. Per-agent budgets prevent runaway costs. Circuit breakers isolate provider failures. EWMA-based latency tracking scores candidates by composite cost + latency.

Tier 1 (Simple):  Haiku / GPT-4.1-mini / Flash    → $0.25/M tokens
Tier 2 (Moderate): Sonnet / GPT-4.1 / Gemini Pro   → $3/M tokens
Tier 3 (Complex):  Opus / o3 / Gemini Ultra          → $15/M tokens
Tier 4 (Critical): Opus with extended thinking        → $15+/M tokens

Routing: classify(task) → candidates_for_tier() → sort by composite_score
  composite = (cost_norm × 0.7) + (latency_norm × 0.3)
  → circuit_breaker.check() → acquire_permit() → provider.complete()
  → record_latency() → track_cost()
Anthropic
Claude 4 Opus/Sonnet/Haiku
Primary, prompt caching
OpenAI
GPT-4.1, o3, o4-mini
Full streaming
Google
Gemini 2.5 Pro/Flash
SSE streaming
AWS Bedrock
Claude via Bedrock
SigV4 auth
Ollama
Local models
NDJSON streaming
DeepSeek
DeepSeek-R1/V3
Reasoning
Groq
Ultra-fast inference
Low latency
Kimi (Moonshot)
Kimi K2.5
Anthropic-compatible

Prompt Cache Optimization

3 cache breakpoints on Anthropic: system prompt, tool definitions, and conversation prefix. In a 10-round tool loop, all prior messages are cached at 0.1x input cost — ~78% savings.

Concurrency Limiter

Semaphore-based backpressure: 10 concurrent requests per provider, 20 globally. RAII permits auto-release. Prevents rate limiting when 10+ agents fire simultaneously.

Extended Thinking

Tier 4 (Critical) tasks use extended thinking on Anthropic and Bedrock providers. The router enables a dedicated thinking budget for complex reasoning. Signature echo-back ensures thinking block integrity across streaming responses.

Persistent intelligence

Memory & Knowledge

WorkingRedis / In-MemoryTTL: task lifetimeEpisodicPostgresTimestamped recordsSemanticpgvector + HNSWVector embeddingsProceduralPostgresLearned patternsData flows from short-term → long-term storage
Working Memory

Short-term, per-task context. Fast in-memory store cleared after task completion.

Episodic Memory

Historical records of past interactions and task outcomes. Postgres-backed with timestamps.

Semantic Memory

Vector embeddings for similarity search. pgvector with HNSW indexing for sub-50ms retrieval.

Procedural Memory

Learned patterns and procedures. How-to knowledge extracted from successful task completions.

Knowledge Graph

A persistent, cross-agent knowledge graph enables shared learning across the entire swarm. Nodes represent concepts, files, decisions, and patterns. Edges encode relationships with confidence scores that decay over time — stale knowledge naturally fades while frequently reinforced knowledge persists.

KnowledgeGraph
  ├─ extract(text) → Vec<KnowledgeNode>     // NLP extraction
  ├─ store(node, confidence, tags)            // With decay schedule
  ├─ query(context) → Vec<RelevantKnowledge> // Contextual retrieval
  └─ build_context(task) → String            // Inject into prompts

Confidence Decay: score *= e^(-λt)  // Exponential decay
  λ configurable per-knowledge-type
  Reinforcement: score = min(1.0, score + boost)
Secure execution environment

Tools & Sandbox

filesystemread_file, write_file, edit_file, list_dir, searchPath-scoped
shellexecute commands with streaming outputLevel-gated
gitstatus, diff, commit, branch, log, checkoutWorkspace-scoped
githubcreate_pr, list_issues, review, commentToken-authed
httpGET, POST, PUT, DELETE with headersHost allowlist
browsernavigate, screenshot, extract, clickIsolated
code_actionexecute Python/shell scripts (CodeAct pattern)Level-gated
knowledgelearn, query, delete from knowledge graphWorkspace-scoped
manage_croncreate, list, enable, disable, delete cron jobsStandard
set_remindercreate, list, cancel one-off remindersStandard
switch_workspacechange working directory mid-sessionPath-scoped

Standard

File access scoped to workspace, full network, shell allowed with confirmation.

Strict

Workspace-scoped files, network restricted to allowlist, no shell without explicit approval.

Isolated

Temp-dir only, no network, no shell. For untrusted marketplace skills and WASM plugins.

Tool Result Cache

Cross-agent deduplication via DashMap. Cacheable tools: filesystem reads, git status/diff/log. TTL: 30s filesystem, 10s git. Auto-invalidation on write/edit/delete mutations.

Declarative Guardrails

Config-driven safety rules in magy.toml — no code required. Block dangerous shell commands via regex, flag git push for approval, enforce max token limits, disable specific tools. Compiled at startup with pre-compiled regex.

Cron jobs & reminders

Scheduling

Magy supports both recurring cron jobs and one-off reminders. Jobs can be defined statically in magy.toml or created dynamically via the REST API and agent tools. The scheduler polls at a configurable interval, executing due jobs up to a concurrency limit.

[[cron]]
id = "daily-standup"
schedule = "0 0 9 * * *"    # sec min hour day month weekday
agent = "aria"
task = "Run daily standup summary"
enabled = true

[scheduling]
poll_interval_secs = 30      # check frequency
max_concurrent = 10          # max parallel executions

Cron Jobs

6-field cron expressions (second granularity). Sources: Config, API, or Agent tool. Jobs can be enabled/disabled without deletion. Execution log tracks history with status and duration.

Reminders

One-off delayed tasks with configurable delivery channels: Agent (message back), Telegram (group/topic), WebSocket (UI push), or Broadcast (all agents). Status tracking: Pending → Delivered/Failed/Cancelled.

External messaging bridges

Channels

Channels bridge external messaging platforms to Magy agents. Telegram is the primary supported channel, with per-agent topic routing, live streaming via message edits, and inline keyboard interactions.

[channels.telegram]
enabled = true
bot_token_env = "TELEGRAM_BOT_TOKEN"
group_id = -100123456789
default_agent = "aria"       # agent for DMs

[channels.telegram.topics]
aria = 123                   # topic ID per agent
nova = 456

[channels.telegram.streaming]
enabled = true
edit_interval_ms = 500
show_thinking = false
cross_post_agent_messages = true

Bot Commands

/status — agent statuses, /cost — cost summary, /stop — cancel task, /model — switch LLM.

Topic Routing

Messages in Telegram group topics are routed to the mapped agent. DMs go to the default_agent. Cross-agent visibility via cross-posting.

Live Streaming

LLM responses stream in real-time by editing the Telegram message at configurable intervals. Thinking blocks can be shown or hidden.

Extensible capabilities

Skills & Plugins

Skill System

Skills are composable, agent-invocable capabilities defined as YAML with embedded instructions. They can be bundled with the runtime or loaded from the marketplace. WASM skills execute in sandboxed Wasmtime environments.

# skills/code-review.yaml
name: code-review
description: "Review code changes"
tools: [git, filesystem]
steps:
  - action: git_diff
  - action: analyze
    prompt: "Review these changes..."
  - action: respond

Plugin System

Plugins extend the runtime with custom tools, connectors, and event handlers. They implement the Plugin trait and are registered at startup. Hot-reload supported for development.

#[async_trait]
pub trait Plugin: Send + Sync + 'static {
    fn name(&self) -> &str;
    async fn init(&self, ctx: &PluginContext) -> Result<()>;
    fn tools(&self) -> Vec<Box<dyn Tool>>;
    async fn shutdown(&self) -> Result<()>;
}

WASM Sandbox

Marketplace skills run in Wasmtime with configurable resource limits. Memory, CPU time, and filesystem access are all sandboxed.

Hot Reload

Skills and plugins can be reloaded without restarting the runtime. File watchers detect changes and trigger re-registration automatically.

Marketplace

Community-contributed skills distributed as WASM packages. Version-pinned, signature-verified, and sandbox-enforced for security.

External service integrations

Connectors

GmailOAuth2

Send/receive emails, search, label management

SlackOAuth2

Post messages, read channels, manage threads

JiraAPI Key

Create/update issues, sprint management, transitions

NotionOAuth2

Read/write pages, database queries, block manipulation

Google DriveOAuth2

File upload/download, folder management, sharing

WebhookHMAC

Generic receiver for external event sources

Connector Trait

#[async_trait]
pub trait Connector: Send + Sync + 'static {
    fn name(&self) -> &str;
    async fn authenticate(&self, credentials: &Credentials) -> Result<AuthToken>;
    fn tools(&self) -> Vec<Box<dyn Tool>>;        // Tools exposed to agents
    fn subscriptions(&self) -> Vec<String>;        // Event subjects
    async fn on_event(&self, event: ConnectorEvent) -> Result<Vec<MagyMessage>>;
}
NATS JetStream messaging

Transport Layer

All inter-agent communication flows through NATS JetStream. Each agent has an inbox subject (agent.{id}.inbox), an outbox subject, and a stream subject for token-level output. Messages are durable — if an agent crashes, pending messages survive in the stream and are re-delivered on restart.

MagyMessage {
    id: Ulid,                    // Globally unique, time-ordered
    from: AgentId,
    to: AgentId,
    payload: Payload,            // Data | Text | Stream | Signal
    correlation_id: Option<Ulid>, // Link request → response
    timestamp: DateTime<Utc>,
    metadata: HashMap<String, Value>,
}

Subject patterns:
  agent.{id}.inbox    — incoming messages
  agent.{id}.outbox   — outgoing messages
  agent.{id}.stream   — token-by-token streaming
  swarm.broadcast      — all-agent announcements
  task.{id}.status     — task progress updates

Task Topologies

Direct (1:1), Pipeline (sequential chain), FanOut (parallel broadcast with result aggregation), Swarm (dynamic role-based collaboration). The scheduler picks topology based on task complexity.

Supervisor

AgentSupervisor monitors health, restarts crashed agents, manages lifecycle. Health checks are LLM-free — just "am I alive and functional?" with queue depth, error rate, and memory tracking.

REST + WebSocket + SSE

API Reference

Health
GET/api/healthHealth check with uptime
Agents
GET/api/agentsList all running agents
POST/api/agentsCreate a new agent
GET/api/agents/{id}Agent details
PATCH/api/agents/{id}Update agent config
DELETE/api/agents/{id}Remove agent
POST/api/agents/{id}/messageSend message to agent
POST/api/agents/{id}/stopGracefully stop agent
POST/api/agents/{id}/cancelCancel current task
POST/api/agents/{id}/clear-contextReset conversation context
POST/api/agents/{id}/restartRestart agent
Agent History
GET/api/agents/{id}/messagesAgent message history
GET/api/agents/{id}/sessionsAgent session list
Templates
GET/api/agent-templatesList available agent templates
Tasks
GET/api/tasksList tasks
POST/api/tasksCreate task
GET/api/tasks/{id}Get task details
GET/api/tasks/{id}/tool-executionsTool execution log
GET/api/tasks/{id}/diffsFile diffs from task
Cost & Metrics
GET/api/costCost summary across all agents
GET/api/latencyPer-provider latency stats (EWMA)
Skills & Files
GET/api/skillsList installed skills
GET/api/dirsBrowse workspace directories
Memory
GET/api/memory/statsMemory usage stats
GET/api/memory/{agent_id}/episodicEpisodic memories
GET/api/memory/{agent_id}/semanticSemantic memory entries
GET/api/memory/{agent_id}/proceduralProcedural knowledge
Knowledge Graph
GET/api/knowledge/nodesList knowledge nodes
GET/api/knowledge/nodes/{id}Get specific node
GET/api/knowledge/edgesList knowledge edges
GET/api/knowledge/statsGraph statistics
Scheduling
GET/api/cronsList cron jobs
POST/api/cronsCreate cron job
GET/api/crons/{id}Get cron job
PATCH/api/crons/{id}Update cron job
DELETE/api/crons/{id}Delete cron job
GET/api/remindersList reminders
POST/api/remindersCreate reminder
GET/api/reminders/{id}Get reminder
DELETE/api/reminders/{id}Cancel reminder
GET/api/schedule/logExecution log
Real-time
GET/api/eventsSSE event stream
GET/api/wsWebSocket upgrade

WebSocket Protocol

// Client → Server
{ "type": "subscribe", "agent_id": "aria" }
{ "type": "send_message", "agent_id": "aria", "content": "..." }
{ "type": "ping" }

// Server → Client
{ "type": "agent_message", "agent_id": "aria", "content": "..." }
{ "type": "agent_stream", "chunk": "...", "seq": 1, "done": false }
{ "type": "status_update", "agents": [...] }

SSE Events

// Event types:
event: connected
data: {"session_id": "..."}

event: message:new
data: {"agent_id": "aria", "content": "..."}

event: agent:stream
data: {"agent_id": "aria", "chunk": "...", "seq": 1}

event: agent:status
data: {"id": "aria", "status": "running"}
magy.toml reference

Configuration

All configuration lives in magy.toml. Copy from magy.toml.example to get started. API keys are referenced by environment variable name, never stored in the config file.

[magy]Project metadata
[magy]
name = "my-project"
description = "Multi-agent orchestration"
[[provider]]LLM provider credentials and settings
[[provider]]
name = "anthropic"
api_key_env = "ANTHROPIC_API_KEY"
models = ["claude-sonnet-4-20250514", "claude-haiku-4-5-20251001"]
[infrastructure]Service URLs, ports, and limits
[infrastructure]
nats_url = "nats://localhost:4222"
postgres_url = "postgresql://localhost/magy"
redis_url = "redis://localhost:6379"
api_port = 3011
[[agent]]Agent definitions with model, tools, and personality
[[agent]]
id = "aria"
name = "Aria"
model = "claude-sonnet-4-20250514"
system_prompt = "prompts/architect.md"
tools = ["filesystem", "shell", "git", "github"]
budget_cents_per_hour = 500
[channels]Telegram bot and other chat integrations
[channels]
telegram_enabled = true
telegram_token_env = "TELEGRAM_BOT_TOKEN"
telegram_default_agent = "aria"
[[guardrail]]Declarative safety rules
[[guardrail]]
tool = "shell"
action = "block"
pattern = "rm -rf /"
message = "Dangerous command blocked"
[agent.personality]Agent personality traits and style
[agent.personality]
traits = ["methodical", "detail-oriented"]
risk_tolerance = 0.3
collaboration_style = "lead"
verbosity = "concise"
[scheduling]Cron and reminder scheduling
[scheduling]
poll_interval_secs = 30
max_concurrent = 10

[[cron]]
id = "daily-standup"
schedule = "0 0 9 * * *"
agent = "aria"
task = "Run daily standup"
[infrastructure.health]Health check and error thresholds
[infrastructure.health]
check_interval_secs = 30
error_threshold = 5
restart_on_failure = true
6 optimizations, zero compromise

Performance Optimizations

5-10s
saved per tool round
~78%
prompt cost savings
0ms
duplicate tool calls
01

Tool Result Cache

Cross-agent deduplication with DashMap. Whitelisted read-only tools (filesystem reads, git status/diff/log) are cached with configurable TTLs. Auto-invalidation on mutations. Prevents N agents from running identical reads.

02

Latency-Aware Routing

EWMA-based per-provider latency tracking. Composite score = (cost × 0.7) + (latency × 0.3). Needs minimum 3 samples before influencing routing. Degrades gracefully to cost-only sorting.

03

Prompt Cache Optimization

3 Anthropic cache breakpoints: system prompt, tool definitions, conversation prefix. All prior messages cached at 0.1x input price in multi-round tool loops. Applied to both Anthropic and Bedrock providers.

04

Streaming Shell Output

Shell commands stream stdout/stderr line-by-line via mpsc channels instead of buffering until completion. Progress published in real-time through NATS to the UI.

05

Request Concurrency Limiter

Tokio semaphore-based backpressure: 10 per provider, 20 globally. RAII permits auto-release on drop. Prevents rate-limiting when multiple agents fire simultaneously.

06

Streaming Tool Dispatch

Tool calls dispatched as soon as their JSON arguments become parseable during LLM streaming — not after the full response. Overlaps tool execution with generation, saving 5-10s per round.

What sets Magy apart

Key Innovations

Adaptive Task Classification

Automatically classifies task complexity (simple → critical) using heuristics on message length, tool count, and conversation depth. Routes to the cheapest capable model — no manual model selection.

Cross-Agent Knowledge Graph

Shared persistent knowledge with confidence-decay. Agents learn from each other. Knowledge reinforced by multiple agents persists; stale knowledge fades via exponential decay.

Speculative Tool Execution

Predicts next tool calls from historical patterns and pre-executes them. When the LLM response arrives, results are already cached — eliminating tool execution latency entirely.

WASM Skill Sandbox

Third-party skills execute in Wasmtime sandboxes with configurable resource limits. Marketplace skills can't escape their sandbox. Hot-reload without restarting the runtime.

Real-Time 3D Agent World

MagyVerse: a voxel-based 3D world (Three.js + R3F) where agents are visible characters. Watch agents collaborate, see their thought processes, interact via chat — all in real-time via WebSocket.

Streaming Tool Dispatch

Parse tool calls from LLM stream incrementally. Dispatch as soon as JSON arguments are complete — don't wait for the full response. Tool execution overlaps with generation.

Declarative Guardrails

Policy-as-config safety rules defined in magy.toml. Block dangerous commands, flag sensitive operations for approval, enforce token limits — all without writing code. Regex patterns compiled at startup for zero runtime overhead.

How Magy compares

Competitor Matrix

FeatureMagyOpenClawCrewAILangGraphAutoGenOpenAI SDK
LanguageRustTypeScript (Node.js)PythonPythonPythonPython
Concurrency ModelTokio async (sub-μs tasks)Multi-process (Node.js)ThreadingAsync PythonThreadingAsync Python
Agent TopologyDirect/Pipeline/FanOut/SwarmLobster YAML pipelinesSequential/HierarchicalGraph (DAG + cycles)ConversationalHandoffs
LLM Providers8 (Anthropic, OpenAI, Gemini, Bedrock, Ollama, DeepSeek, Groq, Kimi)10+ (OpenAI, Anthropic, Gemini, Groq, xAI, Mistral, Ollama, Kimi, ...)Via LiteLLMVia LangChainOpenAI + AnthropicOpenAI only
Cost-Aware RoutingAdaptive tiering + EWMA latencyKey rotation onlyNoNoNoNo
Memory System4-tier (Working/Episodic/Semantic/Procedural)Flat files (MEMORY.md + JSONL)Short + Long termCheckpointed stateConversation historySessions
Knowledge GraphBuilt-in with confidence decayPlugin only (LanceDB)NoNoNoNo
Tool Sandbox3-level (Standard/Strict/Isolated)Binary (on/off)No sandboxNo sandboxDocker optionalNo sandbox
Streaming Tool DispatchYes (parse-as-you-stream)NoNoNoNoNo
Prompt Caching3 breakpoints, ~78% savingsNoNoNoNoAutomatic
Plugin SystemWASM sandbox + RegistrySkills + ClawHub marketplaceTools onlyTools onlyTools onlyTools + MCP
3D VisualizationMagyVerse (Three.js)Canvas/A2UI (2D)NoLangSmith (2D)AutoGen StudioNo
TransportNATS JetStream (durable)WebSocket loopback (single-node)In-processIn-processIn-processIn-process
Built-in SchedulingCron + RemindersCron + webhooksNoNoNoNo
Declarative GuardrailsConfig-driven (magy.toml)Tool policy configNoNoNoSDK guardrails
Channel IntegrationsTelegram13+ (WhatsApp, Slack, Discord, Signal, ...)NoNoNoNo
Open SourceYesYes (MIT, 239k stars)Yes (paid cloud)Yes (paid cloud)YesYes

Where Magy Excels

Memory architecture (4-tier with semantic search), knowledge graph with confidence decay, cost-aware LLM routing, 3-level tool sandbox, streaming tool dispatch, multi-agent topologies (Direct/Pipeline/FanOut/Swarm), and production-grade transport via NATS JetStream.

Where OpenClaw Excels

Channel integrations (13+ including WhatsApp, Slack, Discord, Signal), community and ecosystem (239k stars), personal assistant UX, platform coverage, ease of setup (zero infrastructure), and plugin ecosystem via ClawHub marketplace.

Different design goals — Magy targets production multi-agent orchestration; OpenClaw targets personal AI assistants. Data compiled from framework documentation, GitHub repositories, and independent benchmarks (Feb 2026).

What powers Magy

Tech Stack

Rust Backend

tokioAsync runtime
async-natsNATS JetStream client
axumHTTP/WebSocket/SSE server
sqlx + pgvectorPostgres with vector search
redisCache layer
reqwestHTTP client for LLM providers
serdeSerialization framework
dashmapConcurrent hash maps
wasmtimeWASM skill execution
tracingStructured logging
teloxideTelegram bot framework
handlebarsPrompt templating

TypeScript Frontend

Next.js 16App Router framework
React 19UI rendering
Three.js + R3F3D voxel world
@react-three/drei3D helpers & primitives
@react-three/rapierPhysics engine
Zustand 5State management
MotionAnimations
Tailwind CSS 4Styling