Multi-Agent AI2024Production

Cortex-Orchestrator

Multi-Agent orchestration and evaluation with custom MCP servers

LangGraph supervisor-worker system with custom MCP servers and gVisor-sandboxed tools behind human approval gates. Context compaction cut tokens per trajectory 42%, and on 500+ golden scenarios task completion rose from 71% to 94.2% at sub-3 second P95 tool latency.

LangGraphMCP ServersPythongVisorContext CompactionEvaluation Benchmark

Visual evidence

Multi-Agent System Architecture & MCP Gateway

Cortex-Orchestrator multi-agent architecture diagram showing LangGraph supervisor, worker agents, custom MCP tool gateway, and gVisor sandboxing

Supplementary evidence

Evaluation Suite Terminal Walkthrough

Cortex-Orchestrator evaluation harness and interactive terminal walkthrough
Empirical Architecture Benchmarks

Measured Trade-Offs, Not Assumptions

Interactive benchmark comparisons demonstrating how context compaction, custom MCP gateways, and hybrid RAG solve real-world latency, token cost, and hallucination bottlenecks.

Measured Outcomes

System Metrics Delta

Production Run
Tokens / Trajectory
-42.0%8,240
Baseline: 14,200Optimized: 8,240
P95 Tool Latency
-48.7%2.78s
Baseline: 5.42sOptimized: 2.78s
500+ Scenario Pass Rate
+23.0%94.2%
Baseline: 71.2%Optimized: 94.2%
Inference Cost / 1k Runs
-42.0%$24.72
Baseline: $42.60Optimized: $24.72

Key Engineering Safeguards

Deterministic Cycle Control

LangGraph state persistence guarantees reproducible agent cycles and prevents infinite loops.

Model Context Protocol (MCP)

Standardized tool discovery and schema negotiation decouples agent core from backend tools.

gVisor Container Isolation

Intercepts and sandboxes all system calls in userspace to enforce air-tight tool isolation.

Regression Testing Harness

Automated test runner benchmarks latency, cost, and task completion across continuous CI runs.

Interactive Test Bed

Select Test Scenario

Scenario 1 of 3
Simulated Input Prompt

“Inspect financial tables in PostgreSQL replica, compute YoY EBITDA margins in Python, and output formatted markdown summary.”

Production Execution Result

Context compaction retains only salient schema mappings (8,240 tokens, -42%). Custom MCP server routes script to gVisor sandbox behind approval gate in 2.78s.

Trace Inspection

Execution Pipeline Nodes

5 Lifecycle Steps
1

LangGraph Supervisor Decomposition

Supervisor DAG

Supervisor parses goal, determines execution DAG, and assigns isolated worker agents.

2

Dynamic Context Compaction

-42% Tokens

Conversational history and tool outputs are compacted by 42% preserving critical schema semantics.

3

Custom MCP Tool Gateway

MCP Standard

Standardized JSON-RPC tool contracts enforce strict parameter validation and typing.

4

gVisor Sandbox & Approval Gate

Zero Host Leak

Subprocess execution isolated in kernel-virtualized gVisor containers behind human sign-off.

5

Golden Scenario Regression Suite

94.2% Pass

Evaluated against 500+ golden test trajectories verified with automated LLM judges.

Model Context Protocol v1.0

Live MCP Tool Gateway Explorer

Inspect the production JSON-RPC 2.0 tool contracts powering Veda at DriverAI (5 enterprise backends) and Cortex-Orchestrator (gVisor sandboxing with human approval gates).

mcp/financial-retriever-service::sec_filing_retriever
Read-Only (Deterministic Safe)
{
  "ticker": "AAPL",
  "filing_type": "10-K",
  "fiscal_year": 2024,
  "section": "item_8_notes",
  "query": "Schedule of long-term debt maturities and restrictive borrowing base covenants",
  "include_raw_tables": true
}
Transport: stdio / SSEWire Protocol: JSON-RPC 2.0Sandboxing: gVisor container
Full Tool Compatibility with Claude & LangGraph

Case study

Problem, Build, Outcome

Problem

Autonomous agent systems often run into runaway token costs, unsafe tool execution, and erratic multi-step coordination across enterprise backends.

Build

Built a LangGraph supervisor-worker architecture with custom MCP servers, gVisor container isolation, context compaction, human approval gates, and rigorous evaluation suites.

Outcome

Token usage dropped 42% per trajectory while task completion across 500+ golden scenarios surged from 71% to 94.2% at sub-3 second P95 tool latency.

Architecture

System Flow

1Supervisor
2Worker Agents
3MCP Tool Gateway
4Compaction & Gate

Architecture Notes

  • Supervisor agent orchestrates specialized workers according to task requirements.
  • Custom MCP servers connect workers to enterprise tools within gVisor-sandboxed execution.
  • Context compaction dynamically prunes redundant conversational history before downstream reasoning.

Engineering choices

Technical Decisions

Selected LangGraph for deterministic supervisor-worker cycle control and state persistence.

Enforced human approval gates on high-impact actions to ensure strict governance.

Employed context compaction to slash token load by 42% without sacrificing retrieval fidelity.

Evidence

Proof Points

42% token reduction per trajectory via context compaction

94.2% task completion on 500+ golden test scenarios

Sub-3 second P95 tool latency with gVisor sandboxing

Next read

Related Deep Dives