Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/u4csolutions/midmem/midmem-devnpx skills add U4CSolutions/MidMem --skill midmem-devgit clone --depth 1 https://github.com/U4CSolutions/MidMemWhat 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 | $0.00136 | $0.01549 |
| Opus 5 | $0.00068 | $0.00775 |
| Sonnet 5 | $0.00027 | $0.00310 |
| 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 yesterday.
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.
- yesterday 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 8d ago), licensed Apache-2.0. It adds 136 tokens to every session and 1,549 once invoked, about $0.0007 per session on Opus 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
graph-mutation-plan
Cookbook for composing an applygraphmutations plan — stable entitykey patterns, the canonical label/edge vocabulary, evidence/invalidation/confidence discipline, and a worked example. Load this when building a non-trivial mutation plan.
potpie-infra-architecture
Use for project infra and architecture context: environments, adapters, runtime configuration, deployments, service dependencies, datastores, API contracts, ownership, incidents, and dependency blast radius.
wiki-context-pack
Produce a token-bounded, citation-ready context slice from an existing Obsidian vault for a downstream agent or task. Use for "/wiki-context-pack", "use my vault as context", "context slice for X", "pack the wiki for my agent", or "bounded context for Y".
alfworld-receptacle-finder
Searches for a suitable empty or appropriately occupied receptacle (like a shelf or table) to place an object. Use when you are holding an object that needs to be stored or placed and must find a receptacle that meets the placement criteria. Examines candidate receptacles by navigating to and inspecting each one until…
alfworld-search-pattern-executor
Systematically searches a sequence of likely locations for a target object based on common sense. Use when you need to find a specific object and know which receptacles to check but not which one contains it. Takes a list of candidate receptacles, orchestrates navigation and inspection, and outputs when the target is…
ux-ui-analyze-single-page
Analyze exactly one captured UI page (from uxuimap screenshots + request JSON) and immediately write/update uxuimap/pages/{page}.md in neutral descriptive language. Use when asked to analyze screenshots, rewrite corresponding analysis immediately, or avoid memory/context saturation.