frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Mutatis – Database that mutates its schema based on semantic patterns

https://github.com/ScooterMageee/mutatis-public
2•Mutatis•2h ago

Comments

Mutatis•2h ago
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?

regnodon•2h ago
Really interesting approach to the RAG noise problem. The atomic swap via shadow tables is a clever way to handle the migration.

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?

Mutatis•1h ago
Mutatis: Autonomous Schema Evolution & Managed Deprecation

I’ve seen a lot of discussion about "Memory Bloat" in RAG systems. In Mutatis, we solve this by treating the database schema as a fluid organism that evolves (and de-evolves) based on a combination of Semantic Pattern Detection and Confidence Decay.

As the data scales, the system shadow-builds specialized tables for high-confidence entities, shifting query complexity from O(N) to O(log N).

How we handle the lifecycle of a memory from "Generic" to "Optimized" and back again:

1. SEMANTIC LOGIC VS. REGEX We don't trigger schema changes on keyword frequency alone. We use an LLM-driven classifier to distinguish Modal Logic (intent) from Foundational Facts. - Intent: "I wish I lived in Florida" -> Stored as preference in a generic table. - Fact: "I live in Florida" -> Triggers the evolution pipeline. This prevents schema "pollution" from noise or aspirational intent.

2. MENTIONS, DECAY, AND "DE-EVOLUTION" Schema evolution is a reward for frequently referenced data; deprecation is the penalty for irrelevance. - Confidence Decay: When contradictory statements are detected (e.g., "I moved to Texas"), the confidence score for the "Florida" schema decays. - Frequency Thresholds: If an optimized table isn't hit within a specific window, it is flagged for De-Evolution.

3. MECHANISM: SHADOW TABLES & ATOMIC SWAPS To ensure zero-downtime, we use a shadow-table migration pattern: - Selection: A schema is flagged for merging via periodic hygiene checks. - Shadow Merge: A background transaction copies data from the specialized table back into a generic_memories table. - Atomic Swap: We drop the specialized table and update the query router in a single atomic transaction.

MANAGED MEMORY LIFECYCLE SUMMARY: Mechanism | Purpose | Implementation Mention Decay | Identifies stale data | Rolling counters on hits Confidence Scoring | Handles contradictions | Drift via sqrt(2) weighting Hygiene Checks | Prevents schema bloat | Periodic TTL-driven merges Atomic Swaps | Safe transitions | Transactions + Shadow Tables Modal Tagging | Filters intent vs fact | Zero-shot categorization

THE BOTTOM LINE: By allowing the schema to "de-evolve" back into generic tables, we maintain O(log N) performance for relevant data without the overhead of maintaining thousands of stale indices.

Mutatis•2h ago
Here's what happens when you run the demo:

After mentioning "abel" 4 times with emotional patterns, schema evolution triggers:

════════════════════════════════════════ SCHEMA EVOLUTION TRIGGERED ════════════════════════════════════════ [SHADOW] Creating emotional_love_evolved_shadow... [BACKFILL] Moving records mentioning 'abel'... [BACKFILL] Moved 8 records [SWAP] Executing atomic transaction... [COMPLETE] Schema evolved successfully

  Before: SELECT * FROM generic_memories WHERE LIKE '%abel%' (O(N) scan)
  After:  SELECT * FROM emotional_love_evolved WHERE entity = 'abel' (O(log N) index)
════════════════════════════════════════

Query performance: • Before evolution: 1.25ms (vector scan) • After evolution: 0.57ms (indexed lookup)

Try it yourself: ```bash cd core && npm install && npm run dev ```

Example session: ``` add I live in Texas add I love abel add abel lives with me add abel loves Texas add I love abel # ← Evolution triggers here

query who is abel? ```

Watch the system detect patterns, track entities, and evolve the schema in real-time. The O(log N) indexed retrieval kicks in automatically after evolution.

How the "Marvelization" of Cinema Accelerates the Decline of Filmmaking

https://www.openculture.com/2025/11/how-the-marvelization-of-cinema-accelerates-the-decline-of-fi...
2•PaulHoule•2m ago•0 comments

Introducing RalphOS, a vibe-coded operating system

https://www.loom.com/embed/39e3a53db15b4a62b8b9935a638038ce
1•ghuntley•2m ago•1 comments

Write JavaScript with no hands: a tool for whistling code

