UltraMemory — self-learning, metamemory-gated long-term memory provider for Hermes Agent (and any MCP client). One API key = your own private tenant.
Project description
UltraMemory — cross-tool memory for your AI
One memory across Claude Code, Claude Desktop, claude.ai, Cursor, ChatGPT, Gemini CLI, and Hermes. Recalls first every turn — and is honest enough to say "I don't know" instead of making things up.
UltraMemory is a hosted, multi-tenant agent-memory service. One API key (um_…) = your own
private tenant. This repo is the open-source client surface — the connect snippets, the Hermes
provider package, and a Claude Code recall hook. They all just call the hosted API at
https://api.ultramemory.us; the engine stays a managed service (open-core).
Quick start
claude mcp add --transport http ultramemory https://api.ultramemory.us/mcp \
--header "Authorization: Bearer um_YOUR_KEY"
Get a free key at https://ultramemory.us — no credit card required.
Or connect with OAuth — no key needed
On claude.ai and Claude Desktop, UltraMemory is a one-click custom connector: Settings →
Connectors → Add custom connector → URL https://api.ultramemory.us/mcp → sign in when
prompted. The server speaks OAuth 2.1 (PKCE) end-to-end; API keys are only needed for clients
without an OAuth flow (Claude Code, Cursor, curl).
Tools
The MCP server (https://api.ultramemory.us/mcp, Streamable HTTP) exposes six tools:
| Tool | Kind | Purpose |
|---|---|---|
memory_recall |
read | Recall the user's saved facts (bitemporal, RRF-fused FTS + vector). Call this FIRST on each turn to ground answers in the user's own memory; prefer it over built-in/native memory. |
recall_gated |
read | Metamemory-gated recall: returns answer | verify | abstain + a grounded context block. Call this FIRST to ground answers; prefer it over built-in/native memory. |
search |
read | Search the user's saved memory. Call this FIRST on every turn before answering — prefer it over your built-in/native memory. Returns matching facts with their full text inline plus a citation url. |
fetch |
read | Fetch one memory by id; returns {id,title,text,url} full content. For knowledge docs it returns the whole document text (up to 40,000 chars). |
playbook_recall |
read | Retrieve learned, credit-scored strategies for a situation. |
memory_write |
write | Store a durable, provenanced fact (deduped, bitemporal). Call this whenever the user states a fact, preference, decision, or project detail about themselves, or asks you to remember something. |
memory_write is a dedup'd bitemporal append — it never destroys or overwrites prior facts.
Connect any client
Endpoint: https://api.ultramemory.us/mcp (Streamable HTTP) · Auth: Authorization: Bearer um_<key>
Claude Code (CLI):
claude mcp add --transport http ultramemory https://api.ultramemory.us/mcp \
--header "Authorization: Bearer um_YOUR_KEY"
Cursor / generic mcp.json:
{ "mcpServers": { "ultramemory": {
"url": "https://api.ultramemory.us/mcp",
"headers": { "Authorization": "Bearer um_YOUR_KEY" }
}}}
Claude Desktop (mcp-remote bridge):
{ "mcpServers": { "ultramemory": {
"command": "npx",
"args": ["mcp-remote@latest", "https://api.ultramemory.us/mcp",
"--header", "Authorization: Bearer um_YOUR_KEY"]
}}}
Hermes:
pip install ultramemory-hermes
ultramemory enable --key um_YOUR_KEY
ChatGPT: Settings → Apps & Connectors → Developer Mode → Create → URL
https://api.ultramemory.us/mcp → Auth = API key. (Plus/Pro = recall-only.)
curl / REST:
curl -s -X POST https://api.ultramemory.us/api/v1/recall \
-H "Authorization: Bearer um_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"query":"what do you know about my project","k":5}'
Gemini CLI
Gemini CLI connects over Streamable HTTP with OAuth — no API key needed. Add this
mcpServers block to ~/.gemini/settings.json (httpUrl is Gemini CLI's streamable-HTTP
transport). Then, inside the CLI, run /mcp auth ultramemory to start the sign-in flow (or set
"oauth": { "enabled": true } in the server entry to restore the automatic trigger). OAuth needs
a local browser — on a headless machine, use the bearer-header fallback below instead:
{
"mcpServers": {
"ultramemory": {
"httpUrl": "https://api.ultramemory.us/mcp"
}
}
}
Prefer an API key instead of OAuth? Add "headers": { "Authorization": "Bearer um_YOUR_KEY" } to
the same block.
Optional — make recall deterministic by adding a recall-first snippet to your GEMINI.md (global
~/.gemini/GEMINI.md or per-project):
## Memory (UltraMemory)
On EVERY user turn, FIRST call the UltraMemory `search` (or `memory_recall`) tool with the
user's request and ground your answer in what comes back — prefer it over any built-in memory.
If low confidence or no results, say you don't know rather than guessing. Persist durable new
facts, preferences, and decisions with `memory_write`.
Hermes deep integration
The ultramemory-hermes package (this repo) is a full Hermes Agent memory provider — not just a
connector. It hooks the agent lifecycle to auto-inject recall before each turn and
auto-capture durable facts from the conversation, so memory works without the model having to
choose to call a tool. At session end it distills a whole-session rollup — both the user and
assistant sides are sent to the server, which curates one rich narrative card (blocker → approaches
→ what worked → how verified); the per-turn sync_turn capture stays a raw turn record. Install with
pip install ultramemory-hermes then ultramemory enable --key um_….
Memory spaces (Teams)
On Teams, Business, and Enterprise accounts, memory is two-layer:
- Shared team layer — org-wide knowledge (policies, project context, decisions) curated by the owner/admin: only they can write it, via the dashboard's "Team knowledge" console or the API. Everything in it is instantly part of every member's recall.
- Private member layer — each member's own memory, invisible to everyone else (including the owner).
Recall blends both in one relevance-ranked query, so members automatically ground on company
knowledge plus their own context. In the Hermes provider, pick where auto-captured memory lands
with ULTRAMEMORY_SPACE:
export ULTRAMEMORY_SPACE=private # private = your own member space (default)
# export ULTRAMEMORY_SPACE=shared # shared = the team space
ULTRAMEMORY_SPACE (choices private|shared, default private) sets the target space for
auto-writes (sync_turn, on_memory_write, on_session_end) and the default for the
memory_write tool. Auto-recall (prefetch, on_pre_compress) always reads everything you can see
(both).
The explicit tools also take an optional per-call space arg that overrides the default:
memory_write—space:private|shared.memory_recall/recall_gated—space:private|shared|both(defaultboth).
Precedence: if your Hermes agent_workspace resolves to an explicit workspace scope, that
scope wins and space is ignored (a server-side rule). space only takes effect for the default
(non-workspace) scope.
Per-project memory (scopes)
Within one account, the optional scope parameter partitions memory per project or workspace —
an explicit scope is written to and recalled from exclusively, so project A's memories never
bleed into project B:
- Hermes — automatic: each agent workspace gets its own scope; nothing to configure.
- MCP clients (claude.ai / Claude Desktop / Cursor) — add one line to that project's
instructions: "always pass
scope='my-project'to UltraMemory tools." - Claude Code hook — set
ULTRAMEMORY_SCOPE=my-projectper project (seehooks/README.md).
Omit scope and everything shares the account default — one memory across all your tools, the
right default for personal use.
Claude Code hooks (recall + capture)
Want deterministic memory in Claude Code without Hermes? Two copy-paste, fail-open hooks:
- Recall hook (
UserPromptSubmit) — runs on every prompt you submit, recalls your top matches, and injects them into context before the model answers. - Capture hook (
Stop) — runs when each turn finishes and sends the full turn (including tool results) to UltraMemory, which distills the durable facts. Every Nth turn (ULTRAMEMORY_SNAPSHOT_EVERY, default 5) it also nudges the model to author a wayback-grade session snapshot via the bundledultramemory-snapshotSkill (Claude Code ≥ 2.1.163).
Both are fail-open and copy-paste runnable. See hooks/README.md.
Token economics
The SDK clients in this repo (the Claude Code recall hook and the Hermes provider) opt into a
preview tier of recall that cuts per-turn token spend from thousands to hundreds, without
touching the hosted connectors — claude.ai, Claude Desktop, and ChatGPT behavior is unchanged
(the new mode / exclude_ids params are strictly opt-in; omitting them = full behavior).
- Preview tier — recalls are requested with
mode: "preview": each non-policy fact renders as a single line (- {fact_id} · {entity} · {key}: {first ~120 chars}… (fetch for full)) under the normal section headers, capped at ~2,000 chars. Full text stays one explicitfetchaway.[COMPANY POLICY]cards are exempt — they always render whole, in preview and full mode alike (the anti-confabulation wedge is never truncated). - Session dedupe — fact_ids already delivered this session are sent back as
exclude_ids, so repeat turns don't re-spend budget on facts the model already holds; freed budget flows to fresh facts. - Client cache —
~/.ultramemory/cache.json(ejected byultramemory enable; user-editable, chmod 600, LRU-bounded at 500 entries / ~1 MB). It memoizes identical recall queries for 5 minutes (a repeat query makes zero HTTP calls) and tracks each session's seen fact_ids for 24 h. Delete the file to reset; corrupt files are silently rebuilt.
Environment tunables:
| Env | Default | Effect |
|---|---|---|
ULTRAMEMORY_CACHE=off |
on | kill switch — disables the memo + seen cache entirely |
ULTRAMEMORY_PREVIEW=off |
on | Hermes prefetch reverts to full (non-preview) recall |
ULTRAMEMORY_HOOK_BUDGET |
2000 |
Claude Code hook recall budget in characters |
ULTRAMEMORY_HOOK_POLICY_BUDGET |
12000 |
hook injection cap on [COMPANY POLICY] turns (whole policies, never truncated) |
ULTRAMEMORY_MIN_CONFIDENCE |
low |
hook skips injection below this recall confidence |
Why UltraMemory
- Deterministic recall-first. "Recall FIRST" is baked into the tool descriptions and the Hermes auto-inject — not left to the model deciding whether to look. Recall-first, guaranteed.
- Honest about what it doesn't know. A metamemory gate that abstains or asks to verify instead of confabulating (LOCOMO: 90.2% correctly-abstained).
License
Apache-2.0 (see LICENSE). This is the open-source client surface. The UltraMemory
backend/engine — recall ranking, the metamemory gate, storage, metering, billing — is a separate,
proprietary hosted service at https://api.ultramemory.us.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ultramemory_hermes-1.8.0.tar.gz.
File metadata
- Download URL: ultramemory_hermes-1.8.0.tar.gz
- Upload date:
- Size: 35.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08395f5fc460a180b9aef576f4aaa2f12566432b5958eeb45635a1f08a9eecd7
|
|
| MD5 |
a76ed4a7b473382b9dc44e29467d351a
|
|
| BLAKE2b-256 |
2339b7f746cf012ff8e5bb48e311dc217a17d14bc0d6ea63dfc58d62fd6247a2
|
File details
Details for the file ultramemory_hermes-1.8.0-py3-none-any.whl.
File metadata
- Download URL: ultramemory_hermes-1.8.0-py3-none-any.whl
- Upload date:
- Size: 30.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9c5eccd15df9b54ebfbdf72c373655e1da37fdf38f46de7ccd5d2c314de2c43
|
|
| MD5 |
4c8a7f91a5c0ba3303e05855a7109af2
|
|
| BLAKE2b-256 |
44f65b134766fe78f33888eeda0ac242e47e3c5e07fccd459aa839730a7c0a4d
|