| I spent 9 months building Mutatis — a neuroplastic database that physically rewrites its own schema at runtime based on what it learns about you. The core problem: RAG systems treat all memories equally. "I'm allergic to peanuts" gets the same storage priority as "I like jazz music." Eventually, critical facts get buried under noise. Mutatis solves this through semantic-triggered schema evolution. When patterns emerge (e.g., "sara" mentioned 7+ times with family_spouse pattern), the system automatically creates a dedicated indexed table and migrates relevant records. Zero downtime via shadow table + atomic swap. The performance improvement is superlinear:
• 1,000 records: 18.9× faster (6.04ms → 0.32ms)
• 10,000 records: 62.1× faster (59.03ms → 0.95ms)
• 500,000 records: 213.4× faster (4.26s → 19.97ms) Query complexity improves from O(N) full table scans to O(log N) index lookups. The mutation literally changes SQL from: ```sql
-- Before: Generic table, full scan
SELECT * FROM generic_memories WHERE content LIKE '%sara%' -- After: Dedicated table, indexed
SELECT * FROM family_spouse_sara WHERE entity = 'sara'
``` The system uses √2 gravity weighting to ensure foundational memories outrank transient ones. Even when episodic memories have higher raw similarity (0.696 vs 0.670), the √2 boost ensures foundational facts rank first (0.947 final score). What triggers evolution:
• Medical conditions ("I'm allergic to penicillin")
• Identity statements ("I am vegetarian")
• Strong preferences ("I hate coffee")
• Pattern matching + confidence scoring + entity tracking Built with TypeScript + SQLite. Uses mock embeddings for the POC (no API keys needed—just clone and run). Patent pending (US 63/949,136). Interactive demo: Clone the repo and run `cd core && npm run dev` to watch schema evolution happen live. Repo: https://github.com/ScooterMageee/mutatis-public Looking for feedback on:
1. What other semantic patterns should trigger schema evolution?
2. Edge cases where automatic schema mutation could create inconsistencies?
3. How do you currently handle memory drift in RAG systems? |
One edge case I’m curious about is how the system handles modal logic or intent vs. fact. If a user says 'I live in Texas' and then 'I wish I lived in Florida,' a regex-heavy approach might struggle to differentiate between current state and aspiration.
In a 'neuroplastic' database, how do you handle schema deprecation or 'forgetting' when the foundational patterns drift (e.g., a user moves cities or changes a diet)? Do you have a mechanism for the schema to 'de-evolve' or merge back into a generic table if a specific entity's mention-frequency drops below a certain threshold?