Memory Layer
The Memory Layer provides persistent, personalized context for KEK's AI agents. It enables agents to remember past interactions, track evolving facts over time, and personalize recommendations across sessions.
Memory is an input to intelligence — not an execution trigger.
What this page covers
- The purpose of the Memory Layer in KEK
- How the persistent memory layer provides user and agent memory
- How the Knowledge Graph provides temporal knowledge graphs
- Integration with the MCP Agent Server
- What the Memory Layer does and does not do
Purpose of the Memory Layer
Trading AI systems face a fundamental challenge: fixed context windows limit how much history and preference data can inform each decision. The Memory Layer solves this by intelligently extracting, consolidating, and retrieving relevant context.
This enables:
- Personalization — Strategies informed by user risk preferences and past behavior
- Temporal reasoning — Understanding how facts and relationships evolve over time
- Cross-session continuity — Context that persists across conversations and trading sessions
- Agent coordination — Shared memory across specialized agents (Regime, Narrative, Strategy)
The Memory Layer does not execute trades, allocate capital, or override validation requirements.
Persistent memory: User and agent memory
The persistent memory layer enables personalized AI interactions across sessions. Rather than storing raw conversation history, it uses LLMs to extract and consolidate salient facts.
How persistent memory works
- Intelligent extraction — LLMs identify important facts from conversations (not raw message storage)
- Memory consolidation — New memories are evaluated against existing ones to prevent redundancy
- Fast retrieval — Sub-50ms latency for real-time agent augmentation
- Scoped organization — Memories organized by user, agent, and session
Memory scoping in KEK
The persistent memory layer organizes memories hierarchically:
- User memory — Trader preferences, risk tolerance, past strategy outcomes, asset interests
- Agent memory — Strategy-specific learnings, performance patterns, market condition responses
- Session memory — Current trading context, in-flight decisions, active conversations
This scoping ensures agents receive relevant context without information overload.
Example use cases
- Remembering that a trader prefers conservative leverage (2x max)
- Recalling which strategy variants performed well under volatile conditions
- Personalizing alerts based on past acknowledged warnings
- Tracking which asset classes the user has shown interest in
The persistent memory layer provides recall — not prediction. All memory-informed recommendations flow through validation.
Knowledge Graph: Temporal knowledge graphs
The Knowledge Graph provides a temporal knowledge graph that captures evolving facts and relationships over time. Unlike static knowledge bases, it understands when facts became true, when they changed, and how entities relate across time.
How the Knowledge Graph works
- Bi-temporal model — Tracks both event time (when facts occurred) and transaction time (when recorded)
- Episodic memory — Raw events preserved with original timestamps (non-lossy)
- Semantic extraction — Entities and relationships extracted from episodes
- Temporal queries — "What did we know about X on date Y?"
- Conflict resolution — Automatically invalidates outdated facts when new information arrives
Three-tier memory architecture
The Knowledge Graph organizes knowledge hierarchically:
Episodic subgraph
- Raw events: trade executions, market data, user interactions
- High-fidelity, timestamped, non-lossy preservation
- Source of truth for all downstream processing
Semantic entity subgraph
- Extracted entities: assets, strategies, market regimes, risk factors
- Relationships with temporal validity intervals
- Enables pattern recognition across episodes
Community subgraph
- Clusters of semantically related entities
- Higher-order patterns emerge from relationships
- Reduces traversal complexity for large graphs
Example use cases
- Tracking how a strategy's performance evolved across different market regimes
- Understanding when a correlation pattern between assets emerged and changed
- Reconstructing the decision context at the time a strategy was validated
- Detecting when prior assumptions about market behavior became invalid
The Knowledge Graph provides structured memory for temporal reasoning — not trade execution.
Integration with MCP Agent Server
Both memory systems feed into the MCP Agent Server, which orchestrates KEK's specialized AI agents.
Data flow:
- User interactions and preferences are captured by the persistent memory layer
- Market events and facts are ingested by the Knowledge Graph
- MCP Agent Server queries both systems for relevant context
- Agents receive augmented context for strategy generation
- Generated strategies flow to validation (backtesting, paper trading)
- Outcomes feed back into memory for continuous learning
Memory augments agent intelligence but does not bypass validation gates.
Performance characteristics
Both memory systems are optimized for real-time agent augmentation:
- Persistent memory retrieval — Sub-50ms latency (p95)
- Knowledge Graph queries — Sub-100ms typical
- Memory consolidation — Automatic deduplication and conflict resolution
- Scalability — Designed for high-volume agent interactions
These characteristics enable memory-augmented decisions without introducing latency bottlenecks.
Detailed mechanics are available in private technical materials.
What the Memory Layer does not do
The Memory Layer does not:
- Execute trades or allocate capital
- Store private keys or access user funds
- Override validation requirements
- Guarantee strategy performance based on past patterns
- Replace the Knowledge Network's structured intelligence
Memory is infrastructure for context — not a prediction engine.
Why this matters
The Memory Layer enables KEK to:
- Reduce context loss — Important facts persist across sessions and conversations
- Improve personalization — Strategies adapt to observed user preferences
- Enable temporal reasoning — Agents understand how facts and relationships evolve
- Support auditability — Complete historical record for compliance and debugging
- Maintain validation discipline — Memory informs but does not override
KEK treats memory as infrastructure for better intelligence — not as a shortcut to execution.