asmit dash
In publication

palimpsest

In publication · license and copywriting pending

Contradiction-aware memory for LLM agents. SQLite-backed, no infra.

What it is

A drop-in Python SDK and MCP server for any agent: contradiction-aware memory in a single SQLite file per namespace. No infrastructure, no service to run. Built on top of sqlite-vec; named after a manuscript that retains the trace of what came before.

Why it's needed

Every agent memory layer in 2026 (Letta, Mem0, Zep, Anthropic's memory tool) treats memory as either append-only or last-write-wins. Within ~50 turns of a non-trivial agentic task the store becomes internally inconsistent: contradictory facts coexist, the agent retrieves both, and downstream behaviour goes non-deterministic. You can't fix this with a bigger context window - by the time the contradiction is in the store, it's too late.

What it does

palimpsest treats every write as a verification event. New atom arrives → embed it, extract its subject, retrieve close prior atoms about the same subject, and ask an LLM verifier whether the new atom genuinely contradicts any prior. If yes, an LLM resolver decides the lineage - new_supersedes / old_wins / merge / keep_both - and applies it atomically. Forgetting is provenance-preserving: superseded atoms stay readable, with a chain to their replacements. Subject-scoping is the load-bearing fix that makes this ship - 'User likes coffee' and 'Bob dislikes coffee' don't trigger the verifier because their subjects differ.

How to use it

Install it:

git clone https://github.com/asmitdash/palimpsest

Then call it:

from palimpsest import Memory

mem = Memory.open("./agent_memory.db")
mem.write(content="User prefers tabs over spaces.", subject="user")
# later, after a contradiction…
mem.write(content="User now prefers spaces.", subject="user")
# palimpsest verifies the contradiction, supersedes the old atom,
# and preserves the lineage chain.
print(mem.lineage(atom_id))

Links