https://velato.net/HandsFree/
1•klowin•2m ago•0 comments

You and Your Research – Richard Hamming (June 6, 1995) [video]

https://www.youtube.com/watch?v=a1zDuOPkMSw
1•TheAlchemist•3m ago•1 comments

Framework Is Showing

https://dbushell.com/2025/06/13/your-framework-is-showing-nextjs-error/
1•ulrischa•4m ago•0 comments

The Slow Media Manifesto

https://en.slow-media.net/manifesto
2•arguflow•4m ago•0 comments

NASA Craft to Face Heat-Shield Test on Its First Astronaut Flight Next Year

https://www.wsj.com/science/space-astronomy/nasa-heat-shield-test-astronaut-flight-1ce26626
1•JumpCrisscross•5m ago•0 comments

Show HN: Coffee Hop – Find work-friendly coffee shops by walking time

https://hop.coffee
1•dsmurrell•5m ago•0 comments

Ask HN: How good do I need to be to work at a startup?

1•anastasiaess•9m ago•1 comments

Show HN: tmpo – CLI time tracker with Git integration and local-first storage

https://github.com/DylanDevelops/tmpo
1•dylandevelops•9m ago•0 comments

Building a 64-Bit OS from Scratch with Claude Code

https://isene.org/2025/11/SimplicityOS.html
1•oidar•13m ago•0 comments

Show HN: AI Tutor for Math with Customer Hardware

https://app.toughtongueai.com/run/seminarlines-algebra-tutor-69513790800e1ea3b09856a5/
1•ajabhish•13m ago•0 comments

I had Claude build an automated generative art gallery to test my custom skills

https://josh-gree.github.io/gen-art-gallery/
1•josh-gree•13m ago•1 comments

Nexperia in no-man's-land: how the company became caught between 2 world powers

https://www.nrc.nl/nieuws/2025/12/30/nexperia-in-no-mans-land-how-a-chip-company-became-caught-be...
2•akyuu•15m ago•0 comments

ADHD drugs don't work the way we thought

https://www.sciencedaily.com/releases/2025/12/251225235942.htm
3•t-3•16m ago•1 comments

A Simulator for Stock Diversification

https://diversifire.ludable.com
1•ludable•17m ago•1 comments

Show HN: Topas-DSPL – A 15M param AI that solves hard reasoning tasks(ARC-AGI-2)

https://github.com/Bitterbot-AI/topas_DSLPv1
1•Doug_Bitterbot•17m ago•2 comments

Ask HN: Do I have depression or my relationship sucks?

4•lekker-kapsalon•19m ago•1 comments

Ask HN: What happens to a ccTLD when a country ceases to exist?

1•Akashic101•20m ago•2 comments

Oh My Opencode: A Better Opencode Experience

https://github.com/code-yeongyu/oh-my-opencode
1•BeetleB•20m ago•0 comments

Gestational diabetes rose every year in the US since 2016

https://news.northwestern.edu/stories/2025/12/gestational-diabetes-rose-every-year-in-the-us-sinc...
1•gmays•21m ago•0 comments

Minification Doesnt Matter Much

https://gomakethings.com/minification-doesnt-matter-much/
1•ulrischa•21m ago•0 comments

Compute Is the New Car

https://subvocalizing.substack.com/p/compute-is-the-new-car
1•jbwinters•21m ago•1 comments

Show HN: Llmcc – Multi-depth architecture graphs for code understanding

1•allenanswerzq•22m ago•0 comments

China's Cancer Villages (Which They Deny Exist) [video][25m]

https://www.youtube.com/watch?v=72FA8Sx4dh8
1•Bender•23m ago•0 comments

Reflections on 2025

https://samuelalbanie.substack.com/p/reflections-on-2025
1•jacobedawson•24m ago•0 comments

How Buttondown uses your content to power generative AI

https://buttondown.com/blog/generative-ai
1•gpi•25m ago•0 comments

Sabotaging Bitcoin

https://blog.dshr.org/2025/12/sabotaging-bitcoin.html
2•zdw•26m ago•0 comments

Building Tetris Time with Claude Code

https://koenvangilst.nl/lab/tetris-time
1•vnglst•27m ago•0 comments

Wrapped Envy Season

https://www.wreflection.com/p/wrapped-envy-season
2•nowflux•27m ago•0 comments