An exploration into theoretical agentic memory architecture—a learning computer that evolves its own neural network-like memory structures rather than serving as a static assistant.
EvolveAI implements the Autopoietic Memory Theory, a novel approach to machine cognition that treats memory as a self-maintaining, self-organizing system. Unlike traditional databases or retrieval-augmented generation (RAG) systems, EvolveAI's memory actively evolves, decays, and restructures based on usage patterns.
| Principle | Description |
|---|---|
| Adaptive | Memory that learns, evolves, and restructures based on usage patterns |
| Accountable | Every memory operation is traceable with cryptographic audit trails |
| Retrievable | Intelligent recall mechanisms that surface relevant memories contextually |
This project is explicitly NOT:
- A chatbot or assistant
- Cloud-dependent (operates entirely locally)
- A static database (memory must evolve, decay, and restructure)
The Neural Net Processor serves as the computational engine implementing the Autopoietic Memory Theory. It orchestrates:
┌─────────────────────────────────────────────────────────────────┐
│ NEURAL NET PROCESSOR │
├─────────────────────────────────────────────────────────────────┤
│ ┌────────────────────────────────────────────────────────────┐ │
│ │ LIFECYCLE ORCHESTRATOR │ │
│ │ GROUNDING → SEMANTIC_PAUSE → ACTIVE_FLOW → DETACHMENT │ │
│ │ ↓ │ │
│ │ REM_SYNTHESIS │ │
│ └────────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌──────────────────────────┴──────────────────────────────┐ │
│ │ PROCESSING CORE │ │
│ │ ┌─────────┐ ┌──────────┐ ┌─────────┐ │ │
│ │ │ ENCODER │ ←→ │ TIER MoE │ ←→ │ DECODER │ │ │
│ │ └─────────┘ └──────────┘ └─────────┘ │ │
│ │ │ │
│ │ ┌──────────────┐ ┌─────────────────────┐ │ │
│ │ │ DECAY ENGINE │ │ SHADOW GENOME │ │ │
│ │ │ (CMHL) │ │ INTERCEPTOR │ │ │
│ │ └──────────────┘ └─────────────────────┘ │ │
│ └──────────────────────────────────────────────────────────┘ │
│ │ │
│ ════════════════════════════╪═══════════════════════════════ │
│ MEMORY BUS │
│ ════════════════════════════╪═══════════════════════════════ │
│ ┌────────────────────┼────────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ L1 TRANSIENT│ │ L2 TEMPORAL │ │ L3 UOR │ │
│ │ CACHE │ │ GRAPH │ │ VAULT │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────────┘
Each cognitive cycle progresses through five distinct phases:
- GROUNDING — Establish session context, load soul file, allocate fiber budget
- SEMANTIC_PAUSE — Safety check against Shadow Genome before execution
- ACTIVE_FLOW — Execute operations with full pipeline tracing
- DETACHMENT — Clear transient state, checkpoint L2 graph
- REM_SYNTHESIS — Learn from traces, crystallize stable memories to L3
| Tier | Name | Characteristics | Decay Rate |
|---|---|---|---|
| L1 | Transient Cache | Fast vector-based, TTL eviction | λ = 0.1 (aggressive) |
| L2 | Temporal Graph | CMHL decay, edge traversal, semantic relationships | λ = 0.001 (moderate) |
| L3 | UOR Vault | Immutable hash chain, O(1) lookup, cryptographic verification | λ = 0 (immortal) |
Memories are routed to tiers using the MTS algorithm:
MTS = (S × Ws) + (A × Wa) + (P × Wp) - (C × Wc)
Where:
- S = Sensitivity (personal data, secrets)
- A = Accuracy requirement (facts, references)
- P = Privilege level (core knowledge, foundational)
- C = Compute constraint (current resource availability)
Routing thresholds:
- MTS > 0.8 → L3 (UOR Vault)
- MTS > 0.3 → L2 (Temporal Graph)
- MTS ≤ 0.3 → L1 (Transient Cache)
Decay is computed lazily on retrieval using exponential decay:
w_current = w₀ × e^(-λt)
Where:
w₀= initial weight (salience at encoding)λ= decay constant (tier-specific)t= time since last access
A negative-constraint immune system that blocks execution when intent matches known failure patterns:
- Tracks failure categories:
COMPLEXITY_VIOLATION,HALLUCINATION,SECURITY_REGRESSION, etc. - Uses cosine similarity against embedded failure traces
- Provides safety verdicts:
PASSorBLOCK
src/
├── core/
│ ├── processor/ # Main NeuralNetProcessor facade
│ │ ├── index.ts # Processor class and factory
│ │ ├── types.ts # Public type definitions
│ │ └── config.ts # Unified configuration
│ │
│ ├── memory/ # Memory encoding/decoding
│ │ ├── types.ts # MemoryUnit, Query, RecallResult
│ │ ├── encoder.ts # Input → MemoryUnit encoding
│ │ ├── decoder.ts # Query → RecallResult decoding
│ │ └── decay.ts # CMHL decay engine
│ │
│ ├── tiers/ # Tiered memory storage
│ │ ├── router.ts # MTS calculation and routing
│ │ ├── l1-cache.ts # Transient vector cache
│ │ ├── l2-graph.ts # Temporal graph with decay
│ │ └── l3-vault.ts # UOR vault interface
│ │
│ ├── graph/ # Graph data structures
│ │ ├── node.ts # GraphNode definition
│ │ ├── edge.ts # Decay-weighted edges
│ │ ├── traversal.ts # BFS/DFS with CMHL
│ │ └── consolidation.ts # Graph pruning
│ │
│ ├── chain/ # L3 hash chain
│ │ ├── hash.ts # SHA256/UOR hashing
│ │ ├── block.ts # Block structure
│ │ ├── ledger.ts # Chain management
│ │ └── verify.ts # Integrity verification
│ │
│ ├── shadow/ # Safety system
│ │ ├── genome.ts # Shadow Genome store
│ │ ├── interceptor.ts # Semantic pause interceptor
│ │ └── failure-types.ts # Failure taxonomy
│ │
│ └── lifecycle/ # 5-Phase orchestration
│ ├── orchestrator.ts # State machine
│ ├── trace.ts # Pipeline tracing
│ └── phases/ # Phase implementations
│ ├── grounding.ts
│ ├── semantic-pause.ts
│ ├── active-flow.ts
│ ├── detachment.ts
│ └── rem-synthesis.ts
│
├── lib/
│ └── utils/ # Utility functions
│ ├── hash.ts # Cryptographic hashing
│ ├── time.ts # Temporal utilities
│ └── id.ts # UOR ID generation
│
└── tests/ # Test suite
├── core/ # Unit tests
├── integration/ # Integration tests
└── fixtures/ # Test data
# Clone the repository
git clone https://github.com/your-org/evolve-ai.git
cd evolve-ai
# Install dependencies
npm install
# Run tests
npm testimport { createProcessor } from './src/core/processor';
// Create processor with default configuration
const processor = createProcessor();
// Initialize the memory system
const initResult = await processor.initialize({
identity: 'my-agent'
});
console.log(`Session: ${initResult.sessionId}`);
console.log(`Genesis Hash: ${initResult.genesisHash}`);
// Encode a memory
const encodeResult = await processor.encode({
content: 'Important fact to remember',
metadata: { tags: ['fact', 'reference'] }
});
console.log(`Stored in: ${encodeResult.tierDecision.tier}`);
// Query memories
const queryResult = await processor.query({
content: 'What facts do I know?',
embedding: myEmbeddingFunction('What facts do I know?'),
context: { intent: 'recall' }
});
console.log(`Found ${queryResult.recall.memories.length} memories`);
// Shutdown
processor.shutdown();import { createProcessor, createProcessorConfig } from './src/core/processor';
const config = createProcessorConfig({
lifecycle: {
synthesisThreshold: 20,
detachmentStrategy: 'batched'
},
tierThresholds: {
l3: 0.9, // More selective for L3
l2: 0.4
},
interceptor: {
safetyThreshold: 0.9, // Stricter safety
criticalCategories: ['SECURITY_REGRESSION', 'HALLUCINATION']
}
});
const processor = createProcessor(config);const processor = createProcessor();
// Subscribe to events
const unsubscribe = processor.on((event) => {
switch (event.type) {
case 'MEMORY_ENCODED':
console.log(`Encoded ${event.unitId} to ${event.tier}`);
break;
case 'SAFETY_BLOCK':
console.warn(`Blocked: ${event.reason}`);
break;
case 'SYNTHESIS_COMPLETE':
console.log(`Crystallized ${event.result.crystallized} memories`);
break;
}
});
// Later: unsubscribe
unsubscribe();# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Run specific test file
npm test -- src/tests/core/decay.test.ts
# Watch mode
npm run test:watch| Module | Status | Coverage |
|---|---|---|
core/memory/decay |
✅ Implemented | Unit tests |
core/chain/* |
✅ Implemented | Unit tests |
core/tiers/router |
✅ Implemented | Unit tests |
core/lifecycle/* |
✅ Implemented | Unit tests |
core/graph/* |
Needs integration tests | |
core/shadow/* |
Needs integration tests | |
core/processor |
Needs end-to-end tests |
- Encoder/Decoder Integration — Test full encode→store→query→decode flow
- Graph Traversal Edge Cases — Test cycles, disconnected components, large graphs
- Shadow Genome Effectiveness — Test blocking accuracy, false positive rates
- L3 Vault Persistence — Test export/import, recovery from corruption
- Lifecycle Edge Transitions — Test error recovery, timeout handling
- Memory Pressure — Test behavior under L1 eviction pressure
- Concurrent Operations — Test parallel encode/query operations
- Embedding Model Integration — Test with actual embedding models (MiniLM)
| Document | Description |
|---|---|
| CONCEPT.md | Project DNA — Why, Vibe, Anti-Goals |
| ARCHITECTURE_PLAN.md | Original architecture blueprint |
| NEURAL_NET_PROCESSOR_DESIGN.md | Detailed design specification |
| AUTOPOIETIC_MEMORY_THEORY.md | Theoretical foundations |
| META_LEDGER.md | QoreLogic governance chain |
This is an experimental research project. Contributions should align with the project's anti-goals and core principles.
- All changes must pass the Gate Tribunal audit (
/ql-audit) - Code must adhere to Section 4 Razor constraints:
- Functions ≤ 40 lines
- Files ≤ 250 lines
- Nesting ≤ 3 levels
- All changes are logged in the META_LEDGER
Apache-2.0 — See LICENSE file
- Autopoietic Memory Theory — Foundational theoretical framework
- Prism UOR Foundation — Model Development Kit for identity algebra
- QoreLogic A.E.G.I.S. — Governance protocol for accountable development
Built with the QoreLogic A.E.G.I.S. lifecycle protocol