Skip to main content
Glama

Check for near-duplicate memories

memory_dedup_check
Read-onlyIdempotent

Check if storing new memory content would duplicate existing memories. Returns matching memories with cosine similarity above the threshold, highest first. Use before memory_store to prevent redundancy.

Instructions

Cheap pre-flight (~50 tok/match): "would storing this content duplicate something I already have?" Read-only. Use before memory_store when overlap is likely, or before bulk imports. Returns up to limit existing memories with cosine similarity above the threshold (highest first). Computing the candidate embedding may make an outbound call to the configured provider (OpenAI, Ollama, etc.). If embeddings are disabled, returns a clear no-op message rather than silently passing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesCandidate memory body to check, exactly as you would pass to `memory_store`.
titleNoOptional candidate title; concatenated with `content` to match how `memory_store` builds its embedding.
project_pathNoOptional absolute project path to scope the search to a single project's memories.
thresholdNoCosine similarity threshold in [0, 1]. Defaults to `search.embeddings.dedupThreshold` from config (typically ~0.85).
limitNoMaximum number of matches to return (1-20). Default 5.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesMarkdown list of near-duplicate matches with similarity scores, or `No near-duplicates found above threshold.` Returns a no-op message when embeddings are disabled in config.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses key traits beyond annotations: cheap (~50 tok/match), read-only, returns sorted matches, outbound call for embedding, and clear no-op when embeddings disabled. Annotations already indicate read-only and idempotent; description adds valuable context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is concise (three sentences), front-loaded with the key purpose and cost estimate, and every sentence adds value. No redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the existence of an output schema and comprehensive annotations, the description covers all necessary aspects: purpose, when to use, behavior details, and edge cases (embeddings disabled). No gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 100% coverage with detailed descriptions for each parameter. The tool description does not add new parameter info beyond the schema, so baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool checks for near-duplicate memories before storing. It uses specific verbs ('check', 'duplicate') and distinguishes from siblings like memory_store by calling it a 'pre-flight' check.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly advises using it before memory_store when overlap is likely or before bulk imports. Does not mention when not to use it, but the context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lfrmonteiro99/memento-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server