Metadata-Version: 2.4
Name: forgetproof
Version: 0.2.0
Summary: Detect and erase deleted records left on disk by the memory stores AI agents keep — Chroma, mem0, Qdrant local, LanceDB, SQLite, Postgres/pgvector, text files — with signed receipts, an MCP server, a desktop app and a provider SDK.
Keywords: ai-agents,agent-memory,vector-database,gdpr,right-to-erasure,chroma,pgvector,postgres,privacy
Author: StellarMinds
Author-email: StellarMinds <hello@stellarminds.ai>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Database
Classifier: Topic :: Security
Requires-Dist: cryptography>=42
Requires-Dist: playwright>=1.47 ; extra == 'browser'
Requires-Dist: chromadb>=1.0 ; extra == 'chroma'
Requires-Dist: pywebview>=5.0 ; extra == 'desktop'
Requires-Dist: keyring>=25 ; extra == 'keyring'
Requires-Dist: lancedb>=0.20 ; extra == 'lancedb'
Requires-Dist: mcp>=2.3 ; extra == 'mcp'
Requires-Dist: mem0ai>=2.2.1 ; extra == 'mem0'
Requires-Dist: psycopg[binary]>=3.1 ; extra == 'postgres'
Requires-Dist: starlette>=0.40 ; extra == 'site'
Requires-Dist: uvicorn>=0.30 ; extra == 'site'
Requires-Dist: httpx>=0.27 ; extra == 'site'
Requires-Python: >=3.11
Project-URL: Homepage, https://forget.stellarminds.ai
Project-URL: Documentation, https://forget.stellarminds.ai/docs
Project-URL: Source, https://github.com/Sharathvc23/forgetproof
Project-URL: Issues, https://github.com/Sharathvc23/forgetproof/issues
Project-URL: Changelog, https://github.com/Sharathvc23/forgetproof/blob/main/CHANGELOG.md
Provides-Extra: browser
Provides-Extra: chroma
Provides-Extra: desktop
Provides-Extra: keyring
Provides-Extra: lancedb
Provides-Extra: mcp
Provides-Extra: mem0
Provides-Extra: postgres
Provides-Extra: site
Description-Content-Type: text/markdown

# forgetproof
<!-- mcp-name: io.github.Sharathvc23/forgetproof -->

Detects and erases deleted records that remain on disk in the memory stores AI agents keep — Chroma,
mem0, Qdrant local, LanceDB, SQLite, Postgres/pgvector, and the markdown and JSONL files personal
agents write — and issues an Ed25519-signed receipt of the result.

Deletes in these stores are logical. The bytes persist in write logs, index tombstones, page free space,
history tables, old versions and unzeroed buffers until something rewrites them. `forgetproof` reads the
store files directly, reports what is recoverable, and rewrites the store so it isn't.

It comes in four forms, all from this codebase:

