Labsco
haasonsaas logo

Shared Memory

β˜… 7

from haasonsaas

Provides shared memory for agentic teams to improve token efficiency and coordination.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

Shared Memory MCP Server

Solving coordination tax in agentic teams - where Opus + 4 Sonnets burns 15x tokens but only gets 1.9x performance.

The Problem

Current agentic team patterns have terrible token efficiency:

  • Traditional: 1 request Γ— 4K tokens = 4K tokens
  • Agentic Team: 1 coordinator + 4 workers Γ— 12K tokens each = 48K+ tokens
  • Efficiency: 1.9x performance / 15x cost = 12% efficiency

This MCP server provides shared memory for agentic teams to achieve 6x token efficiency while maintaining coordination benefits.

Core Features

1. Context Deduplication

  • Store shared context once, reference by key
  • 10:1 compression ratio with intelligent summarization
  • Workers get 100-token summaries instead of full context

2. Incremental State Sharing

  • Append-only discovery system
  • Workers share findings in real-time
  • Delta updates prevent retransmission

3. Work Coordination

  • Claim-based work distribution
  • Dependency tracking and resolution
  • Reactive task handoff between workers

4. Token Efficiency

  • Context compression and lazy loading
  • Delta updates since last version
  • Expansion on demand for specific sections

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Opus Coordinatorβ”‚    β”‚ Shared Memory   β”‚
β”‚                 │────│ MCP Server      β”‚
β”‚ - Task Planning β”‚    β”‚                 β”‚
β”‚ - Work Units    β”‚    β”‚ - Context Store β”‚
β”‚ - Coordination  β”‚    β”‚ - Discovery Log β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚ - Work Queue    β”‚
                       β”‚ - Dependencies  β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ Sonnet Workers  β”‚           β”‚
β”‚                 β”‚β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ - Specialized   β”‚    
β”‚ - Parallel      β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ - Coordinated   β”‚    β”‚ Token Efficiencyβ”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚                 β”‚
                       β”‚ 48K β†’ 8K tokens β”‚
                       β”‚ 6x improvement  β”‚
                       β”‚ 1200% better ROIβ”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Token Efficiency Strategies

Context Compression

// Instead of sending full context (12K tokens):
{
  full_context: { /* massive object */ }
}

// Send compressed reference (100 tokens):
{
  summary: "Task: Analyze TypeScript codebase...",
  reference_key: "ctx_123", 
  expansion_hints: ["codebase_files", "requirements"]
}

Delta Updates

// Instead of retransmitting everything:
get_full_context() // 12K tokens each time

// Send only changes:
get_context_delta(since_version: 5) // 200 tokens

Lazy Loading

// Workers request details only when needed:
expand_context_section("codebase_files") // 2K tokens
request_detail("file_content", "auth.ts") // 500 tokens

API Reference

Session Management

  • create_agentic_session - Initialize coordinator + workers
  • get_session_info - Get session details
  • update_session_status - Update session state

Context Management

  • get_worker_context - Get compressed context for worker
  • expand_context_section - Get detailed section data
  • get_context_delta - Get incremental updates

Work Coordination

  • publish_work_units - Publish available work
  • claim_work_unit - Claim work for execution
  • update_work_status - Update work progress

Discovery Sharing

  • add_discovery - Share findings with team
  • get_discoveries_since - Get recent discoveries

Dependency Resolution

  • declare_outputs - Declare future outputs
  • await_dependency - Wait for dependency
  • publish_output - Publish output for others

Performance Benefits

MetricTraditionalAgentic (Current)Shared Memory MCP
Token Usage4K48K+8K
Performance Gain1x1.9x1.9x
Cost Efficiency100%12%1200%
CoordinationNonePoorExcellent

License

MIT