Skip to content
Back to skills

Tanstack Ai Memory Hindsight

ASecurity

Use when wiring hindsight() from @tanstack/ai-memory/hindsight — a hosted memory adapter that buckets memory per conversation and exposes retain/recall/reflect tools to the model. Requires the optional @vectorize-io/hindsight-client peer.

  • 3,166 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 2, 2026
ai-agents

Works with

  • cli

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add TanStack/ai --skill tanstack-ai-memory-hindsight --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tanstack Ai Memory Hindsight?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tanstack Ai Memory Hindsight
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tanstack-tanstack-ai-memory-hindsight/badge)](https://www.skillsdirectory.com/skills/tanstack-tanstack-ai-memory-hindsight)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tanstack-ai-memory-hindsight
description: Use when wiring hindsight() from @tanstack/ai-memory/hindsight — a hosted memory adapter that buckets memory per conversation and exposes retain/recall/reflect tools to the model. Requires the optional @vectorize-io/hindsight-client peer.
---

# Hindsight Memory Adapter

Hosted `recall`/`save` adapter backed by Hindsight. Hindsight owns extraction and
ranking server-side, buckets memory into per-conversation "banks"
(`{tenantId|_}__{user}__{threadId}`), and — uniquely — exposes LLM **tools** through `recall` so the
model can retain/recall/reflect directly.

## Setup

```ts
import { memoryMiddleware } from '@tanstack/ai-memory'
import { hindsight } from '@tanstack/ai-memory/hindsight'

// Build per request from the server-validated session — never from req.body.
function memoryFor(session: { userId: string; threadId: string }) {
  const memory = hindsight({ user: session.userId }) // baseUrl defaults to HINDSIGHT_URL

  return memoryMiddleware({
    adapter: memory,
    scope: { threadId: session.threadId, userId: session.userId },
  })
}
```

`@vectorize-io/hindsight-client` is an **optional peer dependency**, loaded lazily on
first use — install it where you use `hindsight()`.

## Options

- `user` — durable user id for the bank key (falls back to `scope.userId`).
- `baseUrl` — Hindsight server URL (default `HINDSIGHT_URL` or `http://localhost:8888`).
- `budget` — recall budget: `'low' | 'mid' | 'high'` (default `'mid'`).
- `onToolRetain` / `onToolRecall` — callbacks fired when the model uses the memory tools.

**Scope fields:** bank id is `{tenantId|_}__{user}__{threadId}`. `namespace` is ignored.

## Tools

`recall` returns `hindsight_retain`, `hindsight_recall`, and `hindsight_reflect` in its
`tools` plus a `toolGuidance` block. `memoryMiddleware` merges them into the run so the
model can manage long-term memory itself.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.