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 skills add eric-cielo/moflo --skill memory-optimizationgit clone --depth 1 https://github.com/eric-cielo/mofloWrote 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/eric-cielo/moflo/memory-optimization)<a href="https://agentmods.dev/skills/eric-cielo/moflo/memory-optimization"><img src="https://agentmods.dev/badge/skills/eric-cielo/moflo/memory-optimization/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/eric-cielo/moflo/memory-optimization"><img src="https://agentmods.dev/badge/skills/eric-cielo/moflo/memory-optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium MCP Rug Pull · line 89 npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.Fix: Pin the version: npx @scope/[email protected]
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.00060 | $0.01299 |
| Opus 5.5 | $0.00024 | $0.00520 |
| Sonnet 5.5 | $0.00012 | $0.00260 |
| Haiku 4.5 | $0.00006 | $0.00130 |
Grade A, and why
memory-optimization 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 1mo 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 — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.
MoFlo Memory Optimization
When the default moflo memory settings stop being enough — past ~100k entries, or when p95 search latency climbs — these are the levers.
HNSW Parameters
HNSW has three knobs. They trade build time, query time, memory, and recall.
import { HNSWIndex } from 'moflo/dist/src/cli/memory/index.js';
const index = new HNSWIndex({
dimensions: 1536, // must match your embedding model
maxElements: 1_000_000, // pre-allocated capacity
M: 16, // graph connectivity (default 16)
efConstruction: 200, // build-time search width (default 200)
metric: 'cosine', // 'cosine' | 'l2' | 'ip'
});
| Knob | Higher | Lower | When to change |
|---|---|---|---|
M |
better recall, more RAM (~2×M pointers per point) | less RAM, worse recall | Bump to 32–64 if recall@10 < 0.95; drop to 8 if memory-bound |
efConstruction |
better index quality, slower build | faster build, worse queries | 200–400 is sweet spot; only lower in test fixtures |
ef (search-time, passed to search()) |
better recall, slower queries | faster queries, worse recall | Start at 2×k, raise until recall plateaus |
Rule of thumb: M and efConstruction are set once. ef is the runtime dial.
Quantization
moflo memory supports scalar quantization (Float32 → Int8) for a ~4× memory reduction with a ~1-2% recall hit. Turn it on when the index doesn't fit comfortably in RAM.
const index = new HNSWIndex({
dimensions: 1536,
maxElements: 5_000_000,
quantization: {
enabled: true,
type: 'scalar', // scalar (Int8) is the supported path
rebuildThreshold: 10_000,
},
});
Measure recall before/after on your own query distribution — public benchmarks don't predict your domain.
Batch Operations
Single-entry writes pay the HNSW insert cost per call. For bulk ingest, batch:
const entries: Array<[string, Float32Array]> = buildCorpus();
// Parallelise at the adapter level; don't await sequentially.
await Promise.all(
entries.map(([id, vec]) => index.addPoint(id, vec))
);
// Or via MCP for moflo-native batch into .swarm/memory.db:
await mcp.memory_store(/* … */); // upsert: true + Promise.all is fine
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.
- 1mo ago First seen · 122 lines · 60 tokens per session scan A 2bead0eafc6a
memory-optimization is a skill published in the GitHub repository eric-cielo/moflo (19 stars, last pushed yesterday), licensed MIT. It adds 60 tokens to every session and 1,299 once invoked, about $0.0002 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-30.
Other skills, from other repositories
pinecone-research
Agent RAG and long-term memory with Pinecone.
langchain
Framework for building LLM-powered applications with agents, chains, and RAG. Supports multiple providers (OpenAI, Anthropic, Google), 500+ integrations, ReAct agents, tool calling, memory management, and vector store retrieval. Use for building chatbots, question-answering systems, autonomous agents, or RAG…
mem0-integration
Mem0 memory layer integration for AI agents. Implement persistent, semantic memory for long-term context retention and personalization.
Vizra ADK Memory System
Implement persistent memory, session context, and vector memory (RAG) for AI agents.
vector-memory
HNSW vector search for pattern similarity retrieval and knowledge graph maintenance with PageRank scoring, community detection, and 3-tier memory management.
ai-context-layer
Designs cross-session agent memory: point-in-time facts, consolidation, tenant isolation. Use when auditing user memory or Mem0/Zep. Not for repo context (dev-context-engineering).