I realized that Cosine Similarity is often a weak proxy for semantic truth, so I built a memory protocol based on Wasserstein-2 Distance (Optimal Transport) instead.
The core idea: Treat memory as a geometry problem. By measuring the transport cost between the "Stored State" and the "Retrieved State," we can mathematically enforce coherence. If the transport cost exceeds a threshold ($W_2 > \epsilon$), the system rejects the memory rather than hallucinating.The Benchmarks (Local CPU):Coherence: 0.96 (vs ~0.67 for standard RAG)Efficiency: 40x compression ratio via state s ynthesis.Cost: $0 (No external DBs; runs in-process).I’ve packaged the core protocol into a Python library (pip install remember-me-ai). The repo also includes a CLI "Cognitive Shell" I used to test it (with local models/voice), but the real engineering value is in src/rememberme/csnp.py.It’s MIT licensed. I’m looking for feedback on the optimal transport implementation—specifically edge cases where the topological bounds might break.