Dreaming Engine

Eldric Matrix Memory

Background memory consolidation and associative discovery. Like human sleep, but for AI — the EMM system lets your AI accumulate experience, discover hidden patterns, and build unique knowledge over time.

7 Memory Layers
Hierarchical Depth
~5,100 Lines
C++ Implementation
.emm Format
Binary Storage
Port 8899
Dream Daemon

What is Dreaming?

An LLM provides reasoning. EMM provides personal experience. Together they form something closer to a mind.

Conversations user + agent Store M += v ⊗ k Matrix .emm storage Dream idle cycles random blending pattern discovery Discover hidden links Recall M · query The Dreaming Cycle — continuous background consolidation recalled patterns enrich future conversations

LLM = Reasoning

Large language models provide general intelligence, language understanding, and logical reasoning. They process text, follow instructions, and generate responses. But they have no personal experience — every session starts from zero.

EMM = Experience

Eldric Matrix Memory provides persistent, compressed experience that accumulates over time. It remembers patterns from past interactions, discovers hidden connections during idle periods, and builds a unique knowledge base that no other instance shares.

Why "dreaming"? During idle periods, the system replays random combinations of stored keys through the matrix, much like how the human brain consolidates memories during sleep. This process surfaces unexpected associations — connections between concepts that were never explicitly linked during waking interactions.

Seven-Layer Memory Hierarchy

Information flows upward through the hierarchy only with human confirmation. Each layer serves a different temporal and organizational scope.

7 NOVA Matrix meta-learning · indefinite · decay 0.9999 6 Collective Matrix cluster-wide · indefinite · decay 0.9998 5 Discovery Matrix cross-experiment · indefinite · slow decay 4 Experiment Matrix team scope · configurable decay 3 Agent Matrix agent instance · task-dependent · decay 0.995 2 Personal Matrix per-user · months-years · decay 0.999 1 Conversation Buffer session · RAM only information flows upward only through human confirmation
Promotion requires approval. When the dream engine discovers a cross-experiment pattern, it does not automatically write it to layer 5 or above. A human scientist must review the discovery and explicitly confirm its promotion. This prevents hallucinated associations from contaminating higher layers.

Core Operations

Six fundamental operations power the entire memory system.

Store

Add key-value association from conversation. The matrix accumulates experience through outer product updates.

M = decay * M + importance * (v ⊗ k)
🔍

Recall

Query the matrix for stored associations. Returns a compressed representation of all related knowledge.

output = M * query

Creative Recall

Query with injected noise (temperature) to explore adjacent regions of the association space and surface unexpected connections.

output = M * (query + T * noise)

Consolidation

Post-conversation scoring and selective transfer to long-term layers. High-importance patterns are promoted; low-value ones are left to decay naturally.

Dreaming

Background random key blending during idle periods. Discovers hidden connections between concepts that were never explicitly linked in conversation.

Decay

Scheduled exponential forgetting with configurable rates per layer. Ensures the matrix stays focused on relevant patterns and does not saturate.

The mLSTM Foundation

Based on Sepp Hochreiter's xLSTM architecture — the matrix variant (mLSTM) that replaces scalar memory cells with full matrices.

Outer Product Update and Matrix-Vector Recall Key (k) d-dimensional Value (v) d-dimensional M d × d matrix compressed associations M' = αM + β(v ⊗ k) α = decay rate, β = importance weight × Query (q) Output M · q Compressed, generalizing memory — captures patterns rather than storing exact documents O(1) recall per query · O(d²) storage · graceful degradation under capacity pressure

Why Matrices, Not Vectors?

Traditional vector databases store exact embeddings and retrieve nearest neighbors. Matrix memory takes a fundamentally different approach: it compresses associations into a d×d matrix through outer products. This means the matrix generalizes — it captures the pattern of relationships, not individual data points. Recall is O(1), storage is bounded, and the system degrades gracefully as it fills.

Dual-Tier Architecture

EMM operates alongside the existing Data Worker vector storage. The matrix provides fast compressed recall for pattern-matching and association. The vector store provides exact, lossless retrieval of specific documents. Both are queried simultaneously and results are merged — the matrix surfaces connections while vectors provide citations.

Dream Worker Daemon (eldric-dreamd)

Background daemon that manages dream cycles, memory consolidation, and the full .emm storage lifecycle.

# Start dream daemon ./eldric-dreamd --port 8899 \ --controller http://controller:8880 \ --data-workers http://datad:8892 \ --dream-interval 300 \ --max-dream-cycles 10
# With inference for creative recall ./eldric-dreamd --port 8899 \ --controller http://controller:8880 \ --inference-workers http://worker:8890 \ --dream-temperature 0.3 \ --consolidation-threshold 0.7
FlagDefaultDescription
--port8899Listen port
--controllerController URL
--data-workersData worker URLs
--inference-workersInference worker URLs
--dream-interval300Seconds between dream cycles
--max-dream-cycles10Max cycles per session
--dream-temperature0.2Noise level for creative recall
--consolidation-threshold0.6Min importance to consolidate
--memory-dirautoPath to .emm files
Dashboard: Access the web dashboard at http://localhost:8899/dashboard to monitor dream cycles, view discovered patterns, inspect matrix saturation, and manage the memory hierarchy in real time.

