vectorize-io hindsight
文档 • 集成 • 实战手册 • 基准测试 • 论文 • Hindsight Cloud
什么是 Hindsight?
Hindsight™ 是一个 agent 记忆系统,旨在打造能够随时间学习的更智能的 agent。大多数 agent 记忆系统专注于回忆对话历史。Hindsight 专注于让 agent 学会学习,而不仅仅是记忆。
hindsight-learning-demo.mp4
它消除了 RAG 和知识图谱等替代技术的缺陷,在长期记忆任务上实现了最先进的性能。
目录
- 记忆性能与准确率
- 快速开始 — 服务端 · 客户端 · 平台 · 嵌入式
- 将 Hindsight 添加到你的 Agent — LLM 封装 · 集成 · 编码 agent · MCP
- 核心概念 — 记忆类型 · 保留 / 回忆 / 反思 · 观察 · 心智模型与知识页面 · 记忆库
- 使用场景
- 生产环境运行
- 资源
记忆性能与准确率
根据基准测试性能,Hindsight 是迄今为止测试过的最准确的 agent 记忆系统。它在 LongMemEval 基准测试上达到了最先进的性能,该基准被广泛用于评估记忆系统在各种对话式 AI 场景中的表现。
以下是截至 2026 年 1 月 Hindsight 及其他 agent 记忆方案的当前报告性能:
实时、持续更新的结果——包括各模型的准确率、延迟和成本——发布在 benchmarks.hindsight.vectorize.io。
Hindsight 的基准测试性能数据已由弗吉尼亚理工大学 Sanghani 人工智能与数据分析中心以及《华盛顿邮报》的研究合作者独立复现。其他分数由软件供应商自行报告。
Hindsight 正在财富 500 强企业和越来越多的 AI 初创公司的生产环境中使用。
🤖 使用编码 agent?安装 Hindsight 文档技能,在编码时即时访问文档:
npx skills add https://github.com/vectorize-io/hindsight --skill hindsight-docs
兼容 Claude Code、Cursor 及其他 AI 编码助手。
快速开始
1. 启动服务端
Docker(推荐)
export OPENAI_API_KEY=sk-xxx
docker run -it --pull always --name hindsight --restart unless-stopped -p 8888:8888 -p 9999:9999 \
-e HINDSIGHT_API_LLM_API_KEY=$OPENAI_API_KEY \
-v hindsight-data:/home/hindsight/.pg0 \
ghcr.io/vectorize-io/hindsight:latest
API:http://localhost:8888 UI:http://localhost:9999
Hindsight 通过 HINDSIGHT_API_LLM_PROVIDER 支持 25+ LLM 提供商——托管服务(openai、anthropic、gemini、groq、bedrock、vertexai、minimax、deepseek、atlas、meta、……)、完全本地(ollama、lmstudio、llamacpp)、任何 OpenAI 兼容端点,以及可触达其余服务的网关(litellm、litellmrouter)。现有订阅也可使用:openai-codex(ChatGPT Plus/Pro)、claude-code(Claude Pro/Max)、cursor(Cursor)和 github-copilot(GitHub Copilot)无需 API key。参见支持的模型。
Docker(外部 PostgreSQL)
export OPENAI_API_KEY=sk-xxx
export HINDSIGHT_DB_PASSWORD=choose-a-password
cd docker/docker-compose
docker compose up
Oracle AI Database 也支持企业部署,功能完全对等。详见存储文档。
裸机(pip)
pip install hindsight-api
export HINDSIGHT_API_LLM_API_KEY=sk-xxx
hindsight-api
Kubernetes(Helm)
helm install hindsight oci://ghcr.io/vectorize-io/charts/hindsight \
--set api.llm.provider=openai \
--set api.llm.apiKey=sk-xxx \
--set postgresql.enabled=true
托管(无需服务端)
Hindsight Cloud 是托管选项:自动扩展的托管基础设施,外加仪表盘、备份、团队协作和 99.9% 正常运行时间 SLA。计费基于用量,提供免费额度起步——无固定月费或按席位收费。将任何客户端指向 https://api.hindsight.vectorize.io 并附上你的 API key,即可完全跳过部署。
比较自托管、Cloud 和 Enterprise → · 注册 →
所有选项,包括 Windows 和空气隔离环境,均在安装指南中涵盖。
2. 连接客户端
pip install hindsight-client -U # Python
npm install @vectorize-io/hindsight-client # Node.js / TypeScript
go get github.com/vectorize-io/hindsight/hindsight-clients/go # Go
curl -fsSL https://hindsight.vectorize.io/get-cli | bash # CLI
Python
from hindsight_client import Hindsight
client = Hindsight(base_url="http://localhost:8888")
# Retain: Store information
client.retain(bank_id="my-bank", content="Alice works at Google as a software engineer")
# Recall: Search memories
client.recall(bank_id="my-bank", query="What does Alice do?")
# Reflect: Generate disposition-aware response
client.reflect(bank_id="my-bank", query="Tell me about Alice")
Node.js / TypeScript
const { HindsightClient } = require('@vectorize-io/hindsight-client');
const main = async () => {
const client = new HindsightClient({ baseUrl: 'http://localhost:8888' });
await client.retain('my-bank', 'Alice loves hiking in Yosemite');
const results = await client.recall('my-bank', 'What does Alice like?');
console.log(results);
}
main();
完整参考:Python · Node.js · Go · CLI · REST API
支持平台
| 平台 | Docker | 裸机(pip) | 嵌入式 DB(pg0) | |------|--------|------------|-----------------| | Linux(x86_64、ARM64) | ✅ | ✅ | ✅ | | macOS(Apple Silicon / arm64) | ✅ | ✅ | ✅ | | macOS(Intel / x86_64) | ✅ | ⚠️ | ✅ | | Windows(x86_64) | ✅ | ✅ | ✅ |
⚠️ Intel Mac:使用 hindsight-all-slim——详见安装指南。
Python 嵌入式(无需服务端)
pip install hindsight-all -U
在 Intel(x86_64)Mac 上,请安装 hindsight-all-slim——参见支持平台。
import os
from hindsight import HindsightServer, HindsightClient
with HindsightServer(llm_provider="openai", llm_model="gpt-5-mini", llm_api_key=os.environ["OPENAI_API_KEY"]) as server:
client = HindsightClient(base_url=server.url)
client.retain(bank_id="my-bank", content="Alice works at Google")
results = client.recall(bank_id="my-bank", query="Where does Alice work?")
Node.js 等价方案和守护进程 CLI 也