3-Layer Brain Architecture
Complete temporal intelligence system that learns from the past, optimizes the present, and predicts the future. Causality tracking + Memory management + Predictive pre-fetching.
Part of Cormorant Foraging | Past → Present → Future | 3-Layer Brain for AI Agents

# Clone the repository
git clone https://github.com/semanticintent/semantic-wake-intelligence-mcp.git
cd semantic-wake-intelligence-mcp
# Install dependencies
npm install
# Configure Wrangler (create D1 database)
wrangler d1 create wake-intelligence
# Run database migrations
wrangler d1 execute wake-intelligence --local --file=migrations/0001_initial_schema.sql
wrangler d1 execute wake-intelligence --local --file=migrations/0002_add_causality_engine.sql
wrangler d1 execute wake-intelligence --local --file=migrations/0003_add_memory_manager.sql
wrangler d1 execute wake-intelligence --local --file=migrations/0004_add_propagation_engine.sql
# Start development server
npm run dev
# Deploy to production
npm run deployWake Intelligence (WakeIQX) is a Model Context Protocol (MCP) server that gives AI agents temporal intelligence - the ability to understand the past, manage the present, and predict the future.
Named after the "wake" left by a cormorant (a diving bird that creates ripples in water), Wake Intelligence tracks the ripple effects of decisions through time:
WakeIQX is part of the Cormorant Foraging framework - a three-dimensional approach to intelligence systems that emerged organically from building production tools.
Wake Intelligence represents the Time dimension of Cormorant Foraging:
| System | Dimension | Formula Type | Purpose |
|---|---|---|---|
| ChirpIQX | Sound (Communication) | Additive | Fantasy sports breakout analysis |
| PerchIQX | Space (Structure) | Multiplicative | Database schema intelligence |
| WakeIQX | Time (Memory) | Exponential | AI context temporal intelligence |
Learn more: cormorantforaging.dev - Intelligence Systems, Naturally Organized
The Wake Intelligence brain is designed around the fundamental structure of time:
Each layer builds on the previous:
This creates a complete temporal intelligence system that's both powerful and comprehensible.
Every decision based on measurable data - no subjective interpretation. Memory tiers classified by observable time since access. Predictions scored with transparent algorithms.
Code organized by meaning, not technical characteristics. Each layer has a clear semantic purpose (Past/Present/Future). Architecture reflects business intent at every level.
All domain models return new instances instead of mutating state. Predictable behavior, easy testing, and functional programming benefits.
┌─────────────────────────────────────────────────┐
│ Presentation Layer │
│ (MCPRouter) │
└────────────────────┬────────────────────────────┘
│
┌────────────────────▼────────────────────────────┐
│ Application Layer │
│ (ToolExecutionHandler, MCPProtocolHandler) │
└────────────────────┬────────────────────────────┘
│
┌────────────────────▼────────────────────────────┐
│ Domain Layer │
│ ┌──────────────────────────────────────────┐ │
│ │ Wake Intelligence Brain (3 Layers) │ │
│ │ • PropagationService (Layer 3) │ │
│ │ • MemoryManagerService (Layer 2) │ │
│ │ • CausalityService (Layer 1) │ │
│ └──────────────────────────────────────────┘ │
│ ContextService (Orchestration) │
└────────────────────┬────────────────────────────┘
│
┌────────────────────▼────────────────────────────┐
│ Infrastructure Layer │
│ • D1ContextRepository → IContextRepository │
│ • CloudflareAIProvider → IAIProvider │
└─────────────────────────────────────────────────┘4 Migrations = 3 Brain Layers:
Each migration adds semantic intelligence to the system.
Unlike traditional context management systems, Wake Intelligence is:
Like a cormorant diving beneath the surface, Wake Intelligence tracks the hidden patterns of time - the ripples of cause and effect, the ebb and flow of relevance, and the currents that shape the future.
Ready to give your AI agent a memory that remembers, understands, and anticipates?