Safety Architecture

Dreams are hypotheses, never autonomous actions. Every safeguard is hardcoded, not configurable.

Guardian Authority

Hardcoded kill switch. Dreams can NEVER modify source code, configuration files, or system state. The guardian constraint is compiled into the binary and cannot be overridden at runtime.

Dreams Are Hypotheses

No dream discovery is automatically promoted to a higher memory layer. Scientists and operators must review each discovery, evaluate its validity, and explicitly confirm or reject promotion.

🔒

Sandboxed Execution

The dream process runs in an isolated sandbox with restricted filesystem access. It can only read existing .emm matrix files and write new matrix data — nothing else.

📋

Audit Trail

Every dream cycle is logged with full provenance: input keys, blended outputs, confidence scores, timestamps, and the reasoning chain. Audit logs are immutable and stored separately from matrix data.

Non-negotiable constraint: The dream daemon has zero write access to anything outside its designated .emm storage directory. It cannot execute commands, modify files, send network requests to external services, or alter any configuration. This is enforced at the OS level through seccomp and filesystem mount restrictions.

.emm Binary Format

Eldric Matrix Memory v3 binary format — crash-safe, checksummed, and designed for concurrent access.

PropertyValueDetails
Versionv3Current format version
Header128 bytesMagic bytes, version, dimension, rank, CRC-32, SHA-256 checksum
Block Size64 KBFixed-size blocks with individual CRC-32 integrity checks
Crash SafetyWALWrite-ahead journal ensures atomic updates — no partial writes
RecoveryCheckpoint + ReplayFull disaster recovery from WAL journal replay
IntegritySHA-256 + CRC-32Per-block CRC for fast checks, full-file SHA-256 for verification
EndiannessLittle-endianNative x86/ARM format, no conversion overhead

Replication Modes

ModeDescriptionLatencyDurability
NoneSingle copy on local diskLowestSingle point of failure
AsyncBackground replication to backup data workersLowEventual consistency
SyncSynchronous write to all replicas before ACKHigherStrong consistency
QuorumMajority of replicas must ACK before write completesMediumMajority consensus

Domain-Appropriate Sizing

DomainInitial RankDimensionUse Case
chat64768Conversation memory
code128768Code patterns and idioms
particle_physics5121024LHC experiment data
genomics2561024DNA/protein sequences
seismic256768Earthquake patterns
robotics128512Motor control patterns
general64768Default configuration
Auto-expansion: Ranks automatically expand when saturation exceeds threshold (default 0.85). The system monitors eigenvalue distribution and adds rank capacity when the matrix approaches information-theoretic limits. Enterprise tier has no rank cap.

API Endpoints

Full REST API for dream management, memory operations, and system monitoring.

EndpointMethodDescription
/healthGETHealth check
/dashboardGETWeb dashboard
/api/v1/dream/statusGETCurrent dream cycle status
/api/v1/dream/triggerPOSTManually trigger dream cycle
/api/v1/dream/stopPOSTStop current dream cycle
/api/v1/dream/historyGETDream cycle history with discoveries
/api/v1/dream/configGET / PUTDream configuration
/api/v1/memory/storePOSTStore key-value in matrix
/api/v1/memory/recallPOSTMatrix recall
/api/v1/memory/creative-recallPOSTRecall with temperature noise
/api/v1/memory/consolidatePOSTTrigger consolidation
/api/v1/memory/matricesGETList all matrices
/api/v1/memory/checkpointPOSTCheckpoint all matrices
/api/v1/memory/verifyPOSTVerify block integrity

License Tiers

Feature availability by license level.

FeatureFreeStandardProfessionalEnterprise
Dream cycles / day 3 20 Unlimited Unlimited
Memory layers 3 5 7 7
Creative recall
Cross-experiment dreaming
Federated dreaming
Custom decay rates
.emm replication Sync Quorum
Dream workers 1 2 5 Unlimited

Federated Dreaming

Cross-institute knowledge sharing with privacy-preserving boundaries. Enterprise tier only.

Institute A Local Dream Daemon Private .emm Matrices Research Fingerprints Federated Layer Shared Fingerprints Only No raw data crosses boundary Institute B Local Dream Daemon Private .emm Matrices Research Fingerprints PRIVACY BOUNDARY PRIVACY BOUNDARY Only compressed research fingerprints cross institute boundaries — raw data stays local

Research Fingerprints

Instead of sharing raw matrix data, institutes exchange compressed fingerprints — low-dimensional signatures that describe the shape of discovered patterns without revealing the underlying data. A receiving institute can match its own discoveries against foreign fingerprints to find convergent research directions.

Cross-Pollination

When two institutes independently discover similar patterns (high fingerprint cosine similarity), the federated layer flags this as a potential collaboration opportunity. No data is shared automatically — the system only surfaces that a match exists, leaving the decision to establish contact entirely to the researchers.