| | For | Start here |
|---|---|---|
| **CLI and library** | anyone with a store on disk | `forgetproof scan`, `forget`, `verify` (below) |
| **MCP server** | the agent you run yourself (Claude Code, Cursor, any MCP client) | `forgetproof mcp --home --owner --allow-fix` |
| **Memory Hygiene** | the desktop app, macOS and Windows | `forgetproof desktop` |
| **ForgetMe** (the button and the wire contract) | hosted personal agents and the companies they share with (Instinct, Hello Haven, Wajo, Muse, any Poppy agent or company) | [`docs/extension.md`](docs/extension.md), [`packages/forgetme-button`](packages/forgetme-button/README.md), the reference Company [`company/`](company/README.md); served for logged-out developers at [forget.stellarminds.ai/docs](https://forget.stellarminds.ai/docs) (the spec, schemas, a sample receipt, the verifier at `/verify`, the embed snippet, two quickstarts); the audit hand-off in [`docs/AUDIT.md`](docs/AUDIT.md) |
| **The 0.2 provider surface and SDK** | a hosted provider that wants signed erasure receipts without the button | [`docs/provider-surface.md`](docs/provider-surface.md), `forgetproof.agent.Provider` |

Live demo, in the format of [act.stellarminds.ai](https://act.stellarminds.ai): [`demo/`](demo/README.md).
The scope this release was built against is in [`docs/GOAL.md`](docs/GOAL.md).

forgetproof comes out of stellarminds.ai's research on non-membership proofs and memory erasure for
AI agents.

## Install

```bash
pip install forgetproof              # scan Chroma, mem0, Qdrant local, SQLite and text files
pip install 'forgetproof[chroma]'    # + fix Chroma (chromadb >= 1.0)
pip install 'forgetproof[lancedb]'   # + LanceDB (scan tells live from deleted; fix compacts)
pip install 'forgetproof[mem0]'      # + a verified delete around a mem0 Memory (docs/mem0.md)
pip install 'forgetproof[postgres]'  # + Postgres/pgvector
pip install 'forgetproof[mcp]'       # + MCP server for agents
pip install 'forgetproof[desktop]'   # + the Memory Hygiene desktop app
pip install 'forgetproof[keyring]'   # + keep generated keys in the OS keychain
```

Python 3.11+.

## For the agent you run yourself

```bash
forgetproof init --home              # finds Claude Code memory and transcripts, mem0, Letta, the memory
                                     # MCP server, Obsidian vaults, project folders; asks; pins them for you
forgetproof remembered mem0 --subject alice@example.com --subject "Alice Example" --show
forgetproof forget mem0 --subject alice@example.com --subject 415-555-0100   # erases what was deleted
forgetproof forget mem0 --subject alice@example.com --also-live             # ...and the live lines/rows too
forgetproof copies mem0              # sync folders, git, backups: where erasing here doesn't reach
forgetproof sweep                    # fix every pinned store that isn't open; one receipt each
```

A *subject* is one exact value or several (a name, emails, phone numbers in any common spelling, a pasted
secret). `remembered` says, per value and per store, whether it is still live, only recoverable, or gone;
`--show` (owner mode) shows the text around each live match, because the store is yours. `forget` erases
what the agent deleted but the store kept; `--also-live` additionally deletes the live records that
contain a value — off by default, and never offered for Postgres. Every receipt carries the number of
values, never the values, and the copies report, so a clean verdict is read next to the places it
doesn't cover.

Add it to the agent: `claude mcp add forgetproof -- forgetproof mcp --home --owner --allow-fix`. In owner
mode the agent may pass the values the user named to `what_is_remembered` and `forget_value`; context
comes back only with `--show`. Or open the desktop app: `forgetproof desktop` (bundles for macOS on Apple
silicon and for Windows are built by `.github/workflows/desktop.yml`; on an Intel Mac, install the
`[desktop]` extra and run the same command).

## Find your stores once, then refer to them by name

```bash
cd your_project
forgetproof init            # finds Chroma directories, SQLite files, and $DATABASE_URL etc.
                             # shows what it found, asks once, then writes .forgetproof.json
forgetproof scan memory      # "memory" is whatever init named it; works from any subdirectory too
```

`init` never acts on what it finds — it only proposes a list and writes nothing without that one
confirmation (`--yes` skips it; useful in a setup script you already trust). From then on, every
command that takes a store accepts a pinned name in place of a path or URL, resolved by walking up
from the current directory the way `git` finds `.git`. A pinned Postgres store records only the
*name* of the environment variable that holds its URL, never the URL itself, so the config file
never contains a password and a rotated credential needs no re-pinning. If what's actually at a
pinned location no longer matches what was pinned — a file where the directory used to be, say —
every command refuses it rather than silently acting on whatever is there now.

Resolving a bare name only ever considers a config file this user owns, isn't a symlink, and isn't
writable by anyone else, and stops climbing the moment an ancestor directory itself isn't owned by
this user — so a config planted in a shared directory above where you happen to be running from
(a bare `/tmp`, say) is never trusted. Even a config this user does trust can't point outside its
own directory or at an unrecognized environment variable; either is refused the same way. The
ownership check is POSIX-only (Windows exposes no equivalent through Python's standard library);
the containment and environment-variable checks hold on every platform.

## Usage

```bash
forgetproof scan ./chroma_dir --canary user3@example.com
forgetproof fix  ./chroma_dir --dry-run
forgetproof fix  ./chroma_dir --canary user3@example.com   # writes a signed receipt
forgetproof verify forgetproof-receipt-*.json --against ./chroma_dir

PGPASSWORD=... forgetproof scan postgresql://app@db:5432/agent
```

`--canary` / `--canary-file` name exact values that must be gone. Output and receipts refer to canaries
by index only; values and hashes are never written. `--format json|markdown` for machine output.
Exit codes: `0` clean, `1` residue found or scan incomplete, `2` error.

## Checks

| Store | Check | Residue |
|---|---|---|
| Chroma | `chroma.write_log` | Deleted records (text + embedding) in `embeddings_queue` |
| Chroma | `chroma.write_log_overwritten` | Pre-`update`/`upsert` versions in `embeddings_queue` |
| Chroma | `chroma.hnsw_tombstones` | Deleted vectors still in `data_level0.bin` (delete only sets a flag) |
| Chroma | `chroma.orphaned_index` | Index directories left by `delete_collection()` |
| Chroma | `chroma.uninitialized_index_memory` | Unzeroed `malloc` memory persisted in unused index capacity, and in all of `length.bin` for `l2`/`ip` spaces |
| SQLite | `sqlite.slack` | Deleted and replaced rows in free blocks, unallocated page space, freelist pages, the WAL and the journal |
| mem0 | `mem0.history_deleted` | Deleted memories' full text kept as rows in `history.db` (ADD, UPDATE and DELETE events) |
| mem0 | `mem0.history_versions` | The previous text of corrected memories, in UPDATE rows |
| Qdrant local | `sqlite.slack` | Deleted points (pickled vector + payload) in each collection's `storage.sqlite` |
| LanceDB | `lancedb.deleted_rows` | Rows hidden by deletion vectors, still in the fragment files |
| LanceDB | `lancedb.fragments` | Known-pattern values in fragments the table no longer returns |
| LanceDB | `lancedb.old_versions` | Earlier versions of the table, still readable with `checkout()` |
| Text files | — | Markdown and JSONL keep no deleted data; a value found is still live, and `forget --also-live` removes the lines that carry it |
| Postgres | `pg.table_residue` | Dead tuples in heap, TOAST and index files after `VACUUM` |
| Postgres | WAL (warning) | Canary values in WAL segments |

The SQLite check is structural. It parses the file into live cells and free space, and reports every
text fragment in free space that no live row explains, whatever the text says: a name and a street
address count as much as an email. The same check covers Chroma's `chroma.sqlite3`, mem0's `history.db`
and Qdrant local's `storage.sqlite`. Write-log, tombstone and orphan checks count records regardless of
content. Pattern matches (email, North American phone, US SSN, card numbers that pass Luhn, common API
key formats) annotate findings, and they are the only content check for Postgres table files, LanceDB
fragments and Chroma's leaked index memory. To check for a specific value, name it: `--canary` on `scan`
and `fix`, `--subject` on `forget` and `remembered`.

Postgres scans read relation files via `pg_read_binary_file` after a `CHECKPOINT`, which requires
superuser or `pg_read_server_files`. Without it, the scan falls back to `n_dead_tup` and is reported as
incomplete, never clean.

## Fix

`fix` rewrites the store in place with no undo, and keeps no backup (one would defeat the erasure; make your own first if you need it). It asks before proceeding unless you pass `--yes`; `--dry-run` prints the plan without changing anything.

**Chroma.** Preflight refuses to run if another process has the store open, if free disk is below
2× store size, or if the installed `chromadb` would migrate the store schema (override with
`--allow-upgrade`). Then:

1. Each collection is rebuilt from live records through the chromadb API in a child process: copy,
   verify count, swap. The swap is journaled, so an interrupted run is completed or rolled back on
   the next run. IDs, documents, metadata, embeddings and collection config are preserved; collection
   UUIDs change.
2. Orphaned index directories are deleted. Unused capacity and `l2`/`ip` `length.bin` are zeroed in
   place.
3. Write-log rows for dropped collections are deleted, then `VACUUM` runs with `secure_delete=ON`.
4. The store is rescanned and a receipt is issued.

Stop the application first: Chroma caches store state per process and may write it back.

**Postgres.** `VACUUM (FULL, ANALYZE)` on every table with a `vector`, `halfvec` or `sparsevec` column,
then `pg_switch_wal()` and `CHECKPOINT`. Requires table ownership. Takes an `ACCESS EXCLUSIVE` lock per
table, with `lock_timeout` set to 15 s.

**SQLite.** `VACUUM` with `secure_delete=ON`.

## Receipts

JSON with before/after findings, actions taken, canary results, warnings, an optional caller-supplied
`correlation_id` (`fix --correlation` / `forget --correlation`, below) and the SHA-256 of every store
file after the fix (relation files for Postgres). Signed with Ed25519. The key is generated on first use
at `~/.config/forgetproof/signing_key.pem` (override with `$FORGETPROOF_HOME`), or in the OS keychain
instead with `pip install 'forgetproof[keyring]'` and `FORGETPROOF_USE_KEYRING=1` — opt in explicitly;
forgetproof never auto-detects a keychain, since a backend needing an interactive unlock would otherwise
silently hang a non-interactive process the first time it ever runs. An existing file key is never moved
once that's turned on. The same applies to the key that encrypts a forget() request queued for Chroma.
`forgetproof key` prints the public key. `verify --key <fingerprint>` pins the signer, and
`verify --against <store>` rehashes and rescans the store.

A receipt is an operator attestation that anyone can recheck, not a third-party audit.

## MCP server

Exposes forgetproof to agents over MCP (stdio). The operator names the stores; the agent can only
refer to them by name, and can never name a value to look up or erase — it has no `canaries`
parameter anywhere. The one value a subject-scoped call acts on comes from `--subject-file`, a
file the operator's application keeps current with whoever is signed in; the agent cannot set it.
forgetproof refuses to read it unless it, and the directory it's in, are owned by root or by the
account the server itself runs as, aren't symlinks, and aren't writable by anyone else — so another
local user or process can't redirect who `forget_me` acts for, or use `check_if_forgotten` to probe
an arbitrary value. (The ownership and writability checks are POSIX-only; on Windows only the symlink
check applies.)

```bash
forgetproof mcp --store memory=./chroma_dir --store pg=postgresql://app@db:5432/agent \
  --allow-fix --subject-file /run/forgetproof/current-user
claude mcp add forgetproof -- forgetproof mcp --store memory=/srv/agent/chroma_dir   # Claude Code

forgetproof init --yes && forgetproof mcp --config .forgetproof.json --allow-fix  # from the pinned list
```

| Tool | Needs | Effect |
|---|---|---|
| `list_stores` | – | Configured store names, and whether fix and a subject are configured |
| `scan_store(store_name)` | – | Findings as counts only: never whether a specific value is present |
| `plan_fix(store_name)` | – | Steps `fix` would take; changes nothing |
| `check_if_forgotten(store_name)` | `--subject-file` | Whether *the current subject* still has recoverable data |
| `forget_me(store_name)` | `--subject-file`, `--allow-fix` | Erases the current subject's data; may come back `queued` (below) |
| `fix_store(store_name)` | `--allow-fix` | Erases everything the scan found, with no value argument |
| `get_receipt` / `verify_receipt(receipt_id)` | – | Receipt JSON; signature, file-hash and rescan check |

Responses never contain values or samples, redacted or not. Calls on the same store are serialized,
and subject-scoped calls are rate-limited per store. On Chroma, `forget_me` and `fix_store` return an
error, and `forget_me` queues the erasure instead of failing, while the application has the store
open; call `forgetproof run-queued` (below) at the application's next start, before it reopens the
store, to finish it — the server also does this for its configured stores on its own startup.
Receipts go to `~/.config/forgetproof/receipts` (`--receipts DIR`). Pass the Postgres password
through `PGPASSWORD` in the server's environment.

## Embedding directly

For an application with its own delete flow, call `forget()` instead of running a server:

```python
from forgetproof import forget

receipt = forget.forget(store, subject=user.email, correlation_id=case.id)   # erases now, or...
# forget.Queued(target=..., queued_at=..., correlation_id=...) on Chroma if the app still has the store open

# at the app's next start, before it reopens the store:
for receipt in forget.run_queued(store):
    ...
```

```bash
forgetproof forget ./chroma_dir --subject user3@example.com --correlation case-4471  # or "queued: …" if Chroma is open
forgetproof run-queued ./chroma_dir --receipts-dir ./receipts  # call before reopening the store
```

`correlation_id` is an opaque label forgetproof never looks at — a case or ticket id, say — carried
through to the receipt's `correlation_id` field either way, including when the request queues and
only actually drains later, in a different process, through `run_queued`. Without it, a queued
request's own receipt (and which of possibly several queued requests it was) is otherwise only
identifiable by store and timestamp. Keep it non-sensitive: like `target`, and unlike `subject`,
it's stored in the queue and written into the receipt in plaintext, not encrypted.

A queued request is encrypted at rest under a local key (`~/.config/forgetproof/queue` by default)
and deleted once it drains *clean* — not merely once it's been tried. A subject can legitimately
still be found afterwards (the same value can be part of another, unrelated live record that must
not be erased); `run_queued`/`run-queued` reports that result rather than claiming success, retries
up to `forget.MAX_ATTEMPTS` times, then parks the entry (kept, not auto-retried) rather than either
looping forever or silently dropping it. `forget.stale_entries(store)` reports parked entries.

A parked entry still holds its (encrypted) subject so it can be retried once resolved, but a tool
built to help with erasure requests shouldn't itself become an unbounded record of who made one:
`run_queued` purges a parked entry on its own once it's older than `forget.PARK_RETENTION_DAYS`
(30), and `forgetproof purge-stale [PATH] [--older-than-days N]` does it sooner on demand.

## GitHub Action

```yaml
- uses: Sharathvc23/forgetproof@v0
  with:
    path: ./chroma_dir                        # or a postgresql:// URL from a secret
    canaries: ${{ secrets.ERASED_VALUES }}    # optional, newline-separated
    fail-on-residue: "true"
```

Writes a counts-only job summary. Outputs: `clean`, `exit-code`.

## Defaults

Without any configuration — a test (`test_no_network.py`) checks the first one:

- **Nothing phones home.** forgetproof never imports a generic network client and makes no request
  except to the database you pointed it at. There's no telemetry to turn off.
- **Erasure is opt-in at every layer.** `scan` only ever reads. The MCP server offers no destructive
  tool at all unless started with `--allow-fix`, and `forget_me`/`check_if_forgotten` don't exist
  unless `--subject-file` is set.
- **No secret goes in a config file.** A Postgres URL's password comes from `PGPASSWORD` or the URL
  itself at call time, never from `init`'s pinned `.forgetproof.json`, which records only an
  environment variable's *name* for a Postgres store.
- **Few dependencies.** The installable package needs only `cryptography`; chromadb, psycopg, the
  `mcp` SDK and `keyring` are all optional extras, loaded only if you install them.

## For hosted personal agents and the companies they share with

**ForgetMe · powered by ForgetProof.** ForgetMe is the button beside a memory, and the same flow by
voice or chat, that makes "forget this" really happen and shows what happened; ForgetProof is the engine
behind it. A host puts [`<forget-me-button>`](packages/forgetme-button/README.md) beside each memory
and serves the ForgetMe v1 wire contract ([`docs/extension.md`](docs/extension.md): discovery through
`/.well-known/poppy.json`, preview, at-most-once submit, owner-scoped status, portable signed evidence)
over its own stores; a company the agent shared a record with serves the same contract on its own origin
and answers with its own evidence, which the person's browser verifies against the keys each issuer
publishes. Schemas and fixtures: [`schemas/forget-me/v1/`](schemas/forget-me/v1/). The reference Company,
in Python over SQLite with its own key: [`company/`](company/README.md). ForgetMe is a third-party
extension proposal targeting Poppy 1.0; it is not approved, adopted or reviewed by anyone.

A provider that wants signed erasure receipts for the signed-in user without the button embeds
[`forgetproof.agent.Provider`](src/forgetproof/agent.py): it wraps the provider's stores, erases the
user's values on request, signs receipts with the provider's key, and serves `/.well-known/forgetproof.json`,
`POST /forgetproof/forget`, `status` and `receipts` as a pure ASGI app. The subject always comes from the
provider's session, never the request; a store the provider can only delete through an API gets the
verdict `UNVERIFIABLE`, never `CLEAN`. That surface is [`docs/provider-surface.md`](docs/provider-surface.md);
a browser or Node verifies either kind of receipt with
[`packages/forgetproof-verify`](packages/forgetproof-verify) and no dependencies.

## Limitations

- Operates on store files only. Filesystem snapshots, copy-on-write blocks, SSD remapping, backups,
  replicas and WAL archives are out of scope; the copies report names the ones it can see.
- On an SSD an in-place overwrite doesn't defeat wear levelling. forgetproof removes data from the logical
  files, which is what copies, syncs, backups and other programs read; full-disk encryption covers the rest.
- A record that is *about* a person without any of their exact values isn't matched.
- A deleted SQLite row is not reported when every 16-byte stretch of its text also occurs in live rows, or
  when it differs from a live row only in its last two characters. Name the value as a canary to check
  for it.
- Postgres table files, LanceDB fragments and Chroma's leaked index memory are checked by pattern only,
  so a name or an address there is found only when you name it as a canary.
- Compressed values (Postgres TOAST `pglz`/`lz4`) are not visible to byte scanning. `fix` still
  removes them.
- Chroma can persist new uninitialized memory on its next index write. Run `scan` periodically or in CI.
- SQLite's `secure_delete` default is compiled into the library. Debian and Ubuntu build their system
  SQLite with it on, so an application using that library zeroes rows as it deletes them and
  `sqlite.slack` findings are rare there. Pythons from python.org, Homebrew, conda and uv bundle a
  SQLite with the ordinary default, and so do most desktop apps.
- Cosine-space embeddings may differ in the last float32 ulp after a rebuild, because Chroma stores
  them normalized.

Tested on Linux, macOS and Windows; Python 3.11 to 3.14; Chroma 0.6.3 to 1.5.9 (`fix` needs 1.x);
Postgres 16 to 18 with pgvector 0.8.

## References

Chakraborttii, García Alvarado, Abdulofizova, Dwivedi. *Ghost Vectors: Soft-Deleted Embeddings Remain
Reconstructible in HNSW Vector Databases.* 2026. [arXiv:2606.18497](https://arxiv.org/abs/2606.18497)

## Development

```bash
uv sync
uv run pytest   # Postgres tests use pgserver, or FORGETPROOF_TEST_PG_URL
```

## License

MIT © 2026 stellarminds.ai
