keymem
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| KEYMEM_RERANK | No | Set to 'true' to enable cross-encoder reranking (optional). | |
| OPENAI_API_KEY | No | Your OpenAI API key for embeddings. Required if not using local embeddings. | |
| KEYMEM_DATA_DIR | No | Directory for data storage (default: ~/.keymem). | |
| EMBEDDING_BACKEND | No | Set to 'local' to use local embeddings without API key. | |
| KEYMEM_DIRECT_RECALL | No | Set to 'true' to expose direct recall tool (optional). | |
| LOCAL_EMBEDDING_MODEL | No | Local embedding model (default: fast-multilingual-e5-large). | fast-multilingual-e5-large |
| OPENAI_EMBEDDING_MODEL | No | OpenAI embedding model (default: text-embedding-3-small). | text-embedding-3-small |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
| prompts | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| recallA | Search long-term memory for what is already known about the user, project, or topic — call this before your first reply and whenever the topic shifts. Returns matching key clusters only (not memory content): canonical concept, aliases, key type, match score, linked-memory count, hub status, and specificity. Follow up with read_key(key_id) then read_memory(memory_id, via_key_id) to read a stored fact. Use short focused noun queries and decompose multi-fact questions into several recall calls. Set inject:true to ALSO get the best connected memory preview in one call (skips manual read_key/read_memory) — returns {keys, memories}. inject_top_k defaults to 1; inject_max_chars defaults to 2000 and marks truncated previews so read_memory can fetch the full content. Injection defaults to a precision gate; set inject_min_rel_score to 0 only for explicit associative exploration. inject_prefer_depth favors confirmed memories; inject_explore_shallow reserves one slot for a weak/recent memory. |
| read_key | List the memories stored under one key (concept), ranked. Returns the canonical key, its aliases, and hub metadata plus ranked memory IDs and metadata — never memory content. Call read_memory on promising handles. Use limit/offset to page through hub keys without flooding context. Pass the original query: handles are then ranked by content relevance to it, which is essential for hub keys so the target memory surfaces first instead of being buried. |
| read_memory | Read the full content of one stored memory (selected via read_key). Returns the memory and all connected key clusters so exploration can continue Key → Memory → Key. Pass via_key_id from the selected key: only that traversed edge is Hebbian-reinforced, and depth/access count increase only when this full read occurs. |
| remember | MANDATORY END-OF-TURN GATE: before replying, save every durable fact newly revealed this turn (names, preferences, decisions, corrections, project facts, goals). A durable fact left unsaved is a bug; save silently in the same turn. Save nothing only after consciously confirming that nothing durable appeared. Keys are search terms — think 'what would I search to find this later?' Use 3-6 diverse keys. Before coining new keys, recall() the topic and reuse returned canonical concepts or aliases. Semantically merged synonyms become aliases in one key cluster; shared broad keys become navigable hubs. CROSS-LINGUAL: add keys in both languages. namespace groups memories by project/context; ttl_seconds sets expiry; related_to adds explicit memory links; source attaches provenance and is auto-stamped with the server session, a timestamp, and — when a host agent (Claude Code, Codex) transcript is active — host_session/host_agent/host_turn so the memory can be traced back to its original conversation via get_conversation. |
| correctA | Update outdated information. Use when user corrects you or info changes (e.g. moved cities, changed job). Old version is preserved but weakened — never lost. Omit keys to keep the same search terms. related_to links the updated memory to other memory IDs. |
| relatedA | Find other memories associated with a memory you already have (by ID). Returns neighboring memories connected by shared keys or explicit links. For normal agent-driven navigation prefer read_memory(), inspect its returned keys, then call read_key(). |
| forgetA | Permanently delete a memory. Only use for completely wrong information. For outdated info, use correct() instead — it preserves history. |
| list_memoriesA | List all stored memories. namespace filters by project/context. Expired memories are excluded. Prefer recall() for normal retrieval. |
| remember_batchA | MANDATORY END-OF-TURN GATE: when a turn reveals multiple durable facts, save them silently before replying. A durable fact left unsaved is a bug. Each item: {content, keys, key_types?, namespace?, ttl_seconds?, related_to?}. Returns saved IDs and is more efficient than multiple remember() calls. |
| cleanup_expiredA | Delete all memories past their ttl. Returns count of deleted memories. Call periodically to keep memory clean. |
| memory_statsA | Get counts of keys, memories, and links in the system. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| memory_system_prompt | System prompt for LLM agents using keymem. Include this in your system prompt. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/donggyun112/keymem'
If you have feedback or need assistance with the MCP directory API, please join our Discord server