Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
KEYMEM_RERANKNoSet to 'true' to enable cross-encoder reranking (optional).
OPENAI_API_KEYNoYour OpenAI API key for embeddings. Required if not using local embeddings.
KEYMEM_DATA_DIRNoDirectory for data storage (default: ~/.keymem).
EMBEDDING_BACKENDNoSet to 'local' to use local embeddings without API key.
KEYMEM_DIRECT_RECALLNoSet to 'true' to expose direct recall tool (optional).
LOCAL_EMBEDDING_MODELNoLocal embedding model (default: fast-multilingual-e5-large).fast-multilingual-e5-large
OPENAI_EMBEDDING_MODELNoOpenAI embedding model (default: text-embedding-3-small).text-embedding-3-small

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{}
prompts
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
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

NameDescription
memory_system_promptSystem prompt for LLM agents using keymem. Include this in your system prompt.

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/donggyun112/keymem'

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