Skip to content

Add qdrant-edit tool for updating stored memories#121

Open
sascha08-15 wants to merge 2 commits intoqdrant:masterfrom
sascha08-15:feature/qdrant-edit-tool
Open

Add qdrant-edit tool for updating stored memories#121
sascha08-15 wants to merge 2 commits intoqdrant:masterfrom
sascha08-15:feature/qdrant-edit-tool

Conversation

@sascha08-15
Copy link
Copy Markdown

@sascha08-15 sascha08-15 commented Mar 28, 2026

Summary

Adds a qdrant-edit tool that updates the closest matching memory in place, so stored information can be corrected without creating duplicate or stale entries.

  • QdrantConnector.edit() — finds the closest matching point via semantic search, rewrites that point in place, and preserves existing metadata when replacement metadata is omitted
  • qdrant-edit tool — registered alongside qdrant-store (write-mode only), reuses the same collection binding and filter ergonomics as qdrant-find
  • TOOL_EDIT_DESCRIPTION — customizable tool description via environment variable, consistent with the existing tool description pattern
  • Connector and settings coverage — adds integration tests for update behavior and settings tests for the new tool description
  • MCP server surface coverage — adds tests that verify read_only exposure and default COLLECTION_NAME binding at the registered tool level
  • README — documents the new tool and environment variable

Motivation

Issue #74 asks for edit/delete support so memories can be corrected instead of duplicated over time. PR #116 covers deletion; this PR covers the edit half by letting callers replace the nearest matching memory while keeping its point identity.

Test plan

  • Runtime verification of connector edit behavior against local in-memory Qdrant
  • Runtime verification of MCP tool registration behavior for read_only and default COLLECTION_NAME
  • Manual MCP Inspector validation via @modelcontextprotocol/inspector --cli
  • Full upstream pytest run in a normal networked environment

Inspector flow validated:

  • tools/list exposes qdrant-find, qdrant-store, and qdrant-edit
  • qdrant-store stores a memory successfully
  • qdrant-edit updates a stored memory successfully
  • omitting replacement metadata preserves the existing metadata on the updated memory
  • qdrant-find returns the updated content and metadata after the edit
  • read_only mode exposes only qdrant-find

Design decisions

  • In-place update by point id — after semantic lookup, the existing point id is reused so the update does not create a second record
  • Metadata preservation by default — if replacement metadata is omitted, the existing metadata is kept
  • Same filter ergonomics as qdrant-find — the edit tool supports the same query filter flow and respects default collection binding
  • Nearest-match semantics — there is no similarity threshold; the closest semantic match is updated, so query quality matters
  • Write-mode only — registered inside the if not self.qdrant_settings.read_only: block, consistent with qdrant-store

@sascha08-15
Copy link
Copy Markdown
Author

Manual MCP Inspector validation is done for the edit path. Verified through @modelcontextprotocol/inspector --cli that tools/list exposes qdrant-find, qdrant-store, and qdrant-edit; qdrant-store succeeds; qdrant-edit updates the stored memory; omitting replacement metadata preserves existing metadata; qdrant-find returns the updated content and metadata after the edit; and read_only mode exposes only qdrant-find.

One behavioral note from the same validation: qdrant-edit currently updates the nearest semantic match and does not apply a similarity threshold, so query quality matters.

@sascha08-15 sascha08-15 changed the title Feature/qdrant edit tool Add qdrant-edit tool for updating stored memories Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant