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 ApexIQ/skillsmith --skill memory_orchestratorgit clone --depth 1 https://github.com/ApexIQ/skillsmithWrote 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/apexiq/skillsmith/memory_orchestrator)<a href="https://agentmods.dev/skills/apexiq/skillsmith/memory_orchestrator"><img src="https://agentmods.dev/badge/skills/apexiq/skillsmith/memory_orchestrator.svg" alt="Measured on agentmods" 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.00053 | $0.00874 |
| Opus 5 | $0.00026 | $0.00437 |
| Sonnet 5 | $0.00011 | $0.00175 |
| Haiku 4.5 | $0.00005 | $0.00087 |
Grade A, and why
memory-orchestrator 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 8d 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 — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.
🧠 Memory Orchestrator (O3-RS Pipeline)
Directive: "Library-First. Context-Lean. Multi-Layer Recovery."
The Five-Layer Reliability Pattern
To achieve 100% project recall at <50% token cost, implement these layers in strict sequence:
1. 👁️ Layer 1: Observer Capture (Raw Event Log)
Goal: Record all agent actions without interrupting reasoning.
- Pattern:
ObserverPatternorEventStore. - Implementation: Intercept all tool calls/outputs and prompt responses.
- Storage: Append-only
raw_events.jsonlin.agent/logs/. - Logic: Never summarize in real-time; storage is cheap, reasoning is expensive.
2. 🪞 Layer 2: Reflector Compaction (Cognitive Compression)
Goal: Distill facts from raw events.
- Trigger: End of task or
token_count > N. - Pattern:
MapReducefor memories. - Implementation: Call a cheaper LLM (e.g., GPT-4o-mini) to extract Lessons (what to do next time) and Observations (what happened).
- Storage: Structured
lessons.mdorobservations.json.
3. 🏁 Layer 3: Session Recovery (Relevance Injection)
Goal: Hydrate the current session with only the "Best-of-Best" context.
- Pattern:
PersistentRetrievalAugmentedGeneration (P-RAG). - Implementation: Query the local
index.jsonusing BM25 or keywords from the current goal. - Constraint: Max 2-3 "Lessons" and top-5 "Recent Observations" per prompt.
4. ⚡ Layer 4: Reactive Watcher Refresh (Drift Guard)
Goal: Ensure memory is not hallucinating based on old code.
- Pattern:
Watcher+Fingerprinting. - Implementation: Link memory chunks to file paths + SHA-256 hashes.
- Invalidation: If the file system changes, flag related memories as "Stale" or "Needs Re-reflection".
5. 🛡️ Layer 5: Pre-compaction Safeguard (Context Bound)
Goal: Prevent total context amnesia.
- Pattern:
BoundedBufferorPriorityQueue. - Implementation: A simple token counter that forces a mandatory "Reflector" run when context reaches 80% to ensure critical info is persisted before it overflows.
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.
- 8d ago First seen · 81 lines · 53 tokens per session scan A bc724bb7e2ef
memory-orchestrator is a skill published in the GitHub repository ApexIQ/skillsmith (5 stars, last pushed 5mo ago), licensed MIT. It adds 53 tokens to every session and 874 once invoked, about $0.0003 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
self-improvement
Captures lessons and promotes recurring patterns.
context-engineering
Engineer what enters the model's context window for reliability and cost using Write, Select, Compress, and Isolate.
hindsight-architect
Expert memory architect. Understands your application, identifies where memory adds value, and produces an implementation plan with bank config, tag schema, and code.
create-agent
Create a new Hindsight-powered subagent with long-term memory. Use when the user wants a specialized agent that learns and remembers across sessions.
hindsight-local
Store user preferences, learnings from tasks, and procedure outcomes. Use to remember what works and recall context before new tasks. (user).
hindsight-docs
Complete Hindsight documentation for AI agents. Use this to learn about Hindsight architecture, APIs, configuration, and best practices.