Skip to main content
Glama
0gm-memory

0gm-memory

Official
by 0gfoundation

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
ZG_API_KEYNoUsed if nothing above is set.
OPENCODE_DBNoOpenCode's database, read by save --opencode and the plugin.$XDG_DATA_HOME/opencode/opencode.db
ZGM_MEMORY_KEYNoAPI key for this project's wallet. The key is read in order: ZGM_MEMORY_KEY, ZGM_MEMORY_KEY_SERVICE, a key entered in plugin settings, then ZG_API_KEY.
ZGM_MEMORY_HOMENoLocal state folder. Defaults to the platform data folder: ~/Library/Application Support/0gm-memory, ~/.local/share/0gm-memory, or %LOCALAPPDATA%\0gm-memory.
ZGM_MEMORY_MODELNoModel id.0gm-2.0
ZGM_MEMORY_DISABLENoSet to 1 to turn everything off: nothing is read or sent.
ZGM_MEMORY_BASE_URLNoRouter base URL.https://router-api.0g.ai/v1
ZGM_MEMORY_ASK_TIMEOUTNoSeconds per ask_memory call.300
ZGM_MEMORY_KEY_SERVICENomacOS: name of a keychain item holding the key.
ZGM_MEMORY_MAX_RETRIESNoRetries on 429 and 5xx, with backoff.4
ZGM_MEMORY_FLUSH_TOKENSNoEstimated tokens per save. Larger saves mean fewer, bigger saves.70000
ZGM_MEMORY_OPENCODE_BINNoOpenCode command, used only if its database cannot be read.opencode
ZGM_MEMORY_SAVE_TIMEOUTNoSeconds per save call.600
ZGM_MEMORY_TOOL_RESULT_CHARSNoHow much of each tool result is kept.1500
ZGM_MEMORY_NO_ENTROPY_REDACTIONNoSet to 1 to keep random-looking strings that match no known secret format.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Long-term memory for this project. Call ask_memory when the user refers to past work, earlier decisions or anything you do not have in context. It returns dated verbatim quotes, not answers.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
ask_memoryA

Search this project's long-term memory (0GM-CMSA memory holding past agent sessions). Returns VERBATIM quotes of the relevant past messages, each with its session date, or NO RELEVANT MESSAGES. It does not answer: reason over the quotes yourself. Slow (seconds on a small wallet, up to about 100 s on a large one) and costs about $0.003 to $0.03 per call, so ask one specific, self-contained question rather than many small ones. Recent sessions may still be buffered locally; matches from the buffer are listed separately.

save_sessionA

Add a session transcript (Claude Code or Codex JSONL, or JSONL of {role, content, timestamp}) to this project's memory buffer. Secrets are redacted first. The buffer is written to wallet memory once it passes about 70K tokens; the reply says what was buffered and what was saved. Safe to call twice on one file: only new records are added.

memory_statusA

What is buffered locally, what has been saved to wallet memory, the quota used and the last save. Free: no network call.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.1/5.0

Scored across 3 tools

Disambiguation5/5

The three tools map cleanly onto read (ask_memory), write (save_session), and inspect (memory_status) operations with no functional overlap. The descriptions explicitly differentiate them, including noting that ask_memory does not reason and that memory_status is free and local.

Naming Consistency4/5

ask_memory and save_session follow a consistent verb_noun pattern, but memory_status breaks it with a noun_noun form. It is still readable and clearly part of the same family, so only a minor deviation.

Tool Count4/5

Three tools is on the lean side but covers the core memory lifecycle (search, ingest, status) without redundancy. Each tool earns its place; nothing feels like filler.

Completeness3/5

Search, save, and status cover the main loop, but there is no way to delete or forget memories, list saved sessions/entries, or force a flush of the buffer to wallet memory. These are notable gaps that could cause dead ends for agents managing memory hygiene.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues