fleet-memory/hindsight-integrations/ai-sdk
Derek Bouius 3b9d2db091
security: bump vite across integrations (high CVE fix) (#913)
* security: bump vite across integrations to patched versions

Fixes Dependabot alerts for vite transitive dev dependency:
- GHSA-v2wj-q39q-566r (high): server.fs.deny bypass with queries
- GHSA-p9ff-h696-f583 (high): related vite server vulnerability

Adds a `vite` entry to the npm `overrides` in each integration's
package.json to force the patched version (>=8.0.5). To make this
possible in ai-sdk, chat, and openclaw — which pinned vitest ^4.0.18
whose vite peer is `^6.0.0 || ^7.0.0` — the minor-compatible bump
vitest ^4.0.18 -> ^4.1.2 is also included. vitest 4.1.x supports
vite 8.x (peer: ^6 || ^7 || ^8), so all six integrations converge on
vite 8.x consistently.

paperclip had no overrides block; one was added.

Verified locally: `npm ci && npx vitest run` passes in all six
integrations (ai-sdk 23, chat 28, openclaw 66, opencode 89, paperclip 27,
nemoclaw 36 tests).

* chore: regenerate hindsight-docs skill

Picks up FAQ and best-practice sections added in #905 that were not
regenerated at merge time, so that `verify-generated-files` passes
for this branch.
2026-04-08 09:11:21 +02:00
..
src feat: improve ai sdk tools (#394) 2026-02-18 13:06:03 +01:00
tests feat(typescript-client): Deno compatibility (#607) 2026-03-18 14:25:35 +01:00
.gitignore feat: ai sdk integration (#299) 2026-02-04 20:25:59 +01:00
deno.json feat(typescript-client): Deno compatibility (#607) 2026-03-18 14:25:35 +01:00
deno.lock feat(typescript-client): Deno compatibility (#607) 2026-03-18 14:25:35 +01:00
package-lock.json security: bump vite across integrations (high CVE fix) (#913) 2026-04-08 09:11:21 +02:00
package.json security: bump vite across integrations (high CVE fix) (#913) 2026-04-08 09:11:21 +02:00
README.md docs: add AI SDK integration documentation (#304) 2026-02-05 17:05:18 +01:00
tsconfig.json feat: ai sdk integration (#299) 2026-02-04 20:25:59 +01:00
tsup.config.ts feat(typescript-client): Deno compatibility (#607) 2026-03-18 14:25:35 +01:00
vitest.config.ts feat: ai sdk integration (#299) 2026-02-04 20:25:59 +01:00

Hindsight Memory Integration for Vercel AI SDK

Give your AI agents persistent, human-like memory using Hindsight with the Vercel AI SDK.

Quick Start

npm install @vectorize-io/hindsight-ai-sdk @vectorize-io/hindsight-client ai zod
import { HindsightClient } from '@vectorize-io/hindsight-client';
import { createHindsightTools } from '@vectorize-io/hindsight-ai-sdk';
import { generateText } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';

// 1. Initialize Hindsight client
const hindsightClient = new HindsightClient({
  apiUrl: 'http://localhost:8000',
});

// 2. Create memory tools
const tools = createHindsightTools({ client: hindsightClient });

// 3. Use with AI SDK
const result = await generateText({
  model: anthropic('claude-sonnet-4-20250514'),
  tools,
  system: `You have long-term memory. Use:
  - 'recall' to search past conversations
  - 'retain' to remember important information
  - 'reflect' to synthesize insights from memories`,
  prompt: 'Remember that Alice loves hiking and prefers spicy food',
});

console.log(result.text);

Features

Three Memory Tools: retain (store), recall (retrieve), and reflect (reason over memories) AI SDK 6 Native: Works with generateText, streamText, and ToolLoopAgent Multi-User Support: Dynamic bank IDs per call for multi-user scenarios Type-Safe: Full TypeScript support with Zod schemas Flexible Client: Works with the official TypeScript client or custom HTTP clients

Documentation

📖 Full Documentation

The complete documentation includes:

  • Detailed tool descriptions and parameters
  • Advanced usage patterns (streaming, multi-user, ToolLoopAgent)
  • HTTP client example (no dependencies)
  • TypeScript types and API reference
  • Best practices and system prompt examples

Running Hindsight Locally

# Install and run with embedded mode (no setup required)
uvx hindsight-embed@latest -p myapp daemon start

# The API will be available at http://localhost:8000

Examples

Full examples are available in the GitHub repository.

Support

License

MIT