CtrlK
BlogDocsLog inGet started
Tessl Logo

tanstack-ai-memory-hindsight

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.

80

Quality

100%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Low

Low-risk findings worth noting

SKILL.md
Quality
Evals
Security

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

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

const memory = hindsight({ user: currentUserId }) // baseUrl defaults to HINDSIGHT_URL

memoryMiddleware({ adapter: memory, scope })

@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.

Repository
TanStack/ai
Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.