🧠 Microscope Memory
A living, self-organizing cognitive memory engine for AI agents.
Not a database. Not a vector store. A system that learns, dreams, and remembers — written in 62,938 lines of pure Rust.
TL;DR — What Is This?
Microscope Memory is a cognitive memory engine that models how a biological brain remembers, forgets, and learns. It runs a 12-layer cognitive architecture across 9 hierarchical depths (D0–D8) with 1.28 million blocks — all backed by pure binary (mmap, SIMD, zero JSON).
Think of it as the hippocampus + neocortex + amygdala rolled into a single 3 MB Rust binary.
Block Distribution (demo corpus)
🧭 Why This Exists
Traditional AI systems treat memory as a database — fetch, store, query. But real intelligence is not about retrieval accuracy. It is about:
- What gets forgotten (Absentia — the silence layer)
- How memories transform on recall (Reconsolidation)
- What emotions attach to memories (Emotional Contagion)
- Which associations strengthen through co-activation (Hebbian Learning)
This engine was built to experiment with those biological principles at scale — and to make them available to any AI agent that needs a real memory, not a lookup table.
Built by Máté R. — a researcher who started as a factory worker (6 days/week, rotating shifts) and taught himself to code 2 years ago. His work on wave-quantum is hardware-validated on real superconducting QPUs (IBM Fez, Marrakesh, Kingston — 156Q Heron r2, Pearson 0.99+). The same rigor of falsification, pre-registration, and statistical validation is applied here.
🚀 Quick Start
# Native build (release — approx. 2.5 min on a modern CPU)
git clone https://github.com/silentnoisehun/microscope-memory.git
cd microscope-memory
cargo build --release
# Quick test
./target/release/microscope-mem store "hello world" -l session -i 5
./target/release/microscope-mem recall "hello"
WASM (Browser)
cargo build --target wasm32-unknown-unknown --release \
--features wasm --no-default-features
wasm-pack build --target web --release \
-- --features wasm --no-default-features
Docker
docker build -t microscope-memory .
docker run -p 8080:8080 microscope-memory
🏗️ Architecture
13 Cognitive Modules
The Cognitive Gradient
The system computes a gradient at every cycle to decide where and how to grow:
gradient = w₁·relevance + w₂·resonance + w₃·evidence
+ w₄·hebbian + w₅·prediction + w₆·emotion + w₇·execution
Phase Transitions
Absentia Shadow Term
effective_gradient = positive_gradient × (1 − absence_shadow)
The shadow term prevents growth toward areas with weak evidence, without blocking exploration entirely.
The seven-component cognitive gradient drives every learning decision. Bottom-up causality: node → path → organism → field → phase. Top-down: phase → field → growth rule → path → node.
⚡ Performance
v0.8.x → v1.2.0 Optimisation Gains
All figures are measured on release builds (in-process A/B runs, warm-up discarded):
Honest boundaries: The end-to-end CLI is dominated by process startup (~17 ms floor), so user-visible
findimproves modestly. In-loop paths (bridge, MCP, benchmarks) improve by ~10×.
Benchmark Corpus (v0.9.2+ commit e0cea99, 12-core Ryzen 5 7535HS)
These are single-observation measurements from BENCHMARKS.md — recorded on one machine, not a distribution. The query set was not retained, so recall numbers cannot be re-derived.
See BENCHMARKS.md for full methodology, χ² goodness-of-fit (95% confidence), and the 2Q parity analysis (95% χ²red).
🛠️ CLI Commands
# Memory Operations
microscope-mem recall " query " # Top-5 recall
microscope-mem store " text " -l session -i 5
microscope-mem find " pattern "
microscope-mem stats
microscope-mem verify
# Cognitive Morphogenesis
microscope-mem morphogenesis status
microscope-mem morphogenesis run
microscope-mem morphogenesis adversarial
microscope-mem morphogenesis deep-adversarial
# Absentia (Silence Layer)
microscope-mem absentia status
microscope-mem absentia scan
microscope-mem absentia anti-hebbian
microscope-mem absentia causal-laundering
# Intent Pipeline
microscope-mem intent generate
microscope-mem intent genome
# Other Cognitive Commands
microscope-mem hebbian
microscope-mem resonance
microscope-mem patterns
microscope-mem hottest 5
microscope-mem dream
microscope-mem autonomous
🔌 Integration
MCP (Model Context Protocol)
Microscope Memory ships with a native MCP server built on the rmcp
crate. Two transports are available:
The stdio server implements the full JSON-RPC 2.0 framing by hand (protocol
version 2024-11-05) with 47 tools covering store, recall, spatial look,
MQL query, session log, Hebbian learning, emotional field, dream
consolidation, and more.
The Streamable HTTP server uses rmcp's StreamableHttpService and speaks
protocol version 2026-07-28 (compatible with 2025-11-25 and 2024-11-05).
It exposes the core tools — memory_status, memory_store, memory_recall,
memory_find, memory_look, memory_mql_query, memory_session_log,
memory_ping, memory_build, and memory_speak (text-to-speech via system SAPI).
Security
- API key auth — when
[server].api_keyis set inconfig.toml, every request must carry it via thex-api-keyorAuthorization: Bearer <key>header. - Origin validation — when
[server].cors_originis set, cross-origin requests whoseOriginheader doesn't match are rejected (DNS-rebinding protection). - Session management —
Mcp-Session-Idheader handling viaLocalSessionManager(stateful + stateless modes).
Local MCP (stdio) — Claude Desktop config
{
"mcpServers": {
"microscope": {
"command": "/path/to/microscope-mem",
"args": ["mcp"]
}
}
}
Streamable HTTP — remote access
# Start the server (requires --features mcp_http)
cargo build --release --features mcp_http
./target/release/microscope-mem mcp-http --host 127.0.0.1 --port 8080
# With API key (set in config.toml under [server])
curl -H "x-api-key: your-key" http://localhost:8080/mcp
# MCP client .mcp.json (Streamable HTTP)
# For Cursor, Claude Code, etc.:
{
"mcpServers": {
"microscope-http": {
"type": "http",
"url": "http://localhost:8080/mcp",
"headers": {
"x-api-key": "your-key"
}
}
}
}
REST API (Spine Bridge)
# Start the HTTP bridge
microscope-mem --serve-http --port 8080
# API endpoints
curl http://localhost:8080/recall?query=hello
curl -X POST http://localhost:8080/store -d '{"text":"hello","layer":"session"}'
WASM API
import { MicroscopeWasm, HopeCli } from './microscope_memory.js';
const mem = new MicroscopeWasm();
await mem.loadBinary(meta, headers, data);
const results = mem.recall("quantum computing", 5);
🔬 Validation & Testing
Unit Tests
cargo test # All tests (451 lib + 88 integration)
cargo test --lib # Library tests only
cargo test --test integration
Adversarial Tests
microscope-mem morphogenesis adversarial # Basic (8/8 PASS)
microscope-mem morphogenesis deep-adversarial # Deep (7/7 PASS, 5 warnings)
microscope-mem morphogenesis presence-absence-test
Hook Tests
cargo test -p microscope-hooks # 16 hook tests
🤝 Open Research
I'm an independent researcher working at the intersection of quantum information theory and neuromorphic AI. My work is:
- Hardware-validated: wave-quantum ran actual circuits on IBM superconducting QPUs (Fez, Marrakesh, Kingston — 156Q Heron r2), achieving Pearson correlations of 0.87–0.999.
- Statistically rigorous: Every claim is backed by χ² analysis, pre-registered falsification chains, and binomial error bounds.
- Transparent: All raw data, circuit hashes, and evaluation scripts are in the repository.
I'm actively seeking:
- Research collaborations — quantum error mitigation, neuromorphic memory, agentic AI architectures
- Peer review — feedback on falsification methodology and the cognitive gradient design
- Cross-validation — especially on the biological plausibility of the reconsolidation model
- Speaking engagements — on post-academic science and the factory-to-researcher journey
Contact
- ORCID: 0009-0003-3986-6039
- Email: [email protected]
- Sponsor: github.com/sponsors/silentnoisehun
📄 Documentation
🔧 Build
# Native
cargo build --release
# With semantic embeddings (BERT/ONNX)
cargo build --release --features "native,embeddings"
# With Streamable HTTP MCP server
cargo build --release --features mcp_http
# WASM
cargo build --target wasm32-unknown-unknown --release \
--features wasm --no-default-features
Note: Without the
embeddingsfeature, semantic recall falls back to a mock provider. The build succeeds but will refuse to return meaningless results — verifydata/embeddings.binexists before measuring. Available providers:mock(hash-derived, default),candle(BERT),onnx. Seescripts/eval_real.shfor reproducing published retrieval numbers.
🪪 License
MIT — see LICENSE.
🙏 Acknowledgements
- Built by Máté R. (Silent Noise) — a factory worker who taught himself to code 2 years ago and ended up on a quantum computer.
- Architecture inspired by: Hebb (1949), Damasio (1999), Tonegawa (2015), and the biological reality that memory is not storage — it is becoming.