This is the "Dirty Prototype" for Project REM, an experimental memory consolidation engine that uses an "Anti-Gravity" algorithm to prevent Model Collapse in AI systems.
Standard RAG systems retrieve memory based on the strongest probability (Gravity). This leads to the reinforcement of common paths and the forgetting of unique, creative, or long-tail data.
Project REM introduces "Dream Cycles":
- Invert Gravity: Treat edge strength as "Cost". Stronger edges are harder to traverse.
- Find the Weakest Path: The algorithm seeks the path of least resistance through weak connections.
- Synthesize a Dream: The AI generates a narrative bridging these weak concepts, strengthening the synaptic weight between them.
Requires Python 3.8+ and networkx.
pip install networkx matplotlibTo replicate the "Scout Report" (Ancient Rome -> Python Coding):
python demo_experiment.pyTo run a random "Dream Cycle" on a mock dataset:
python run_dream.pyTo visualize a random Dream Path (requires matplotlib):
python visualize_dream.pyrem_engine.py: The core MemoryGraph class and Anti-Gravity pathfinding logic.demo_experiment.py: The specific script proving the "Rome -> Python" bridge.run_dream.py: A script that runs continuous random dream cycles.
Built as a proof-of-concept for the Anti-Gravity Memory architecture.
