---
name: Mneme Recap
description: Hourly / daily recap of every MetaMask Agentic Wallet trade — pulls from the same events table, summarizes via Mneme's schema-aware Claude.
var: "time window (e.g. 'today', '24h', 'this week')"
tags: [memory, mneme, recap, post-trade]
---

> **${var}** — Recap window. Free text. Examples: `today`, `24h`, `this week`, `last 7 days`. Defaults to `24h` if empty.

## Goal

End each day with a coherent recap of what your agent did. Not a raw log dump — a synthesis. Mneme's `/chat` endpoint sees every executed mandate (event row) + every memory you've written + every dream the worker produced, so it can write a recap that's grounded rather than hallucinated.

## Steps

### 1. Auth check

```bash
if [ -z "$MNEME_API_KEY" ]; then echo "MNEME_API_KEY not set"; exit 1; fi
GATEWAY="${MNEME_GATEWAY:-https://gateway.mnemedb.dev}"
```

### 2. Normalize the window

Convert `${var}` to a Postgres-friendly interval:

| Input | Maps to |
| --- | --- |
| `today` / `24h` / `1d` / empty | `interval '24 hours'` |
| `48h` / `2d` | `interval '48 hours'` |
| `this week` / `7d` / `week` | `interval '7 days'` |
| `month` / `30d` | `interval '30 days'` |

### 3. Pull trade count + raw events for context

```bash
COUNT=$(curl -sS -X POST "$GATEWAY/v1/sql" \
  -H "Authorization: ApiKey $MNEME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"SELECT count(*) AS n FROM events WHERE kind = '\''metamask_trade'\'' AND created_at > now() - interval '\''24 hours'\''","params":[]}' \
  | jq -r '.rows[0].n')
```

(Substitute the interval matched in step 2.)

### 4. Ask Mneme `/chat` — schema + stream + dream aware

```bash
PROMPT="recap my last $WINDOW: list the metamask_trade event rows in events table, group by intent.from_token → to_token, surface notable wins/losses, flag any mandate that triggered but failed, and end with one sentence on what tomorrow's open question is. terminal-friendly format, no markdown headers."

curl -sS -X POST "$GATEWAY/v1/llm/chat" \
  -H "Authorization: ApiKey $MNEME_API_KEY" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --arg p "$PROMPT" '{prompt: $p}')" \
  | jq -r '.reply'
```

### 5. Output

```
[recap · last $WINDOW]
  $COUNT trades

  <Mneme /chat synthesis here>
```

Pipe through your notification channel (Telegram / Discord / Slack) if your CLI has one.

## Why this skill is non-trivial

Most "daily brief" skills are LLM hallucinations dressed up as facts. This one is grounded — Mneme `/chat` sees the actual `events` table, the active streams, and the last 3 dreams the worker wrote. It can't make up trades you didn't make.

## Notes

- For longer windows (30d+) the prompt may exceed context. Consider chunking by week and asking `/chat` to fold the summaries.
- If you want the recap to be available for later querying, pipe it back into Mneme: `POST /v1/rows/memories` with the summary text.
- Pair with a cron / chain (`schedule: "0 22 * * *"` for 10pm daily) for an unattended end-of-day brief.
