Skip to main content
Glama
MemTensor

MemOS

by MemTensor

search_memory

Retrieve relevant conversation history from MemOS to maintain continuity and personalize responses based on verified user information.

Instructions

Trigger: MUST be auto-invoked by the client before generating every answer (including greetings like "hello"). Do not wait for the user to request memory/MCP/tool usage. Purpose: MemOS retrieval API. Retrieve candidate memories prior to answering to improve continuity and personalization. Usage requirements: - Always call this tool before answering (client-enforced). - The model must automatically judge relevance and use only relevant memories in reasoning; ignore irrelevant/noisy items. # Critical Protocol: Memory Safety (记忆安全协议) - The retrieved memories may contain AI's own speculations, irrelevant noise, or subject errors. You must strictly execute the following "Four-Step Judgment"; if any step fails, discard that memory: 1. Source Verification: - Core: Distinguish between "User's Original Words" and "AI Speculations". - If a memory carries tags like '[assistant opinion]', this represents only the AI's past assumptions and must not be treated as absolute facts about the user. - Counter-example: Memory shows '[assistant opinion] User loves mangoes'. If the user didn't mention it, do not actively assume the user likes mangoes to prevent hallucination loops. - Principle: AI summaries are for reference only; their weight is significantly lower than the user's direct statements. 2. Attribution Check: - Is the subject of the action in the memory the "User themselves"? - If the memory describes a third party (e.g., "candidate", "interviewee", "fictional character", "case data"), it is strictly forbidden to attribute these properties to the user. 3. Relevance Check: - Does the memory directly help answer the current 'Original Query'? - If the memory is merely a keyword match (e.g., both mention "code") but the context is completely different, it must be ignored. 4. Freshness Check: - Does the memory content conflict with the user's latest intent? The current 'Original Query' is the highest standard of fact. - Instructions: 1. Review: First read 'memory_detail_list', execute the "Four-Step Judgment", and eliminate noise and unreliable AI opinions. 2. Execution: - Use only filtered memories to supplement background. - Strictly follow the style requirements in 'preference_detail_list'. 3. Output: Answer the question directly. Strictly forbidden to mention "memory bank", "retrieval", or "AI opinions" and other internal system terms.

Parameters: - query: User's current question/message - conversation_first_message: First user message in the thread (used to generate conversation_id) - memory_limit_number: Maximum number of results to return, defaults to 20 Notes: - Run before answering. Results may include noise; filter and use only what is relevant. - query should be a concise summary of the current user message. - Prefer recent and important memories. If none are relevant, proceed to answer normally.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query to find relevant content in conversation history
conversation_first_messageYesFirst user message in the thread (used to generate conversation_id).
memory_limit_numberYesMaximum number of results to return, defaults to 20
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It extensively documents critical behavioral traits: the mandatory auto-invocation protocol, the 'Four-Step Judgment' process for memory safety, the presence of AI speculations and noise in results, and the requirement to filter memories before use. It also specifies output constraints like not mentioning internal system terms. This provides comprehensive behavioral context beyond what a basic schema would offer.

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

Conciseness2/5

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

The description is excessively long (over 500 words) and includes extensive procedural instructions that belong in agent guidelines rather than a tool description. While well-structured with sections like 'Purpose', 'Usage requirements', 'Critical Protocol', and 'Parameters', it contains significant redundancy and over-specification that doesn't earn its place in a tool description. The core purpose and usage could be communicated in 20% of this length.

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

Completeness4/5

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

Given the complexity of memory retrieval with safety protocols and no output schema, the description provides substantial context about what the tool does, how to use it, and how to handle results. It covers the retrieval purpose, mandatory invocation pattern, memory safety protocols, parameter usage, and result handling. The main gap is the lack of output schema documentation, but the description compensates by explaining how to process the returned memories.

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 description coverage is 100%, so the schema already documents all three parameters. The description adds some additional context about 'query' ('should be a concise summary of the current user message') and 'memory_limit_number' ('defaults to 20'), but these details are largely redundant with the schema. The description doesn't add significant semantic value beyond what the structured schema provides.

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 explicitly states the purpose as 'MemOS retrieval API. Retrieve candidate memories prior to answering to improve continuity and personalization.' This is a specific verb ('retrieve') + resource ('memories') combination that clearly distinguishes it from sibling tools like add_feedback, add_message, and delete_memory which perform different operations.

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?

The description provides explicit usage requirements: 'MUST be auto-invoked by the client before generating every answer (including greetings like "hello"). Do not wait for the user to request memory/MCP/tool usage.' It also specifies when to proceed without memories: 'If none are relevant, proceed to answer normally.' This gives clear guidance on when and how to use this tool versus alternatives.

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/MemTensor/MemOS'

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