Repository navigation
Hosted shared agent memory on Supabase - #1
Merged
Merged
Conversation
Single gte-small embed fits the free tier (~92 ms short, ~305 ms typical, ~455 ms at the 512-token cap). CPU is accounted per worker, so budget ~1 s per request: store_batch cap 2, recall topic cap 5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Thirteen TDD tasks: schema, RLS, SQL functions and search (pgTAP), shared core and decay port, Postgres store, MCP tools, admin CLI, Edge Function, backup, LanceDB import, then CI/README/deploy/smoke. Caps from the spike. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…om empty Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also type-check every TS file (the old glob did not recurse), add the hosted smoke test, and capture the expected server-side error log in the pg-store-write test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Every result limit (search, find_related, list_recent, recall) must be
an integer in 1..100; otherwise StoreError('limit must be between 1
and 100').
- One content cap, MAX_CONTENT_CHARS = 20000, shared by store,
store_batch, update (checked before embedding), /embed and import.
- recall validates limit_per_topic and include_recent before embedding,
and include_recent <= 0 returns recent: [] as the original does.
- store_batch's description states the 2-per-call cap.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With MEMORY_DECAY_HALF_LIFE <= 0 nothing decays, so "strength 0 < minStrength" no longer makes every memory a candidate. Only the dormant rule applies (never accessed and older than maxDormantDays). stats and prune still share the one verdict. A deliberate deviation from the original, noted in the code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New migration (earlier ones are pushed and stay as they are): - the history trigger's 'purge' row records only memory, action, member, time and previous scope; - purge_tombstones() also nulls prev_content, prev_category and prev_tags on every earlier history row of each purged memory; - agent_memory.erase(id): postgres-only, hard-deletes a live or soft-deleted memory now, with the same scrub; returns whether a row existed; - memories purged before this migration are scrubbed once. pgTAP 05_erase covers purge, erase (live and soft-deleted), the kept trail, a targeted scrub and the member privilege check (42501). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- erase <memory-id> --yes hard-deletes now; without --yes it prints the id, scope and first line and exits 1. - list-deleted [--scope] [--by member|admin] [--since ISO] shows soft-deleted memories with who deleted them (latest 'delete' history row) and the first line, up to 80 characters. - restore takes several ids, or the same filters with --yes (without --yes it lists what it would restore and exits 1), in one transaction, and prints how many it restored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README's commands use CLI 3 flags (db push --remote, functions deploy --remote=<ref>), so CI runs the same version as development. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Require Supabase CLI 3.x; fix the deploy line (CLI 3 uses the linked project or --remote=<ref>, not --project-ref). - MEMORY_DECAY_HALF_LIFE: default 30, <= 0 disables decay, and prune then applies only the dormant rule. - list-deleted, multi and filtered restore, erase. - backup covers the whole install unless --scope; restore-backup needs an empty install and does not restore tokens. - The import workflow end to end, with its environment variables. - Percent-encode special characters in the admin connection password. - Size limits; drop a stray blank line under Credits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
A hosted MCP memory server on Supabase, built from the design and plan. It keeps agent-memory-mcp's tools and adds scopes: named memory pools, with read-only or read-write access per member. Postgres row-level security enforces that access.
Clients connect with a URL and a personal
amm_token. Nothing is installed locally.What's in it
supabase/migrations/, schemaagent_memory):erase;agent-memory:agent_memory_member, so RLS applies;@modelcontextprotocol/server2.4.0) with 11 tools: the original 10 pluslist_scopes;gte-smallembeddings.setup.tstakes an empty project to a working token saved in.env;configure-claude.tsregisters the server with Claude Code at user scope;admin.tsmanages scopes, members, grants and tokens, and haslist-deleted,restoreanderase;backup.ts,import.ts(withlancedb-export/) andsmoke.ts.Design decisions worth a look
store_batchtakes at most 2 memories, andrecallembeds at most 5 topics; further topics are searched by keyword only.AGENT_MEMORY_DB_URL), not the service-role key. Theagent_memoryschema is deliberately not exposed through the Data API.MEMORY_DECAY_HALF_LIFE≤ 0) flags only memories never accessed and older than 90 days. This deliberately differs from the original, so that turning decay off can't make prune delete everything.Testing
supabase functions serve, run locally. It isn't in CI because it needs the edge runtime and the model download.Not yet verified: CI on GitHub. This PR is its first run.
Credits
Builds on agent-memory-mcp by Adam Drew, via the chalfontchubby fork. GPL-3.0-or-later.
🤖 Generated with Claude Code