[integrations] delete_thought MCP#229
Conversation
Adds a standalone MCP Edge Function that exposes a single delete_thought tool. Hard-deletes a thought by UUID with a pre-flight fetch so callers see a clear not-found outcome rather than a silent success. Deploys as its own Supabase Edge Function — the core server/index.ts is untouched. README documents an optional audit hook for installs that also use the thought_audit schema. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Rewords the step 5 verification from a bullet list into a short numbered sequence (capture → delete → delete-again → table-editor check) so the Verify section has explicit top-level numbered steps. This matches the update-thought-mcp README's verification style and makes the intended end-to-end happy-path + not-found path obvious to a first-time follower of the guide. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Thanks for the contribution. The core gap is real — the MCP server has no delete path, and One design question worth a maintainer decision: this exposes a hard delete to an AI client, with recovery only via Supabase backups and audit left optional (the README points to Needs product decision on the delete-path design; recommend maintainer review. — Alan (community reviewer; non-binding) |
|
@alanshurafa Alan's question is load-bearing — you're right that exposing a hard delete to an AI client with backup-only recovery is a design decision, not just a process concern. Having thought about it more, I think the better default for OB1's delete path is a recoverable soft-delete with built-in age-out. Preferred design: add a The practical gain: an LLM calling Two paths for sequencing: (a) revise this PR in-place to implement soft-delete + age-out + recovery — bigger commit but a cleaner story for the delete path; or (b) merge or leave this PR as-is and open a follow-up PR that adds soft-delete as a first-class schema feature, superseding or wrapping this connector. Nate, which sequencing makes more sense from a release cadence standpoint? Thanks again, Alan — this was the kind of question that actually changed the design. |
|
Any update on this please? I would love to be able to delete thoughts no longer relevant, but I do not need to go the full dashboard app route |
|
Hi Jodie — thanks for jumping in. Genuinely useful to hear from someone who wants the capability but doesn't want to stand up a whole dashboard for it. Quick status: the function in this PR works. What's pending is the maintainer-side call on sequencing — revise in place, or merge and follow up with the soft-delete refinement. I sketched the soft-delete design in the 2026-05-21 comment further up, so I won't re-litigate. How I got there is worth a few lines, though, because it touches your use case. Earlier in 2026 I imported about 1,939 thoughts from Fastmail via IMAP. The April audit found roughly 17% were straight noise — marketing, transactional, automated. Unglamorous lesson: bytes you might want tomorrow shouldn't disappear today. Then Alan flagged the LLM angle on 2026-05-20 — an AI calling delete on a hallucinated UUID is unrecoverable, a worse failure mode than a missed cleanup. Soft-delete with a 30-day window covers both, and a human checkpoint already exists in the rhythm: Pinky (the curation agent — and yes, she curates the Brain; NARF, I didn't pick the names so much as fail to resist them) re-embeds null vectors and spot-checks weekly, then runs a monthly full re-slice — ledger regenerated, distribution deltas surfaced, links built at 0.85–0.95 cosine, merges at 0.95 and above. The 30-day age-out is one full maintenance cycle, not an arbitrary number. The April sprint itself — 3,146 thoughts in 30 batches, 69% pass / 22% reclassify / 17% dup-candidate / 1% low-value — produced zero auto-deletions. Everything destructive routes back through me. The part I keep wondering about, and I want to flag as speculation rather than a roadmap claim: what we're sketching looks a little like how brains use sleep. Monthly consolidation is already the engineering version — dedup, abstraction, link-building during idle time. The more speculative version is whether the brain should also dream — synthesize patterns across captured traces, surface emergent abstractions, and let truly low-signal traces fade as part of the rhythm rather than as a separate delete event. I don't know if "dreaming" is the right metaphor or whether it leads anywhere useful, but it feels like a question worth opening: should a memory system that's already consolidating do something more reverie-like during idle time, and would that reframe how we think about deletion at all? Curious where the room lands. Short version for you, Jodie: the capability is real and works today. The hard-vs-soft call is what's holding the merge, and that one isn't mine to make. Nothing you need to do — but if any of this lands, I'd love your read. |
What it does
Adds a standalone MCP Edge Function that exposes a single new tool:
delete_thought(id).The core Open Brain MCP server does not expose a delete path. As a result, thoughts accumulate forever — there is no way for an AI client to remove a test entry, a duplicate, or something captured in error without dropping into the Supabase SQL editor.
This integration deploys a second Edge Function with exactly one tool, and the core
server/index.tsis not modified.Safety
thoughts. Recovery depends on your Supabase project's backup tier (daily backups on paid tiers; Point-in-Time Recovery on higher tiers).Thought not found: <id>instead of silently succeeding.schemas/thought-auditschema is installed, the README documents how to extend this function to write an audit row (with prior content + metadata) before the delete so the operation is recoverable from the audit trail. Left out of the base integration to keep its dependencies minimal.What it requires
thoughtstable from the getting-started guide).No LLM provider is required — this tool does not read or write embeddings.
Tested
Deployed against a live Supabase Open Brain instance. Verified:
Deleted thought <id> (prior content length: N chars).and the row disappears from the table.Thought not found: <id>withisError: true.search_thoughts,list_thoughts, andcapture_thoughttools from the core server continue to work — this integration is additive and side-effect-free for existing connectors.Files touched
Only
integrations/delete-thought-mcp/— stays within the contribution scope check.Attribution
Adapted from a multi-participant capture design used across live Claude / ChatGPT / Codex sessions.