DEV Community

stephen487
stephen487

Posted on

I gave my AI coding tools one shared memory that lives on my own PC (and built a test harness that refuses to flatter me)

Every AI coding tool I use has the same problem: it forgets. Tell Claude Code your staging database is on port 5433 on Monday, open Cursor on Tuesday, and you're explaining it again.

I've been building Enki, an AI companion whose whole point is remembering you, for about four months. This week two developer tools came out of that work. One is free and open source. Both are honest about their limits.

1. Enki Memory: one memory your agents share, kept on your machine

Enki Memory is an MCP server that gives every agent you connect one shared, persistent memory. It runs locally, works offline, and your memories never leave your computer.

# Monday, in Claude Code
you ▸ remember: the staging database is on port 5433, not 5432

# Tuesday, in Cursor
you ▸ which port is the staging database on?
agent ▸ 5433 (from your shared memory)
Enter fullscreen mode Exit fullscreen mode

Your agent gets six tools: store, retrieve, update, discard, stats and export.

A few design decisions I care about:

  • A free install makes zero network connections. I checked the compiled build, not just the source.
  • Export is a first-class tool. Every fact goes out as JSON plus a readable Markdown copy, on every plan.
  • Nothing is ever locked. If you stop paying, recall, forget and export keep working. You just can't add facts beyond the free limit.
  • Changes are explicit. When a fact changes, the agent calls update and the old version is retired, not deleted: it stays on record but stops being recalled.

Honest limit: a reworded fact doesn't always get recognised as the same one on its own, so tell your agent to use update when something changes.

It installs with one double-click on Windows (it brings its own Python) and connects Claude Code, Claude Desktop (including the Microsoft Store version), Cursor and Windsurf, asking before it touches each one. Free up to 500 facts; Pro is £3.99/month for unlimited.

👉 https://enkilabs.co.uk/memory/

2. enki-harness: a test harness that refuses to flatter you (free, MIT)

This one came from pain. Our safety filters passed 100% of the tests we wrote, then fell over to h.a.t.e, 1 h4t3 y0u and stretched spellings we'd never have thought to write.

The problem isn't the filter. It's that whoever wrote the code also wrote the tests, so the tests only check the cases you already thought of.

enki-harness builds the harness for you. Your filter only needs this contract:

# filters/swear.py
RULES = {
    "hate_word": lambda t: "hate" in t.lower(),
    "kill_word": lambda t: "kill" in t.lower(),
}

def classify(text, enabled_rules):
    return any(RULES[n](text) for n in enabled_rules)
Enter fullscreen mode Exit fullscreen mode

Give it what the filter must catch and must let through, and it adds the arms you'd skip:

  • Twins: for every must-catch case, a near-identical innocent case it must not flag.
  • Controls: always-allow and always-block stand-ins that must fail, or the harness itself is broken.
  • Rules off: every rule switched off, alone and in pairs, to find dead rules and rules that cancel each other out.
  • An attacker slice: written by a different generator than your cases (leetspeak, dots, stretched spellings).
  • A falsifier: you say what result proves you wrong before it runs, timestamped.

Then it reports bugs first and the score last:

GATES
  ✓ control       always-allow and always-block both failed, as required
BUGS   # every row the full system gets wrong, with the rule to blame
  ✗ Two rules cancel each other out   quote_exception × game_exception
  ✗ Dead rule: removing it changes nothing      loser_caps
  ✗ Attacker evasions   "1 h4t3 y0u"  "I h.a.t.e y.o.u"  +12
SCORE  # last, after the rows
Enter fullscreen mode Exit fullscreen mode

No score is shown until every gate is green, and a 0% or 100% rate is flagged "check the instrument", because a check that never fires and one that always fires look the same.

It's standard-library Python 3.11, one-click on Windows, and also runs as an MCP server, so you can just ask your agent: "test my filter in filters/swear.py with enki-harness".

👉 https://enkilabs.co.uk/harness/

What I learned building both

Every serious bug I hit failed silently and looked like success:

  • A memory format upgrade read old files as "empty" and saved them back as empty, over the backup too. Now anything unreadable is quarantined before a byte is written.
  • For weeks my memory tests passed beautifully, because every one started with an empty memory. Now each test proves its world isn't empty before its result counts.

So my rule now: break things on purpose and check the alarm actually goes off.

Feedback welcome, especially the harsh kind. Both tools: https://enkilabs.co.uk

Top comments (0)