# Memory Manager

> A Claude skill from codejunkie99/agentic-stack.

- **Type:** Skill
- **Install:** `agentstack add skill-codejunkie99-agentic-stack-memory-manager`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [codejunkie99](https://agentstack.voostack.com/s/codejunkie99)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [codejunkie99](https://github.com/codejunkie99)
- **Source:** https://github.com/codejunkie99/agentic-stack/tree/master/.agent/skills/memory-manager

## Install

```sh
agentstack add skill-codejunkie99-agentic-stack-memory-manager
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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
- On explicit `reflect` trigger from the user.
- When the context window is getting full.
- When episodic memory exceeds ~500 entries.

## 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:

```bash
python3 .agent/memory/memory_search.py 
```

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.

## Anti-patterns
- Do not auto-merge `personal/` into `semantic/` — user preferences are not general knowledge.
- Do not delete entries to "clean up" memory. Archive them.
- Do not promote lessons from a single incident. Require recurrence.

## 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`.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [codejunkie99](https://github.com/codejunkie99)
- **Source:** [codejunkie99/agentic-stack](https://github.com/codejunkie99/agentic-stack)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-codejunkie99-agentic-stack-memory-manager
- Seller: https://agentstack.voostack.com/s/codejunkie99
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
