Skip to main content
Glama

engram_recall

Retrieve relevant memories ranked by a hybrid score combining similarity, recency, and confidence. Use at session start or to look up specific facts.

Instructions

Retrieve memories relevant to a query, ranked by a hybrid score. Embeds the query, gathers candidates (FTS5 top-20 plus in-namespace embeddings, optionally time-filtered), and scores each by similarity×0.45 + recency×0.15 + confidence×0.15 + access×0.05 + feedback×0.10 + a 0.1 FTS boost, then filters by category/threshold and returns the top results. If embedding generation fails it falls back to FTS-only search. Reading a memory bumps its last_accessed and access_count. Returns: an array of memory objects — each with id, content, category, entity, confidence, namespace, tags, timestamps, score, and scoreBreakdown — or an empty array if nothing clears the threshold (with a time_filter, the array also carries timeRange metadata). Use at session start or to look up a specific fact; prefer engram_context when you want a ready-to-inject block instead of raw results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum memories to return, 1–20 (default 5). Keep low to avoid context pollution.
queryYesWhat you want to remember. Can be a question ("what is their deployment setup?") or a topic ("docker configuration"). Be specific for better results.
categoryNoOptional filter by memory type (preference/fact/pattern/decision/outcome). Omit to search all types.
namespaceNoOptional project/scope filter. Omit to search across all namespaces.
thresholdNoMinimum relevance score to include a result, 0.0–1.0 (default 0.3). Raise for fewer, more precise results.
time_filterNoRestrict results to a time range by created/updated time. Provide after/before, or a period shorthand. Supports relative times like "3 days ago", "last week", or ISO dates.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv1.6.6
    • changedInput schema / properties / category / description
      Previous value: -"Optional: filter by memory type"New value: +"Optional filter by memory type (preference/fact/pattern/decision/outcome). Omit to search all types."
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum memories to return (1-20). Default 5. Keep low to avoid context pollution."New value: +"Maximum memories to return, 1–20 (default 5). Keep low to avoid context pollution."
    • addedInput schema / properties / limit / maximum
      Added value: +20
    • addedInput schema / properties / limit / minimum
      Added value: +1
    • changedInput schema / properties / namespace / description
      Previous value: -"Optional: filter by project/scope. Omit to search all namespaces."New value: +"Optional project/scope filter. Omit to search across all namespaces."
    • changedInput schema / properties / threshold / description
      Previous value: -"Minimum relevance score (0.0-1.0). Default 0.3. Increase to get fewer, more relevant results."New value: +"Minimum relevance score to include a result, 0.0–1.0 (default 0.3). Raise for fewer, more precise results."
    • addedInput schema / properties / threshold / maximum
      Added value: +1
    • addedInput schema / properties / threshold / minimum
      Added value: +0
    • changedInput schema / properties / time_filter / description
      Previous value: -"Filter memories by time range. Supports relative times like \"3 days ago\", \"last week\", or ISO dates."New value: +"Restrict results to a time range by created/updated time. Provide after/before, or a period shorthand. Supports relative times like \"3 days ago\", \"last week\", or ISO dates."
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

No annotations exist, so description fully bears the burden. It details the scoring formula, fallback to FTS, side effects (bumps timestamps), and return structure. No contradictions.

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

Conciseness4/5

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

Long but well-organized: purpose, scoring details, fallback, side effects, return format, usage guidelines. Every sentence adds value; minor trimming possible but still effective.

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?

No output schema, but description fully explains return array structure (fields like id, content, score). Covers input, process, output, side effects, fallback. Complete for a complex tool.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. Description adds extra context for query (be specific), limit (keep low), and time_filter (supports relative times), going beyond schema docs.

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 retrieves memories relevant to a query, ranked by a hybrid score, and distinguishes from sibling engram_context by contrasting raw results vs. ready-to-inject block.

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

Usage Guidelines5/5

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

Explicitly states when to use ('at session start or to look up a specific fact') and when to prefer an alternative ('prefer engram_context when you want a ready-to-inject block').

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