YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
๐งฌ morphic_memory
The World's First Riemannian Memory Engine
Memory as curvature in information space โ not storage, but geometry
๐ The Deepest Question About Memory
Classical computing stores memory as bits in locations. Classical AI stores memory as weights in matrices.
Both answers are wrong at a fundamental level.
What is memory, physically?
Physics gives us a different answer:
A memory is a STABLE CONFIGURATION in an energy landscape.
Remembering is FALLING INTO A BASIN OF ATTRACTION.
Forgetting is the BASIN BECOMING SHALLOW.
Learning is CARVING A NEW BASIN.
morphic_memory is the first system built on this truth โ
memory as geometry, not storage.
๐งฎ The Three Mathematical Pillars
Pillar 1 โ Riemannian Memory Manifold
Every memory lives on a Riemannian manifold M โ a curved information space where the metric gแตขโฑผ encodes similarity:
M = (โโฟ, g) โ n-dimensional curved information space
Metric tensor: gแตขโฑผ(x) = โยฒE/โxโฑโxสฒ (Hessian of energy)
The metric tells us:
- How similar two memories are (geodesic distance)
- How strongly a memory is encoded (local curvature ฮบ)
- What memories are 'neighbors' (geodesic neighborhood)
- How memories interact (Riemann curvature tensor Rแตขโฑผโโ)
Pillar 2 โ Hopfield Attractor Dynamics
John Hopfield (Nobel Prize 2024) proved:
Every associative memory corresponds to a local minimum in an energy landscape E(x).
Hopfield energy: E(x) = -ยฝ xแตWx + ฮธแตx
Modern Hopfield: E(x) = -LSE(ฮฒ, Xแตx) + ยฝxแตx + C
โ Exponential storage capacity: M โค exp(n/2) memories
โ Retrieval in ONE STEP (for modern Hopfield)
morphic_memory UNIFIES:
Hopfield energy landscape โ Riemannian curvature
Energy minima โ Geodesic fixed points
Retrieval dynamics โ Geodesic flow
Pillar 3 โ Morphic Field Resonance
Inspired by Sheldrake's morphic resonance (mathematically formalized):
Similar forms resonate across the information field โ a memory strengthens when similar patterns appear, even without explicit reinforcement.
Morphic resonance equation:
dW/dt = ฮท ยท R(pattern, memory) ยท โW E
where R(p, m) = exp(-dยฒ_g(p, m) / 2ฯยฒ)
= Gaussian kernel on the Riemannian manifold
= morphic similarity between pattern p and memory m
Interpretation:
When a new pattern resembles a stored memory,
the memory's basin DEEPENS automatically โ
it resonates, reinforcing itself.
๐ What This Opens
1. Infinite-Capacity Associative Memory
mem = MorphicMemory(dimensions=512)
mem.encode(image_of_face) # Carves a basin in manifold
mem.encode(sound_of_voice) # Carves another basin
mem.encode(smell_of_perfume) # Another basin
# Perfect recall from partial input:
retrieved = mem.recall(partial_image) # Falls into nearest basin
# Returns the COMPLETE MEMORY โ face + voice + smell
2. Memory That Strengthens With Experience
# Morphic resonance: seeing similar things deepens memory
mem.encode(cat_photo_1)
mem.encode(cat_photo_2) # Resonates with cat_1 โ deepens the basin
mem.encode(cat_photo_3) # Deeper still
# Now cat memory is ROBUST โ survives noise, damage, time
3. Geometric Memory Search
# Find memories by GEOMETRIC PROXIMITY โ not keyword
nearby = mem.geodesic_neighborhood(query, radius=0.3)
# Returns all memories within Riemannian distance 0.3
# True semantic similarity โ not cosine, not Euclidean โ CURVED
4. Memory Topology
# Discover the topological structure of what you know
topology = mem.topology()
print(topology.connected_components) # Isolated knowledge clusters
print(topology.bridges) # Concepts connecting clusters
print(topology.holes) # Gaps in knowledge (Betti numbers)
๐๏ธ Architecture
morphic_memory/
โโโ core/
โ โโโ memory_manifold.py # Riemannian manifold of memories
โ โโโ hopfield_engine.py # Modern Hopfield attractor dynamics
โ โโโ morphic_field.py # Morphic resonance field
โ โโโ memory_trace.py # Individual memory trace data structure
โโโ manifold/
โ โโโ riemannian_metric.py # Metric tensor + geodesic computation
โ โโโ curvature_engine.py # Riemann/Ricci/scalar curvature
โ โโโ geodesic_flow.py # Retrieval as geodesic flow
โ โโโ parallel_transport.py # Moving memories along the manifold
โโโ attractor/
โ โโโ energy_landscape.py # Hopfield energy function
โ โโโ basin_detector.py # Find and measure basins of attraction
โ โโโ convergence_proof.py # Convergence guarantees
โโโ resonance/
โ โโโ morphic_resonance.py # Resonance kernel computation
โ โโโ field_evolution.py # Temporal evolution of morphic field
โ โโโ resonance_graph.py # Which memories resonate with which
โโโ engine/
โ โโโ morphic_engine.py # Public API
โโโ proofs/
โ โโโ storage_capacity.md # Proof: exp(n/2) storage capacity
โ โโโ convergence_theorem.md # Proof: retrieval always converges
โ โโโ riemannian_hopfield.md # Theorem: Riemannian-Hopfield duality
โโโ examples/
โโโ associative_recall.py # Face โ complete memory
โโโ knowledge_topology.py # Map the shape of knowledge
โโโ collective_memory.py # Shared morphic field across agents
โก Quick Start
from morphic_memory import MorphicMemory
mem = MorphicMemory(dimensions=256, sigma=0.5)
# Encode memories (carves basins in the Riemannian manifold)
mem.encode("The speed of light is 299,792,458 m/s")
mem.encode("Einstein proposed E=mcยฒ in 1905")
mem.encode("Quantum mechanics and relativity conflict at Planck scale")
# Recall from partial/noisy input (falls into nearest basin)
result = mem.recall("Einstein light energy")
print(result.memory) # Full encoded memory
print(result.confidence) # Basin depth (how strongly encoded)
print(result.geodesic_dist) # Riemannian distance to recalled memory
# Morphic resonance โ what resonates with this query?
resonant = mem.resonate("quantum gravity")
for r in resonant:
print(f" {r.memory} [resonance={r.strength:.3f}]")
# Topology of knowledge
topo = mem.topology()
print(f"Connected clusters : {topo.n_components}")
print(f"Knowledge bridges : {topo.bridges}")
print(f"Knowledge gaps (Hยน): {topo.betti_1}") # Topological holes
๐บ๏ธ Roadmap
- v1.0 โ Riemannian memory manifold
- v1.0 โ Modern Hopfield attractor engine
- v1.0 โ Morphic resonance field
- v1.0 โ Geodesic recall dynamics
- v1.1 โ Topological memory analysis (persistent homology)
- v1.2 โ Collective memory (shared morphic fields across agents)
- v1.3 โ Temporal memory decay (manifold deformation over time)
- v2.0 โ Quantum morphic memory (superposition of basins)
- v2.1 โ Neuromorphic hardware implementation
๐ Intellectual Property
MIT License โ Copyright (c) 2026 swordenkisk
Original invention date: March 2026 First public repository: github.com/swordenkisk/morphic_memory
"Classical memory stores. Morphic memory resonates. You don't retrieve a memory โ you fall into it."
First implementation of Riemannian-Hopfield memory geometry with morphic resonance fields. March 2026 โ swordenkisk ๐ฉ๐ฟ