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 |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {} |
| prompts | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| recallA | CALL THIS FIRST before every first response. Search the Key Space and return canonical key clusters only — never memory content. Results include aliases, key type, match score, linked-memory count, hub status, and specificity. Select a useful key, call read_key(key_id), then call read_memory(memory_id, via_key_id) before using a fact. Use short focused noun queries and decompose multi-fact questions into several recall calls. EXPERIMENTAL: set inject:true to ALSO get the top connected memories' content in one call (skips manual read_key/read_memory) — returns {keys, memories}. Opt-in: trades the deliberate-navigation flow's context-efficiency and precision (the injected set carries lower-precision associative neighbours) for fewer round trips. inject_top_k caps the injected set; inject_prefer_depth favors confirmed (deep) memories; inject_explore_shallow reserves one slot for a weak/recent memory. |
| read_keyA | Inspect one key cluster. Returns canonical key/aliases/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_memoryA | Read one full memory selected through 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. |
| rememberA | Save important information to memory. 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 | Compatibility exploration from a known memory 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 | Save multiple memories in one call. Each item: {content, keys, key_types?, namespace?, ttl_seconds?, related_to?}. Returns list of saved IDs. 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
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