feat(memory): add delete fact and clear all memory endpoints#1436
Open
mvanhorn wants to merge 1 commit intobytedance:mainfrom
Open
feat(memory): add delete fact and clear all memory endpoints#1436mvanhorn wants to merge 1 commit intobytedance:mainfrom
mvanhorn wants to merge 1 commit intobytedance:mainfrom
Conversation
Add memory management capabilities to the backend API and frontend settings page:
Backend:
- DELETE /api/memory/facts/{fact_id} - delete a single fact by ID
- DELETE /api/memory - clear all memory data (reset to empty state)
- delete_memory_fact() and clear_memory() functions in updater.py
Frontend:
- Interactive facts table with per-row trash icon delete buttons
- "Clear All Memory" button with confirmation dialog
- TanStack Query mutations with automatic cache invalidation
Tests:
- 6 unit tests covering delete, clear, edge cases
Fixes bytedance#1333
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Mar 26, 2026
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.
Summary
Adds memory management capabilities. The backend API now supports deleting individual facts and clearing all memory. The frontend memory settings page gets interactive delete buttons per fact and a "Clear All Memory" button with confirmation dialog.
Why this matters
Issue #1333 requests memory clearing/management. The current API only supports reading memory data (
GET /api/memory) and reloading from file (POST /api/memory/reload). There is no way to delete facts or reset memory. The settings page renders memory as read-only markdown.Changes
Backend (harness layer -
deerflow.*)delete_memory_fact(fact_id)inupdater.py- removes a single fact by ID, returns False if not foundclear_memory()inupdater.py- resets memory to empty state via_create_empty_memory()+_save_memory_to_file()Backend (app layer -
app.*)DELETE /api/memory/facts/{fact_id}- returns 200 on success, 404 if fact not foundDELETE /api/memory- clears all memory, returns the empty stateFrontend
deleteMemoryFact()andclearAllMemory()API functions incore/memory/api.tsuseDeleteFact()anduseClearMemory()TanStack Query mutation hooks with cache invalidationFactsTablecomponent replaces the markdown table - each row has a trash icon buttonTesting
6 unit tests covering:
Harness boundary test passes - no
app.*imports indeerflow.*.Video Demo
Fixes #1333
This contribution was developed with AI assistance (Claude Code).