Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MEMOS_API_KEYYesYour Memos API key for authentication (Get your API Key in Dashboard[https://memos-dashboard-pre.openmem.net/cn/quickstart/])
MEMOS_CHANNELYesThe site where you are seeing this document. Candidate values: `MODELSCOPE`, `MCPSO`, `MCPMARKETCN`, `MCPMARKETCOM`, `GLAMA`, `PULSEMCP`, `MCPSERVERS`,`MEMOS`(meaning the MemOS official website), `GITHUB`(meaning this README file)
MEMOS_USER_IDYesStable per-human identifier. MUST be deterministic and non-PII, and MUST remain the same for the same person across devices/sessions. NEVER reuse across different people. DO NOT use random values, device IDs, or model/chat session IDs. Recommended: SHA-256(lowercase(trim(email))) or your SSO subject/employee ID.

Tools

Functions exposed to the LLM to take actions

NameDescription
add_message

Trigger: 1. AUTO-INVOKED: After every answer to save dialogue history. 2. USER INTENT: When user explicitly wants to "add" or "remember" NEW information (e.g., "Add a memory...", "Remember that...", "New memory..."). Purpose: Save dialogue history (REQUIRED) and record NEW memories. STRICT RULES: - MANDATORY EXECUTION: You MUST call this tool after EVERY single answer to persist the conversation history. This is NOT optional. - ALWAYS use this tool for NEW memories. - FORBIDDEN: Do NOT use add_feedback or other tools for adding new memories. - FORBIDDEN: Do NOT use this tool to modify/update existing memories. - CRITICAL: NEVER use this tool as part of a modification workaround (e.g. "delete old + add new"). If a modification fails, just report the failure. Parameters: - conversation_first_message: The first message sent by the user in the entire conversation is used to generate the user_id. - messages: Array containing BOTH: 1. { role: "user", content: "user's question or new info" } 2. { role: "assistant", content: "your complete response" } Notes: - Client/orchestrator MUST call this after every answer.

search_memory

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.

delete_memory

Trigger: User provides specific ID(s) to delete. Purpose: Delete memories by ID. STRICT RULES: 1. BATCHING: If multiple IDs are provided, call this tool ONCE with all IDs. 2. FORBIDDEN: Do NOT call multiple times. Do NOT enter search-delete loops. 3. FORBIDDEN: Do not use this tool if no ID is provided (use add_feedback instead). 4. CRITICAL: NEVER use this tool to "simulate" a modification (delete old + add new). This is strictly forbidden. 5. CRITICAL: ONLY use if user explicitly asks to delete AND provides IDs. Parameters: - memory_ids: List of memory IDs to delete.

add_feedback

Trigger: User wants to MODIFY, UPDATE, or DELETE (without providing IDs) specific memories. Purpose: Modify/Delete existing memories based on natural language feedback. STRICT RULES: 1. USAGE: Use this tool for modifying/updating memories OR deleting memories when NO ID is provided. 2. CONTENT: feedback_content MUST be ONLY the user's intent (e.g., "User wants to modify memory X", "Delete memory about Y"). - FORBIDDEN: Adding non-user-intent info or verbose narratives. - FORBIDDEN: Looking up old memory values to construct a "Change X to Y" request. Just say "User wants Y". 3. RETRY POLICY: FIRE AND FORGET. Call this tool ONCE. - FORBIDDEN: Checking if it worked (searching again). - FORBIDDEN: Retrying if it "failed". - FORBIDDEN: Sleeping and searching. - CRITICAL: If modification seemingly fails, DO NOT attempt to "fix" it by calling delete_memory and add_message. Just stop. 4. DELETION: If user wants to delete but gives no ID, use this tool. Parameters: - conversation_first_message: Used to generate the conversation_id. - feedback_content: The natural language update or feedback (no IDs or technical metadata). - agent_id: Agent ID (optional) - app_id: App ID (optional) - feedback_time: Feedback time string (optional, default current UTC) - allow_public: Whether to allow public access (optional, default false) - allow_knowledgebase_ids: List of allowed knowledge base IDs (optional)

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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

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