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. Always pass the active namespace when known. Returns {status, query, namespace, keys, memories}: ranked key clusters plus one passive Top-1 memory selected under the top key. The memory includes validity, matched_key, and connected_keys, each with a relevance score (cosine of that key to your query/context, sorted high→low). Before answering, check whether the Top-1 memory supplies every fact the question needs. If a fact is missing, follow an unvisited connected key that fits that fact with read_key(key_id, missing_fact_query, namespace), then read_memory on a relevant handle; recheck and continue only while a required fact and promising path remain. If no connected key fits, recall the missing fact directly. Do not add hops to a complete single-fact answer. Passive recall never reinforces links or changes access, depth, aliases, or confirmation — except: when |
| browse_keysA | Browse the vocabulary of one namespace when recall has no hit or you need an entry point. Returns active key clusters with hubs first, then by linked-memory count. This is index metadata only; continue with read_key(key_id, query, namespace) and read_memory(memory_id, via_key_id, namespace). |
| read_keyA | List the memories stored under one key (concept), ranked. Returns the canonical key, its aliases, and hub metadata plus ranked memory IDs, metadata, and validity — never memory content. Pass a focused query for the missing fact and the active namespace when known: handles are then ranked by content relevance, which is essential for hubs. Each memory's score is content_relevance × link_weight × depth_factor × freshness_factor when query is passed (link_weight × depth_factor × freshness_factor otherwise); content_relevance is a cosine, comparable to recall's key relevance — both only meaningful within this one key's ranking. Call read_memory(memory_id, via_key_id=key_id, namespace) on the selected handle to inspect the fact and reinforce the path; reading does not confirm that its content is current. Use limit/offset to page without flooding context. |
| read_memoryA | Read the full content and validity 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: the read records access and only that traversed edge is Hebbian-reinforced. Reading does not change content depth or confirm that the content is current. |
| confirm_memoryA | Confirm that a memory is still current using explicit present evidence. Never call this merely because read_memory returned the content. Use only after a current user assertion, an authoritative current source, or direct observation. Refreshes validity but does not change content or key links. A strong restatement passed as recall's |
| rememberA | 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. Before writing, recall() the topic in the same namespace and reuse returned canonical concepts or aliases. Use 3-6 diverse ATOMIC concept keys of 1-2 words each, never memory-specific phrases (use 'Nexora' and 'portfolio', not 'Nexora portfolio'); 3+-word keys are flagged in hints.phrase_keys and are measurably 91% unreachable singletons. CROSS-LINGUAL: register both language forms together (for example '포트폴리오' and 'portfolio'). Shared broad keys become navigable hubs. namespace groups memories by project/context; ttl_seconds sets expiry; decay_profile selects transient, standard (the default), stable, or permanent confirmation freshness; 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. The response may include hints.near_keys (existing concepts your keys nearly duplicate — prefer reusing those concepts) and hints.language_note (add the missing-language variants). |
| 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. Omit decay_profile and ttl_seconds to preserve the predecessor's policies; provide either to replace that policy. related_to links the updated memory to other memory IDs. |
| dismissA | Tell keymem a recalled memory was surfaced by the WRONG key — the fact may be fine, it just should not have come up for this query. Pass the memory_id and the key_id it arrived under (recall returns both). Weakens that one key->memory link so the pairing ranks lower next time, and cancels any pending alias learning for it. The memory itself, its other keys, and its content are untouched, and the link is floored rather than severed, so nothing becomes unreachable. Use correct() when the fact changed and forget() when it is simply wrong. |
| forgetA | Permanently delete a memory. Only use for completely wrong information. For outdated info, use correct() instead — it preserves history. |
| 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. Recall each topic first, reuse canonical concept-level keys (ATOMIC, 1-2 words each — never phrases), and register cross-lingual forms together. Each item: {content, keys, key_types?, namespace?, ttl_seconds?, decay_profile?, related_to?}; decay_profile defaults to standard. Returns saved IDs and is more efficient than multiple remember() calls. |
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 | |
TDQS
Scored across 10 tools
Each tool targets a distinct operation in the memory lifecycle: recall/search, key browsing, key reading, memory reading, saving, confirming, correcting, dismissing, and forgetting. The hierarchical workflow (recall → read_key → read_memory) and the clear separation between content, validity, and key-link management eliminate ambiguity. No two tools appear to do the same thing.
All names use lower snake_case and are readable, with no mixed casing or cryptic abbreviations. The main deviation is that some tools are bare verbs (recall, correct, dismiss, forget, remember) while others follow verb_noun (read_key, read_memory, browse_keys, confirm_memory, remember_batch), but this remains mostly predictable.
Ten tools is well-scoped for a long-term memory server. The set covers discovery, read, write, update, delete, and link-reinforcement without obvious redundancy. Each tool earns its place, and the count stays within the ideal 3–15 range.
The surface covers full memory lifecycle operations: recall/search, browse, read, remember, remember_batch, confirm, correct, dismiss, and forget. It also handles navigation through keys and memories, validity, and link weakening. No core CRUD or lifecycle operation appears missing for the stated domain.