---
name: agent-memory-e7edbb837f0a
description: Give your agent persistent cross-session memory — recall what went wrong on similar tasks before starting, then capture whether the work succeeded or failed so repeated mistakes auto-promote into prevention rules. Runs locally via the ThumbGate MCP server (recall, capture_feedback, prevention_rules, feedback_stats) — no API key needed. Use when the user says "recall", "what went wrong last time", "remember this for next time", "capture feedback", "thumbs up/down on that", or at the start of a new task or session. Do NOT use when the user wants to force one specific mistake into an enforced block gate (use the thumbgate-guard skill), to list rules that already exist (thumbgate-rules), or to check ThumbGate wiring (thumbgate-doctor).
---

# Agent Memory

Give your agent persistent memory across sessions. Before starting any task, recall what went wrong last time. After completing work, capture whether it succeeded or failed. Prevention rules are auto-generated from repeated mistakes.

## Setup

Add the MCP server (one-time):

```bash
claude mcp add thumbgate -- npx -y thumbgate serve
```

No API key needed. All data stays local.

## When to Use

- Starting a new task or session — recall past context first
- After completing work that succeeded or failed — capture feedback
- When the agent keeps making the same mistake — check prevention rules

## Workflow

### Step 1: Recall past context (do this FIRST on every task)

Call the `recall` MCP tool with a description of your current task. The tool returns:

- Past feedback relevant to this task (vector similarity search)
- Active prevention rules (auto-generated from repeated failures)
- Recent feedback summary with approval rate

Read the prevention rules carefully. These are patterns that failed before — follow them.

### Step 2: Do your work

Complete the task as normal. Keep track of what you did and whether it worked.

### Step 3: Capture feedback

Call the `capture_feedback` MCP tool:

**If succeeded:**
- signal: `up`
- context: What worked and why
- tags: Category labels

**If failed:**
- signal: `down`
- context: What you were trying to do
- whatWentWrong: Specific failure description
- whatToChange: How to avoid this next time
- tags: Category labels

Vague feedback like "it failed" will be rejected. Be specific.

### Step 4: Check improvement (optional)

Call the `feedback_stats` MCP tool to see approval rate, top failure domains, and whether the agent is trending better or worse.

## Available MCP Tools

| Tool | What it does |
|------|-------------|
| `recall` | Search past feedback and prevention rules for current task |
| `capture_feedback` | Record what worked or failed with structured context |
| `prevention_rules` | View auto-generated rules from repeated mistakes |
| `feedback_stats` | Approval rate, trend analysis, top failure domains |
| `feedback_summary` | Human-readable summary of recent signals |

## MCP Profiles

| Profile | Tools | Use case |
|---------|-------|----------|
| `essential` | 5 core tools | Default — start here |
| `commerce` | 6 tools + commerce_recall | Agentic commerce agents |
| `default` | 12 tools | Full pipeline including DPO export |

Set profile: `THUMBGATE_MCP_PROFILE=essential npx thumbgate serve`

## How Prevention Rules Work

1. Agent makes mistake A → you capture `down` feedback
2. Agent makes mistake A again → you capture `down` feedback again
3. System detects pattern → auto-generates prevention rule: "NEVER do A"
4. Next session → `recall` returns the rule → agent follows it

This is the core value. The agent doesn't learn — but it reads the rules and follows them.

## Links

- [GitHub](https://github.com/IgorGanapolsky/thumbgate)
- [npm](https://www.npmjs.com/package/thumbgate)
- [MCP Registry](https://registry.modelcontextprotocol.io)


---
Source attribution: IgorGanapolsky
Original project: https://github.com/IgorGanapolsky/mcp-memory-gateway/blob/076a3526e4cd12175bb9292ce85747824a5f033f/skills/agent-memory/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 Igor Ganapolsky

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: IgorGanapolsky
Original project: https://github.com/IgorGanapolsky/mcp-memory-gateway/blob/076a3526e4cd12175bb9292ce85747824a5f033f/skills/agent-memory/SKILL.md
Attribution basis: Source repository record

Fields of work: Data & Analytics, Development & Engineering, Product Management
Roles: Data Scientist, ML / AI Engineer, Technical Product Manager
Specialties: API, Backend, Git
Tools: Mcp Memory Gateway
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 8433989a40516657cdaa84f861890dbe71c3ceeb66dba69e10b03c7803deab7f
