PGVector Store Tool icon

PGVector Store Tool

AI Agent tool for knowledge base operations

Forget Similar (Delete by Concept)

AI-generated

Summary

Delete entries from a PGVector knowledge base collection similar to a given concept, with optional dry-run preview and similarity threshold control.

Inputs

  • collection (required) — Name of the knowledge base collection (partition value)
  • concept — The concept to find similar entries to delete. Provide either concept, input, or query.
  • input — Alternative to concept: the text to search for similar entries to delete.
  • query — Alternative to concept: the query text to search for similar entries to delete.
  • similarityThreshold — Only delete entries with similarity above this threshold (0-1). Higher = stricter. Source: filters results where score <= 1 - threshold.
  • distanceMetric — Distance metric for similarity comparison: cosine (recommended), l2, or inner_product.
  • dryRun — When enabled, shows what would be deleted without actually deleting. Disable to perform actual deletion.

Output shape

String describing the operation's result.

Source-driven return behavior: if dryRun is true, returns a formatted 'DRY RUN - Would delete N entries:' list with up to 5 matches showing index, similarity percentage (1 - score), and content preview (first 80 chars); if more than 5 match, appends 'and M more'. If dryRun is false, deletes all matching entries and returns 'Deleted A entries similar to ...'. If no entries match the threshold, returns 'No entries found similar to ... (threshold: ...)'.

Discussion