- Update version to 0.4.14 in all components - Regenerate OpenAPI spec and client SDKs - Python packages: hindsight-api, hindsight-dev, hindsight-all, hindsight-litellm, hindsight-crewai, hindsight-embed - Python client: hindsight-clients/python - TypeScript client: hindsight-clients/typescript - Rust CLI: hindsight-cli - Control Plane: hindsight-control-plane - OpenClaw integration: hindsight-integrations/openclaw - AI SDK integration: hindsight-integrations/ai-sdk - Chat SDK integration: hindsight-integrations/chat - Helm chart - Sync documentation to version-0.4 |
||
|---|---|---|
| .. | ||
| src | ||
| .gitignore | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| vitest.config.ts | ||
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
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