QuoteMem
QuoteMem is a long-term memory service for AI agents that keeps the exact words behind every memory.
- Every memory keeps its exact quote. Each memory is a short statement tied by byte range to the words it came from.
- Updates keep the old version. When a fact changes, a new version is written and the old one is kept and marked as replaced.
- "Forget" is carried out and stays forgotten. The memories the request
matches are taken out of reads and are not learned again later, except
from the user's own later, dated statement of it in the
agentAdd mode.
Demo
examples/demo
tells one short story to a running service, for a new user. Chat 1:
"I live in Beijing. My cat is called Bob. I work as a nurse." Chat 2:
"I moved from Beijing to Shanghai last month." Chat 3: "Forget my cat's
name." It runs from a clone of the repository, after npm install -g quotemem
and quotemem setup:
git clone https://github.com/edsml-jz2321/QuoteMem.git
cd QuoteMem
quotemem serve &
node examples/demo/demo.mjs
This is a real run with the default preset (output shortened):
$ node examples/demo/demo.mjs
2. Chat 2, the user says: "I moved from Beijing to Shanghai last month."
stored: 1 corrected
3. The memories, each with its quote:
[past] The user lives in Beijing.
[current] The user moved from Beijing to Shanghai last month.
quote: "I moved from Beijing to Shanghai last month."
...
history of the city, newest first:
update: The user moved from Beijing to Shanghai last month.
create: The user lives in Beijing.
4. Recall:
search "Where does the user live now?", first hit:
The user moved from Beijing to Shanghai last month. (said on ...)
Status: current
- user: "I moved from Beijing to Shanghai last month."
5. Chat 3, the user says: "Forget my cat's name."
prepare, goes: The user's cat is named Bob.
confirm: verified
6. After the forget:
[current] The user has a cat.
quote: "My cat"
...
search "What is the name of the user's cat?", first hit:
The user has a cat. (said on ...)
"Bob" in the memories or the search: no
These lines came out the same in ten runs, each with a new user. The script
ends with the same list from quotemem memories.
Quick start
You need Node 20.3 or later and uv on PATH.
The default preset uses one Alibaba Cloud Model Studio (DashScope) API key,
from bailian.console.aliyun.com (China region).
-
Install the command and set it up once:
npm install -g quotemem quotemem setup
Setup asks for the preset (Enter takes
default), the review (Enter takesstandard) and your key, which is not shown as you type. It checks the settings with one call to each model and ends withok: the settings work. .... For scripts,quotemem setup --yes --preset default --review standardtakes the key fromDASHSCOPE_API_KEY. -
Install one tool, for example Cursor:
quotemem install cursor --write. It writes~/.cursor/hooks.jsonand~/.cursor/mcp.json, and prints the rule to copy into each project.quotemem doctorchecks the setup. -
Say something in a chat: "I live in Beijing. My cat is called Bob." The first chat starts the memory service in the background (the first start downloads it). The chat is saved in the background every few turns, and once it has been idle for 5 minutes. Then
quotemem memorieslists each memory with its quote:[current] The user's cat is named Bob. remembered 2026-11-24, changed 2026-11-24; id 01M86JY92FDXTXP53TJ1MRZ58D - user, 2026-11-24: My cat is called Bob.
-
Ask in a new chat: "Where do I live?" The plugin adds the matching memory to the prompt, with its quote from the first chat, in a line like
- user: "I live in Beijing". -
Say "Forget my cat's name." The plugin forgets it and tells the agent. Then
quotemem memoriesshowsThe user has a cat.with the quoteMy cat, and no name. A later "What is my cat called?" finds no name.
quotemem status shows the service; quotemem stop stops it.
Works with your tools, and they share one memory
Every tool's plugin talks to one local service, so what you tell one tool is
recalled in the others, and what you ask one tool to forget is forgotten in
all of them. They all use one memory by default: QUOTEMEM_USER_ID, which
defaults to your OS user name.
| Tool | Set it up |
|---|---|
| Claude Code | claude plugin marketplace add edsml-jz2321/QuoteMem --sparse .claude-plugin integrations, then claude plugin install quotemem@quotemem |
| Codex CLI | codex plugin marketplace add edsml-jz2321/QuoteMem --sparse .agents --sparse integrations/codex, then codex plugin add quotemem@quotemem, then trust the hooks once with /hooks |
| Cursor | quotemem install cursor --write, plus the rule it prints, in each project |
| OpenCode | quotemem install opencode prints the block to merge into opencode.jsonc |
| Gemini CLI | quotemem install gemini prints the gemini extensions install command |
| Cline (VS Code) | quotemem install cline --write, then turn on Enable Hooks |
| goose | quotemem install goose --write, then set GOOSE_MOIM_MESSAGE_FILE as it prints |
| OpenClaw | quotemem install openclaw prints the openclaw plugins install command |
| DSH | dsh plugin --profile quotemem add quotemem (needs pnpm on PATH), then start dsh --profile quotemem |
The service runs on 127.0.0.1:8765. To use a port of your own, put
QUOTEMEM_URL=http://127.0.0.1:<port> in ~/.quotemem/env and in the
environment Claude Code, Codex and DSH start in. The service keeps the proxy settings of the tool
or shell that starts it; if your proxy is only for downloads, add the model
host to NO_PROXY (.aliyuncs.com for the default preset). More tools and details:
Use with your agents.
Use it from code
The HTTP service takes a bearer token from its data folder:
TOKEN_FILE=~/.local/share/quotemem/token
curl -s http://127.0.0.1:8765/memory/add \
-H "Authorization: Bearer $(cat "$TOKEN_FILE")" -H "Content-Type: application/json" \
-d '{"user_id": "u1", "session_id": "s1",
"messages": [{"role": "user", "content": "I moved to Lisbon last spring."}]}'
curl -s http://127.0.0.1:8765/memory/search \
-H "Authorization: Bearer $(cat "$TOKEN_FILE")" -H "Content-Type: application/json" \
-d '{"user_id": "u1", "query": "Where do I live?"}'
Any MCP client can use the memory tools (search, add, history, forget):
{
"mcpServers": {
"quotemem": { "command": "npx", "args": ["-y", "quotemem", "mcp"] }
}
}
Without Node: uvx quotemem serve, or pip install "quotemem>=0.3", then
quotemem serve (what it needs).
Result
In the Agent Memory Leaderboard (AMLB) Cycle 2 official results, QuoteMem scored 59.83 overall and ranked 23rd of 125 entries in Textual Memory · Closed-source Methods, where it is listed as "QuoteMem" with a link to this repository: https://agentmemoryleaderboard.ai/results/cycle-2/#industry-textual.
Documentation
The docs have the full guides: what it does, the service and its routes, configuration and review, forgetting, commands and the memory list, agents, benchmarks and development. Changes are in the changelog.
CI runs ruff, pyright, a service smoke test and a checked build on Python 3.12,
3.13 and 3.14, and the Node tests (npm test, npm run check) on Node 20 and 24
(ci.yml).
To send a change, see CONTRIBUTING.md.
Please open a GitHub issue for questions, bug reports and suggestions. Report a
security issue privately, as SECURITY.md describes.
Licence
QuoteMem is released under the MIT License, see LICENSE. The included HeavenBase is MIT-licensed too. Third-party components and the licences of the benchmark sources are listed in NOTICE. Benchmark datasets are not redistributed here and keep their own licences.
Metadata
Release files for quotemem 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| quotemem-0.3.1.tar.gz | 3.6 MB | With provenance | Details for quotemem-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| quotemem-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for quotemem-0.3.1-py3-none-any.whl |
Total release size: 7.7 MB
Release files / quotemem-0.3.1.tar.gz
| Download URL | quotemem-0.3.1.tar.gz |
|---|---|
| Size | 3.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
382d9694e43bc4925bf305aab8249bd291e569bf3cd38501f5db2ee5dc9c748a
|
|
BLAKE2b-256 checksum How to use checksums |
f62cf4c9adb31d53514308dfe5e3f041b60b4b5bc413286d915e676bc167a310
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logRelease files / quotemem-0.3.1-py3-none-any.whl
| Download URL | quotemem-0.3.1-py3-none-any.whl |
|---|---|
| Size | 4.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b9385d8997b28b9025834fb8f4e518140523dad669e4b998e961ca04223cef40
|
|
BLAKE2b-256 checksum How to use checksums |
29a5f3e2dff773eab4b5a2908d5b9430c0ec5ee9ce8b0a71662aaf01805169ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logSecurity for quotemem 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for quotemem-0.3.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.