Memory manager

From codejunkie99/agentic-stack · View interactive version

Memory manager is an AI agent skill from the GitHub repository codejunkie99/agentic-stack. After every major task or failure, call `tools/memory_reflect.py` to log what

How to use this skill

Skill file

Memory Manager — the skill that reads the filing cabinet

After every major task or failure, call tools/memory_reflect.py to log what

happened. Before important decisions, read the top entries from

memory/semantic/LESSONS.md and memory/semantic/DECISIONS.md.

When to trigger full consolidation

Consolidation steps

  1. Load top-5 episodic entries by salience score.
  2. Detect recurring patterns across the last 100 entries.
  3. For patterns appearing ≥3 times, promote to memory/semantic/LESSONS.md.
  4. Flag any skill with ≥3 failures in 14 days for rewrite (see on_failure.py).
  5. Archive resolved working context to memory/episodic/snapshots/.
  6. Commit via git so history is preserved: git log memory/ is the agent's autobiography.

Searching memory by keyword

When you need to find a specific memory by topic or keyword (not just the

top-salience entries), use the FTS5 search tool:

python3 .agent/memory/memory_search.py <query>

This indexes all .md and .jsonl files under .agent/memory/ and returns

ranked results with context snippets. Falls back to grep if FTS5 is not

available. The index auto-rebuilds when files change.

Markdown tracks, reflection, knowledge

Markdown under memory/{episodes,cases,foresights}/ — append with

tools/track.py add ..., search with track.py search, never hand-delete

(use deprecate).

into one consolidated entry and deprecates the originals (audit in

reflection_report.jsonl). Cron it; it is model-free.

source-backed, Markdown, editable; knowledge.py search before answering

from memory of a doc.

memory/personal/PROFILE.md; trajectories never do.

turn repeated successful cases into candidate skills for review.

Anti-patterns

Self-rewrite hook

Every 10 reflections, or when the same type of mistake appears 3+ times

recently, this skill's approach to salience or distillation needs adjustment.

Propose conservative edits and log the diff in memory/semantic/DECISIONS.md.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.