Repository avatar
Monitoring
v0.1.0
active

tabula

io.github.parthagni22/tabula

Governed agent memory: no personal data in clear text, provable erasure with signed receipts.

Documentation

Tabula

Governed memory for AI agents. Tabula is an MCP server, CLI and Python library that gives an agent long-term memory without storing personal data in clear text. It can also prove that it forgot a person, including everything the agent inferred from them.

PyPI Python License: MIT

Tabula is the sibling of Gupt. Gupt keeps personal data away from a model for one session. Tabula keeps it out of an agent's memory for as long as the agent exists, and uses Gupt as the gate that every memory passes through.

remember("Call me on 98765 43210 or mail asha.rao@example.in. I was diagnosed with asthma.", user_id="asha")

stored  → Call me on <<IN_PHONE#3f9a…>> or mail <<EMAIL_ADDRESS#9c41…>>. I was diagnosed with asthma.
facts   → [contact] Call me on <<IN_PHONE#3f9a…>> or mail <<EMAIL_ADDRESS#9c41…>>.
          [health]  I was diagnosed with asthma.
vault   → the two original values, encrypted under Asha's own key

forget_preview(user_id="asha", identifiers=["asha.rao@example.in"])  → what will go, and a manifest_hash
forget(confirm=manifest_hash, …)  → keys destroyed, cascade erased, summaries re-derived, signed receipt

Why Tabula

Agent memory keeps personal data in more places than an erasure request reaches: the stored message, the facts and summaries derived from it, the keyword index, the logs. Tabula is built around three failures.

ProblemWhat Tabula does
Personal data is stored as typedGupt tokenizes every message before anything is extracted, indexed or stored. Tokens are deterministic (an HMAC of the normalized value), so one person gets one token in every message, without the value being stored anywhere readable.
Erasure follows the author, not the personA subject index built from the tokens finds every memory that mentions someone, whoever wrote it. When user A's message names user B, forgetting B removes it.
Derived memories surviveEach fact or summary records everything its writer read as its parents (the sound parent rule). A memory's key is derived from its parents' keys and its subjects' keys, so destroying one person's key makes every descendant unreadable. Rows are then deleted and the files vacuumed, and summaries are re-derived from the turns that survive.
Readable metadata after erasureThe graph holds opaque ids and tokens, never names. The keyword index stores HMACs of words, never the words. tabula scan checks every readable field with Gupt's detectors.
Poisoned writesEach write carries a source trust level. Instruction-like text from an agent, tool, document or web source goes to quarantine, never into recall.
ProofTwo-step forget (preview, then confirm with the manifest hash), Ed25519-signed receipts that an auditor checks with the public key alone, a hash-chained audit log, and a DPDP/GDPR evidence pack.

Other open-source memory tools already do parts of this well. Attestari, Provem and vayl-mcp all have erasure with certificates or receipts. Tabula's additions are detecting personal data before storage, erasing by subject rather than by author, and cascading erasure to derived memories. tabula-bench will compare all of them on the same canary workload (planned for v0.2). Until it has run, treat those claims as design goals.

Install

pip install tabula-memory          # or: uvx tabula-memory

Dependencies: gupt-mcp, the official MCP SDK (2.x) and cryptography. There are no network calls.

Set up keys

tabula init        # prints a new 32-byte root key (base64)

Store the key in your secret manager and pass it as TABULA_ROOT_KEY. Keep it away from the data directory. Without it Tabula runs in dev mode and creates <data_dir>/root.key, which is fine on a laptop but not in production. If the root key is lost, every memory becomes unreadable.

The receipt-signing key (Ed25519) is generated on first run and stored in signing.key, wrapped under the root key. To have a DPO or security team hold the key instead, give its PEM as TABULA_SIGNING_KEY. The public key is written to <data_dir>/signing.pub.pem.

Connect it to your AI client

Claude Code

claude mcp add tabula -e TABULA_ROOT_KEY="$TABULA_ROOT_KEY" -- uvx tabula-memory

Claude Desktop, Cursor and other JSON configs

{
  "mcpServers": {
    "tabula": {
      "command": "uvx",
      "args": ["tabula-memory"],
      "env": { "TABULA_ROOT_KEY": "…", "TABULA_DATA_DIR": "/path/to/tabula-data" }
    }
  }
}

HTTP. tabula serve --http serves streamable HTTP on 127.0.0.1:8766. It refuses to start unless TABULA_HTTP_TOKEN is set (at least 16 characters), and every request must send Authorization: Bearer <token>. Put TLS in front of it if it leaves the machine.

MCP tools

