Skip to main content
Glama

mem_search

Find specific memories by keyword or semantic similarity, even without knowing the memory ID. Supports filtering by scope, type, and status for precise results.

Instructions

Search memories by keyword or semantic similarity.

USE WHEN you need to find a specific memory and don't know its id. For session onboarding, use get_briefing instead (richer, ranked, budgeted).

SEARCH MODES: Literal (default): AND search across id, tags, and body — all tokens must match. Falls back to OR automatically if no AND results (partial match). Lexical rank (lexical_rank: true, semantic: false): Okapi-BM25-style scoring on the filtered corpus — good for phrase-like queries without embeddings. Semantic (semantic: true): embedding-based similarity — finds related memories even with different wording. Requires hivelore embeddings index to be built.

PARAMETERS: query — search terms or natural language question scope — filter by personal | team | module type — filter by convention | decision | gotcha | architecture | glossary semantic — true for embedding-based search (requires @hivelore/embeddings) lexical_rank — BM25-style ranking (ignored when semantic is true) limit — max results (default 10)

RETURNS: array of { id, type, scope, status, confidence, body, match_quality }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoRestrict results to a memory type. session_recap is excluded by default — use type='session_recap' to include them.
limitNoMax results
queryYesSubstring matched against id, tags, and body
scopeNoRestrict results to a single scope
trackNoIncrement read_count on returned memories (used for passive validation)
moduleNoRestrict results to a module
statusNoFilter by a single status. Omit to return all statuses.
semanticNoUse semantic similarity from the embeddings index (requires `hivelore embeddings index`).
min_scoreNoMinimum cosine similarity (semantic mode only)
lexical_rankNoWhen true (and semantic is false), rank the filtered corpus with Okapi-BM25-style lexical scoring instead of literal AND/OR. Helps phrase-like queries without embeddings.
exclude_rejectedNoWhen true, exclude memories with status=rejected from results.
include_session_recapNoInclude session_recap memories in search results (excluded by default — they surface in get_briefing as last_session).
Behavior4/5

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

Given no annotations, the description carries full burden. It discloses search-mode fallback (AND→OR), lexical ranking behavior, the requirement for an embeddings index, and session_recap exclusion. However, it does not mention the side effect of track=true incrementing read_count (though schema covers this), and it contains an incorrect default limit (10 vs schema's 20), slightly clouding behavioral expectations.

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?

The description is structured with clear headings (USE WHEN, SEARCH MODES, PARAMETERS, RETURNS) and front-loads the purpose. It is longer than the minimal case but each section earns its place given the tool's complexity. Slight redundancy exists in the PARAMETERS section but it remains readable.

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

Completeness3/5

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

The description covers the main search modes, usage context, and return shape, which is significant given no output schema. However, it omits several schema parameters (status, module, exclude_rejected, include_session_recap) and contains an incorrect default limit, making it not fully reliable for complete understanding without the schema.

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

Parameters2/5

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

Schema coverage is 100%, so baseline is 3. The description's PARAMETERS section adds a few interactions (e.g., lexical_rank ignored when semantic is true) but includes a serious factual error: limit default is stated as 10 while schema says 20. It also describes query as 'natural language question', which could mislead in literal mode where substring matching is used. These inaccuracies degrade value below baseline.

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 opens with a clear verb+resource: 'Search memories by keyword or semantic similarity.' It further differentiates from siblings by stating 'USE WHEN you need to find a specific memory and don't know its id' and explicitly contrasts with get_briefing, making the tool's purpose unambiguous.

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?

Provides explicit guidance: 'USE WHEN you need to find a specific memory and don't know its id' and directs to get_briefing for session onboarding. It also notes that semantic mode requires an embeddings index, setting clear prerequisites for choosing this mode over others.

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/Doucs91/hivelore'

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