跳到主要内容

快速开始

本指南将引导你完成 Hindsight Cloud 账户的设置,并创建你的第一个记忆库。

前置条件

  • 一个 Hindsight Cloud 账户(在 ui.hindsight.vectorize.io 注册)
  • 对 REST API 有基本了解,或熟悉 Python/TypeScript

第 1 步:注册并登录

  1. 访问 ui.hindsight.vectorize.io
  2. 点击 Sign Up 创建账户
  3. 验证你的邮箱地址
  4. 登录以进入仪表盘

第 2 步:创建组织

首次登录时,系统会提示你创建一个组织。组织是所有资源的顶层容器:

  • 记忆库
  • 团队成员
  • API 密钥
  • 账单信息

输入组织名称,然后点击 Create

第 3 步:创建你的第一个记忆库

  1. 在仪表盘中点击 Create Memory Bank
  2. 为记忆库输入名称(例如 "My AI Assistant")

第 4 步:获取 API 密钥

  1. 点击顶部导航栏的 Connect 按钮
  2. 点击 Create API Key
  3. 为密钥起一个有描述性的名称
  4. 选择过期时间(或选择 "Never")
  5. 重要:立即复制你的 API 密钥——它不会再次显示!

第 5 步:发起你的第一次 API 调用

pip install hindsight-client
from hindsight_client import Hindsight

client = Hindsight(
base_url="https://api.hindsight.vectorize.io",
api_key="your-api-key"
)

# Create a memory bank
bank = client.create_bank(
bank_id="my-assistant",
name="My Assistant"
)

# Store a memory
client.retain(
bank_id="my-assistant",
content="The user's name is Alice and she prefers Python."
)

# Retrieve relevant memories
result = client.recall(
bank_id="my-assistant",
query="What is the user's name?"
)

for memory in result.results:
print(memory.text)

# Create a mental model - a pre-computed reflection that stays current
result = client.create_mental_model(
bank_id="my-assistant",
name="User Profile",
source_query="What do we know about this user?"
)
print(f"Creating mental model (operation: {result.operation_id})")

# List mental models
models = client.list_mental_models(bank_id="my-assistant")
for m in models.items:
print(f"{m.name}: {m.content}")

client.close()

后续步骤