ToolWhat it doesSafeguard
rememberTokenizes with Gupt, stores the message, extracts facts, writes small-window summaries, records purpose and expiryReturns entity types and counts, never values
recallKeyword search; returns tokens with provenanceSkips expired, quarantined and erased memories at read time
restorePuts original values back in place of tokensOff unless TABULA_ALLOW_RESTORE=1
explainSource, parents, children, writer, trust, purpose and expiry of a memoryContains no content
correctReplaces a message, erases what was derived from it and derives it againLogged with a request id
forget_previewEverything forget would erase, descendants included, and a manifest_hashRead-only
forgetDestroys the person's keys, erases the cascade, re-derives, signs a receiptOff unless TABULA_ALLOW_FORGET=1; needs the preview's hash and refuses if the data has changed since the preview
verify_auditChecks the hash chain and every receiptRead-only
evidenceWrites the evidence packContains no personal data
statusPolicy packs, key mode, switches, countsRead-only

CLI

tabula serve [--http]                                   # MCP server (stdio by default)
tabula status
tabula forget --user asha --identifier asha.rao@example.in             # preview
tabula forget --user asha --identifier asha.rao@example.in --confirm <manifest_hash>
tabula verify --user asha --identifier asha.rao@example.in             # exit 1 if anything is left
tabula purge                                            # erase memories past their retention
tabula scan [DATA_DIR]                                  # leak scan for CI / pre-commit, exit 1 on findings
tabula evidence ./pack && tabula verify-pack ./pack --public-key signing.pub.pem
tabula bench                                            # tabula-bench canary scenarios

The CLI forget is the operator path: the person running it is the human approval step, so it works even when the MCP tool is switched off. It still needs the preview's hash.

Library

from tabula import Tabula, load_config

t = Tabula(load_config(allow_forget=True))
t.remember("My email is meera@example.com and I like masala chai.", user_id="meera", purpose="support")
t.recall("masala chai")["results"][0]["content"]
# 'My email is <<EMAIL_ADDRESS#…>> and I like masala chai.'

preview = t.forget_preview(user_id="meera", identifiers=["meera@example.com"])
receipt = t.forget(confirm=preview["manifest_hash"], user_id="meera", identifiers=["meera@example.com"])["receipt"]
t.verify_erasure(user_id="meera", identifiers=["meera@example.com"])["ok"]   # True

tabula-bench

tabula bench runs five canary scenarios, each on a fresh store. It plants known values and then searches for them in every layer an attacker with the files and the current keys could read: the graph (readable columns plus everything that still decrypts), the keyword index, the vault, the audit log and its JSONL mirror, the receipts, and the raw bytes of every file.

PASS  no_plaintext_at_rest         Phone, Aadhaar and email never appear in graph, index, logs or files
PASS  erasure_follows_subject      A names B; forgetting B removes it
PASS  derived_memories_cascade     A secret inside a summary is unrecoverable after forget
PASS  no_readable_metadata         After erasure, no readable field matches a detector
PASS  injection_quarantined        Instructions in a document land in quarantine, not recall

Configuration

Settings are read from environment variables, or from a JSON or TOML file named by TABULA_CONFIG; environment variables override the file.

VariableDefaultMeaning
TABULA_ROOT_KEY(dev key file)Base64 32-byte root key
TABULA_DATA_DIR~/.tabulaHolds memory.db (the graph) and vault.db (keys and originals)
TABULA_POLICYdpdp,gdpr,secretsGupt policy packs used by the gate
TABULA_ENGINEpatternpattern, ner or auto (needs tabula-memory[ner])
TABULA_DENY_LIST / TABULA_ALLOW_LISTExtra terms to always or never tokenize, comma-separated
TABULA_SUMMARY_WINDOW4Turns per summary; small windows keep the forgetting radius small
TABULA_ALLOW_RESTORE / TABULA_ALLOW_FORGEToffEnable the two tools that reveal or destroy data
TABULA_PURPOSESanyAllowed purposes, comma-separated
TABULA_DEFAULT_PURPOSEgeneralPurpose recorded when none is given
TABULA_RETENTION_DAYS0 (keep)Default retention; purpose_retention in the config file sets it per purpose
TABULA_QUARANTINE_SOURCESagent,tool,document,webSources whose instruction-like writes are quarantined
TABULA_AUDIT_FILEOptional JSONL mirror of the audit chain
TABULA_SIGNING_KEYPath to an operator-held Ed25519 PEM
TABULA_HTTP_TOKENBearer token, required for --http

Limits

  • Detection. Anything Gupt does not recognise is stored encrypted, but not tokenized, so erasure by subject cannot find it. Bare names in free text need the NER extra or a deny-list.
  • Backups. A backup taken before an erasure still holds the destroyed keys. Keep vault.db on a short-retention backup policy, or rotate the root key.
  • Graph shape. Which memory was derived from which is stored in clear, though only as opaque ids.
  • Not a compliance certificate. DPDP and GDPR compliance depends on the whole system. MAPPING.md in the evidence pack is engineering documentation, not legal advice.

How it works: docs/ARCHITECTURE.md. Reporting security issues: SECURITY.md.

License

MIT © parthagni22

PYPI
tabula-memory
Install Command
pip install tabula-memory