Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/U4CSolutions/MidMemnpx agentmods add skills/u4csolutions/midmem/midmem-devWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/u4csolutions/midmem/midmem-dev)<a href="https://agentmods.dev/skills/u4csolutions/midmem/midmem-dev"><img src="https://agentmods.dev/badge/skills/u4csolutions/midmem/midmem-dev/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/u4csolutions/midmem/midmem-dev"><img src="https://agentmods.dev/badge/skills/u4csolutions/midmem/midmem-dev.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00136 | $0.01554 |
| Opus 5.5 | $0.00054 | $0.00622 |
| Sonnet 5.5 | $0.00027 | $0.00311 |
| Haiku 4.5 | $0.00014 | $0.00155 |
Grade A, and why
midmem-dev scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.
MidMem development loop
Repo: this checkout (own git). Node ESM, node:sqlite, zero external deps. Core: packages/core/.
Paths below are repo-relative; <repo> = the midmem-kb-store checkout root.
The architecture you must preserve
- Pure-core. Everything lives in
packages/core/srcover onestate.db, reached via exactly three surfaces: CLIbin/cli.mjs, MCPbin/mcp-server.mjs, hook seambin/hook.mjs. No file in the core may reference OpenClaw, Hermes, Claude Code, or any host stack. This is what makes it run in 4 modes (standalone · OpenClaw add-on · Hermes add-on · bridge); seedocs/INTEGRATION-MODES.md. state.db= source of truth; the ObsidianLLM Wiki= deterministic projection (regenerable; never canonical, never hand-edited).- Determinism + grounding. Categorization, work-events, community detection, contradiction detection are deterministic (no LLM). Ingest runs the DELEGATE-52 grounding check before persisting. Never bypass grounding; never use LLM self-review for grounding/promotion.
Map of the core (where things go)
orchestrator.mjs— the coordinator; every public op + governance +#maybeMaintain. Add new public methods here.db.mjs— schema (entries,vectors,nodes,edges,claims,sources,log,audit). Prefer usingentries.type+provenanceover new tables/columns.memory.mjstiers/lifecycle ·retrieval.mjshybrid lanes + post-RRF boosts ·graph.mjsnodes/edges (extendEDGE_TYPESfor new relations) ·claims.mjs·workmemory.mjswork events + categorization ·concepts.mjsconcept embeddings + communities ·grounding.mjs·config.mjs(env-tunable knobs) ·index.mjs(public exports).
Adding a capability — the checklist
- Core logic in the right module (or a new
src/<feature>.mjs); keep it deterministic where it can be. Read the module first and match its idiom/comment density. - Wire an
Orchestratormethod → export inindex.mjs→ expose via MCP tool (bin/mcp-server.mjs) and CLI command (bin/cli.mjs). Add a config block (env-tunable) inconfig.mjsif it has knobs. - Boosts go post-RRF in
retrieval.mjs, small (≈ trust/graph magnitude, ~0.004–0.01), additive. - Anything that ingests inside
maintain()must be re-entrancy-guarded (this._maintaining) — the bridge→ingest→#maybeMaintain→maintain path recurses infinitely on a lowintervalMs; the throttle alone is not safe. Heavy work (embedding) runs on forced/daily maintain only. - Test it. Add assertions to
packages/core/test/smoke.mjs(offline, hermetic — passautoIngest:{enabled:false}to test orchestrators somaintain()doesn't bridge real dirs).
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago Changed 35fc6cc800c8
- 8d ago Changed 5c42cd021710
- 13d ago Changed fb94fe84d565
- 14d ago Changed 12b50161fcb6
- 26d ago Changed 25ac04b33807
- 27d ago Changed d4a4a37b9a4c
- 1mo ago Changed c066321bc6ec
- 1mo ago Changed 9d7666a18972
- 1mo ago First seen · 88 lines · 136 tokens per session scan A 66e10ce02b61
midmem-dev is a skill published in the GitHub repository U4CSolutions/MidMem (2 stars, last pushed 2d ago), licensed Apache-2.0. It adds 136 tokens to every session and 1,554 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
pinecone-research
Agent RAG and long-term memory with Pinecone.
browserwing-admin
Manage and operate BrowserWing — an intelligent browser automation platform. Install dependencies, configure LLM, create/manage/execute automation scripts, use AI-driven exploration to generate scripts, browse the script marketplace, and troubleshoot issues.
karpathy-llm-wiki
Use when building or maintaining a personal LLM-powered knowledge base. Triggers: ingesting sources into a wiki, querying wiki knowledge, linting wiki quality, 'add to wiki', 'what do I know about', or any mention of 'LLM wiki' or 'Karpathy wiki'.
local-embedding
Run embedding on-device with ONNX Runtime. Build from source, model selection, offline mode. Use when setting up local embedding without an API key.
dify
Use when building LLM applications with visual workflow — RAG knowledge bases, AI agents, chatbots with drag-and-drop orchestration. Dify: open-source LLM app platform supporting 30+ models (OpenAI, Claude, DeepSeek, Ollama, Qwen, GLM) with Docker deployment.
ai-skills
Use when building LLM applications, RAG knowledge bases, AI agents, terminal coding agents, multi-model orchestration, plugin-based agent harnesses, or file translation. Index of 14 skills: Dify, LangChain, LlamaIndex, Ollama, Transformers, Hermes Agent, OpenClaw, OpenCode, Pi, DocuTranslate, DeepSeek Harness and more.