PlugMem
Plug-and-play long-term memory that compresses agent interaction histories into compact, reusable knowledge units for low-overhead recall.
- Source repo
- TIMAN-group/PlugMem
- Stars
- ★ 304
- Last updated
- 4mo ago
- FARS reviewed
- Oct 11, 2026
- License
- Apache-2.0
- Primary language
- Python
- FA score
- 47/100 · Major gaps
At a glance
- How it runs
- Works with
- Portable with changesClaude Code · OpenAI API
- Cost
- Free software; you pay for model usage
- Setup effort
- High · needs real infrastructure
- You'll need
- Typical use
- Developers building dialogue or QA agents who need cross-session recall without stuffing full history into the context window.
- Not a fit if
- Teams without GPU capacity to host Qwen and embedding servers
- Projects that want a zero-infrastructure memory API
- Workloads that never need cross-session recall
- Maintenance
- Commits in the last 6 monthslast commit 2026-07-09
- Source review
- 47/100 · Major gaps
What does this agent do, and when should you use it?
PlugMem is an Apache-2.0 long-term memory layer for LLM agents, released with an ICML 2026 paper. Instead of replaying raw interaction histories, it structures experience into semantic, procedural and episodic knowledge units held in a MemoryGraph and queried through retrieve_and_reason. You can use it as a Python library — append a Memory sequence, close it, insert it into the graph — or install the bundled Claude Code and OpenClaw plugins, which expose remember/recall tools and a Memory Inspector web UI. Structuring and retrieval depend on LLM and embedding services configured via environment variables (OpenAI/Azure plus locally hosted Qwen and NV-Embed-v2 servers). The repository also ships evaluation harnesses for WebArena, LongMemEval and HotpotQA, reporting 90.2 Acc on LongMemEval and 79.1 F1 / 91.1% LLM-Judge Acc on HotpotQA.
PlugMem ingests an agent session as a Memory sequence: call mem.append(...) per item, mem.close() at the end, then mg.insert(mem) to run the structuring pipeline, where an LLM extracts graph nodes. Nodes are typed semantic (facts, user preferences), procedural (workflows, step-by-step know-how) and episodic (long sessions written under DIR_PATH and referenced by ID), and are linked hierarchically inside MemoryGraph, which also supports updating and evolution. At query time mg.retrieve_and_reason(...) retrieves the relevant nodes and reasons over them, returning compact context rather than raw history. The OpenClaw plugin exposes plugmem.remember and plugmem.recall to the agent, auto-saves the trajectory on /reset and before context compaction, then runs the structuring pipeline; recall fans out across a default graph plus optional read-only shared graphs. The Memory Inspector (http://localhost:8080/inspector/) shows graph topology, browses and filters individual memories, debugs recall scoring node-by-node, and replays agent trajectories. Evaluation scripts under src/eval/webarena, longmemeval and hotpotqa drive benchmark agents such as AgentOccam with flags like --load_memory_graph, --replay-trajectory and --disable-memory-graph.
- Developers building dialogue or QA agents who need cross-session recall without stuffing full history into the context window.
- Evaluation teams reproducing a memory baseline on WebArena, LongMemEval or HotpotQA.
- Claude Code users who want a self-writing CLAUDE.md that accumulates project conventions and debugging recipes.
- OpenClaw agent operators who want remember/recall without writing their own storage and retrieval code.
- Researchers who need to inspect the memory graph and debug recall scoring node by node.
- Teams sharing one read-only user-facts graph across several agents.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
pip install -U openai==2.6.1
- Environment variables
OPENAI_API_KEYAZURE_ENDPOINTDIR_PATHQWEN_BASE_URLEMBEDDING_BASE_URL- Config files
config.yaml
How do you install or deploy this agent?
There is no packaged installer: clone the repository, then install the benchmark dependencies under src/ following their own docs.
git clone https://github.com/TIMAN-group/PlugMem
cd PlugMemInstall/upgrade the OpenAI SDK:
pip install -U openai==2.6.1For WebArena, clone the modified AgentOccam and webarena repos and copy the patch files:
cd src
git clone https://github.com/jizej/AgentOccam
git clone https://github.com/web-arena-x/webarena
cp src/webarena_patch/envs.py src/webarena/browser_env/envs.py
cp src/webarena_patch/openai_utils.py src/webarena/llms/providers/openai_utils.pyExport the credentials and endpoints the code reads:
export OPENAI_API_KEY=<your_openai_api_key>
export AZURE_ENDPOINT=<your_azure_endpoint>
export DIR_PATH="/<your_path_to_PlugMem>/data"
export QWEN_BASE_URL="http://<your_qwen_host>:8000/v1"
export EMBEDDING_BASE_URL="http://<your_embedding_host>:8001/v1/embeddings"Host the local Qwen (vLLM) and NV-Embed-v2 servers:
cd host_local_inference
bash vllm_deploy.sh
bash nv_embed_v2_deploy.shCreate the memory directories:
mkdir -p "$DIR_PATH/episodic_memory" \
"$DIR_PATH/semantic_memory" \
"$DIR_PATH/procedural_memory" \
"$DIR_PATH/tag" \
"$DIR_PATH/subgoal"Install the Claude Code plugin by pointing Claude at the plugin directory (ONBOARDING.md walks from zero to a verified loop in about 15 minutes):
claude --plugin-dir plugmem-coding-claude-code/How do you use this agent?
Minimal library usage is the README's six-line integration:
# init PlugMem memory graph
mg = MemoryGraph()
# init memory sequence
mem = Memory(...)
mem.append(...)
mem.close()
# insert memory sequence into memory graph
mg.insert(mem)
# retrieve memory and perform reasoning on retrieved nodes
mg.retrieve_and_reason(...)Run a benchmark, for example WebArena (--config is required):
cd src/eval/webarena
python eval_agentoccam.py --config <config.yaml>LongMemEval:
cd src/eval/longmemeval
python eval_longmemeval_all.pyHotpotQA structures the corpus first, then evaluates:
cd src/eval/hotpotqa
python build.py
python eval_hotpotqa_all.pyWith the OpenClaw plugin service running, open http://localhost:8080/inspector/ to browse the memory graph, test recall and replay sessions; use --load_memory_graph, --replay-trajectory and --disable-memory-graph to load a persisted graph, replay a saved trajectory, or turn memory off for comparison.
Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
What are this agent's strengths and limitations?
- Three typed memories (semantic, procedural, episodic) in a hierarchical graph rather than one flat vector index, so recall returns compact knowledge units.
- More than paper code: ships Claude Code and OpenClaw plugins, plugmem.remember/recall tools, and a visual Memory Inspector.
- Task-agnostic design reporting 90.2 Acc on LongMemEval and 79.1 F1 / 91.1% LLM-Judge Acc on HotpotQA, with a step-by-step examples/task-adaptation reproduction guide.
- Apache-2.0 licensed, with released trajectories and memory-graph artifacts for all three tasks and WebArena human demonstrations under CC BY 4.0.
- Low integration cost: the core path is six lines using MemoryGraph, Memory, insert and retrieve_and_reason.
- The quickstart requires hosting two local inference services — Qwen on vLLM and NV-Embed-v2 — plus an OpenAI key and Azure endpoint, effectively GPU infrastructure.
- Runtime is pinned to openai==2.6.1 and needs several environment variables at once (QWEN_BASE_URL, EMBEDDING_BASE_URL, AZURE_ENDPOINT, DIR_PATH).
- Only the Claude Code adapter ships today; the design doc lists OpenCode and OpenClaw adapters as planned.
- WebArena setup means cloning a modified AgentOccam and webarena and copying patch files by hand, and HotpotQA structuring can take several hours per the README.
- No pip package: the installation section describes benchmark environment setup rather than a single reusable install entry point.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| PlugMem This agent | 47 · Major gaps | CLIFree + model costs | ★ 304 | 4mo ago | Python | Claude Code · OpenAI API |
| Cognee Memory Platform | 76 · Good | Library / SDKFree + model costs | ★ 34k | 4d ago | Python | Claude Code · OpenAI API |
| ClickHouse Loom | 68 · Some gaps | — | ★ 212 | today | Python | Codex · Claude Code |
| RepoBrain – Repo Intelligence Engine | 54 · Major gaps | Agent plugin / skillFree + model costs | ★ 1.4k | 12d ago | Python | Codex · Claude Code |
How does FollowAgents rate this agent?
Why each dimension lost points
Evidence shows the plugin authenticates to a localhost service via an X-API-Key header (client.test.ts) with a narrow default surface, but the repo provides no permission declarations, least-privilege configuration, or user-confirmation flow; auto-remember hooks (before_reset/before_compaction) persist session trajectories without explicit consent, a default side effect. Data-flow transparency is partial: README mentions shared read-only graphs and local inference servers but never states whether data leaves the machine to OpenAI/Azure endpoints, and there is no redaction or retention policy for sensitive data. Rollback is limited to deleteGraph and a PLUGMEM_KEEP_STATE toggle, with no undo/audit for memory writes. Dependencies use loose lower bounds (chromadb>=0.5, openai>=1.0) with no lockfile or vulnerability scanning. Source attribution is solid: README gives the paper, author list, and BibTeX. Deductions: permissions/confirmation, data-flow transparency, sensitive data, rollback, and dependency security are partial or absent.
Tests assert concrete client behavior: retries on 503 and network errors, typed errors (PlugMemError/PlugMemConnectionError), no retry on 400, and error bodies carrying status plus detail. Failure messages are informative. Dependency availability is weak: pyproject pins only lower bounds with no lockfile, and README requires manually cloning AgentOccam and webarena, applying patches, and hosting vLLM plus NV-Embed-v2 servers. Self-consistency and failure messages score 2; dependency availability scores 1.
README targets dialogue agents, knowledge-intensive QA, web automation, and coding agents (Claude Code/OpenClaw), a broad scenario set; recall exposes a mode parameter and raw toggle, and trigger behavior is covered by tests. Capability boundaries are vague: README says the graph is 'naively' updated/evolved without stating capacity, conflict resolution, or failure limits. Environment fit is demanding, requiring local GPU inference and patched external repos, which ordinary users cannot easily satisfy. Both are deducted.
README has a table of contents, updates, installation, and quick start, so information architecture is adequate; naming (plugmem.remember/recall, MemoryGraph) is consistent across tests and docs. Install notes are incomplete, relying on cloning external repos and manual patches; examples point to an examples/task-adaptation directory with no in-repo FAQ; known limitations are a single 'naively support' phrase; version is 0.1.0 with no CHANGELOG file; maintenance responsibility is unstated (publisher unverified). LICENSE is the full Apache-2.0 text, earning full marks.
Output usability is good: recall returns reasoning text prefixed with [mode] or the raw prompt, remember returns a stats summary, and tests cover output shapes. Marginal value is clear: compact reusable knowledge units replace raw history to cut context overhead, with claimed SOTA on LongMemEval/HotpotQA. Cost-benefit evidence is thin: it requires self-hosted Qwen and embedding servers, HotpotQA structuring 'may take several hours', and README gives no latency, token, or cost comparison, so cost-benefit scores 1.
README provides an arXiv ID and BibTeX, making the paper traceable, but SOTA numbers (90.2 Acc, 79.1 F1) are bare assertions with no in-repo evaluation logs or result files, and the reproduction guide points to an external directory. Cross-source corroboration is limited: tests and README agree on API shapes, but performance claims have no second source. Fact/inference separation is weak, with 'task-agnostic' and 'drop-in backbone' framing mixed into factual statements. All three score 1.
- Auto-remember hooks persist trajectories before session reset or compaction without explicit user confirmation or write auditing; assess privacy and compliance impact before deployment.
- README never states whether data is sent to external endpoints such as OpenAI/Azure and offers no redaction or retention policy; verify the data flow before handling sensitive session content.
- Dependencies use only lower bounds with no lockfile, and setup requires manually cloning and patching AgentOccam/webarena plus self-hosting vLLM and NV-Embed-v2, making reproduction costly.
- SOTA numbers and 'task-agnostic' claims lack in-repo evaluation artifacts and remain unverified assertions.
- Publisher identity is unverified and maintenance responsibility/update path are unclear, so long-term maintenance is not guaranteed.
FAQ
Do I need my own GPU?
Which model services does it call?
Is there a pip package or one-command install?
Can I disable memory for an ablation?
Can several agents share one memory store?
Is PlugMem free?
Is PlugMem open source?
Is PlugMem safe to use?
Is PlugMem still maintained?
Who makes PlugMem?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.