hindsight-self-hosted

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Hindsight Memory Skill (Self-Hosted)

自托管Hindsight记忆Skill

You have persistent memory via a self-hosted Hindsight server. This memory bank can be shared with the team, so knowledge stored here benefits everyone working on this codebase.
Proactively store team knowledge and recall context to provide better assistance.
你可以通过自托管Hindsight服务器获得持久化记忆。这个记忆库可以与团队共享,因此存储在此的知识将惠及所有参与该代码库工作的成员。
主动存储团队知识并调取上下文信息,以提供更优质的协助。

Setup Check (First-Time Only)

配置检查(仅首次使用)

Before using memory commands, verify the Hindsight CLI is configured:
bash
cat ~/.hindsight/config
If the file doesn't exist or is missing credentials, help the user set it up:
  1. Install the CLI (if
    hindsight
    command not found):
    bash
    curl -fsSL https://hindsight.vectorize.io/get-cli | bash
  2. Create the config file - ask the user for:
    • API URL: Their self-hosted Hindsight server URL (e.g.,
      https://hindsight.mycompany.com
      )
    • API Key: Their authentication key
    bash
    mkdir -p ~/.hindsight
    cat > ~/.hindsight/config << 'EOF'
    api_url = "<user's server URL>"
    api_key = "<user's API key>"
    EOF
    chmod 600 ~/.hindsight/config
  3. Get the bank ID - ask the user for their bank ID (e.g.,
    team-myproject
    )
After setup, use the bank ID in all commands below.
使用记忆命令前,请确认Hindsight CLI已完成配置:
bash
cat ~/.hindsight/config
若该文件不存在或缺少凭证,请协助用户完成配置:
  1. 安装CLI(若未找到
    hindsight
    命令):
    bash
    curl -fsSL https://hindsight.vectorize.io/get-cli | bash
  2. 创建配置文件 - 向用户索要以下信息:
    • API URL:用户的自托管Hindsight服务器地址(例如:
      https://hindsight.mycompany.com
    • API Key:用户的认证密钥
    bash
    mkdir -p ~/.hindsight
    cat > ~/.hindsight/config << 'EOF'
    api_url = "<user's server URL>"
    api_key = "<user's API key>"
    EOF
    chmod 600 ~/.hindsight/config
  3. 获取存储库ID - 向用户索要其存储库ID(例如:
    team-myproject
配置完成后,在以下所有命令中使用该存储库ID。

Commands

命令

Replace
<bank-id>
with the user's actual bank ID (e.g.,
team-frontend
).
<bank-id>
替换为用户实际的存储库ID(例如:
team-frontend
)。

Store a memory

存储记忆

Use
memory retain
to store what you learn:
bash
hindsight memory retain <bank-id> "Project uses ESLint with Airbnb config and Prettier for formatting"
hindsight memory retain <bank-id> "Running tests requires NODE_ENV=test" --context procedures
hindsight memory retain <bank-id> "Build failed when using Node 18, works with Node 20" --context learnings
hindsight memory retain <bank-id> "Alice prefers verbose commit messages with context" --context preferences
使用
memory retain
命令存储你获取的知识:
bash
hindsight memory retain <bank-id> "Project uses ESLint with Airbnb config and Prettier for formatting"
hindsight memory retain <bank-id> "Running tests requires NODE_ENV=test" --context procedures
hindsight memory retain <bank-id> "Build failed when using Node 18, works with Node 20" --context learnings
hindsight memory retain <bank-id> "Alice prefers verbose commit messages with context" --context preferences

Recall memories

调取记忆

Use
memory recall
BEFORE starting tasks to get relevant context:
bash
hindsight memory recall <bank-id> "project conventions and coding standards"
hindsight memory recall <bank-id> "Alice preferences for this project"
hindsight memory recall <bank-id> "what issues have we encountered before"
hindsight memory recall <bank-id> "how does the auth module work"
在开展任务前,使用
memory recall
命令获取相关上下文:
bash
hindsight memory recall <bank-id> "project conventions and coding standards"
hindsight memory recall <bank-id> "Alice preferences for this project"
hindsight memory recall <bank-id> "what issues have we encountered before"
hindsight memory recall <bank-id> "how does the auth module work"

Reflect on memories

整合记忆

Use
memory reflect
to synthesize context:
bash
hindsight memory reflect <bank-id> "How should I approach this task based on past experience?"
使用
memory reflect
命令整合上下文信息:
bash
hindsight memory reflect <bank-id> "How should I approach this task based on past experience?"

IMPORTANT: When to Store Memories

重要提示:何时存储记忆

This is a shared team bank. Store knowledge that benefits the team. For individual preferences, include the person's name.
这是一个团队共享存储库。请存储对团队有帮助的知识。对于个人偏好,请标注对应的人员姓名。

Project/Team Conventions (shared)

项目/团队约定(共享)

  • Coding standards ("Project uses 2-space indentation")
  • Required tools and versions ("Project requires Node 20+, PostgreSQL 15+")
  • Linting and formatting rules ("ESLint with Airbnb config")
  • Testing conventions ("Integration tests require Docker running")
  • Branch naming and PR conventions
  • 编码规范(例如:“项目使用2空格缩进”)
  • 必备工具及版本要求(例如:“项目要求Node 20+、PostgreSQL 15+”)
  • 代码检查与格式化规则(例如:“采用Airbnb配置的ESLint”)
  • 测试约定(例如:“集成测试需要运行Docker”)
  • 分支命名与PR约定

Individual Preferences (attribute to person)

个人偏好(标注人员)

  • Personal coding style ("Alice prefers explicit type annotations")
  • Communication preferences ("Bob prefers detailed PR descriptions")
  • Tool preferences ("Carol uses vim keybindings")
  • 个人编码风格(例如:“Alice偏好显式类型注解”)
  • 沟通偏好(例如:“Bob偏好详细的PR描述”)
  • 工具偏好(例如:“Carol使用vim快捷键”)

Procedure Outcomes

任务执行结果

  • Steps that successfully completed a task
  • Commands that worked (or failed) and why
  • Workarounds discovered
  • Configuration that resolved issues
  • 成功完成任务的步骤
  • 有效(或无效)的命令及其原因
  • 发现的临时解决方案
  • 解决问题的配置方案

Learnings from Tasks

任务经验总结

  • Bugs encountered and their solutions
  • Performance optimizations that worked
  • Architecture decisions and rationale
  • Dependencies or version requirements
  • 遇到的Bug及其解决方案
  • 有效的性能优化方案
  • 架构决策及其依据
  • 依赖或版本要求

Team Knowledge

团队知识

  • Onboarding information for new team members
  • Common pitfalls and how to avoid them
  • Architecture decisions and their rationale
  • Integration points with external systems
  • Domain knowledge and business logic explanations
  • 新成员入职信息
  • 常见陷阱及规避方法
  • 架构决策及其依据
  • 与外部系统的集成点
  • 领域知识与业务逻辑说明

IMPORTANT: When to Recall Memories

重要提示:何时调取记忆

Always recall before:
  • Starting any non-trivial task
  • Making decisions about implementation
  • Suggesting tools, libraries, or approaches
  • Writing code in a new area of the project
  • When answering questions about the codebase
  • When a team member asks how something works
在以下场景务必先调取记忆
  • 启动任何非琐碎任务前
  • 做实现方案决策前
  • 推荐工具、库或实现方式前
  • 在项目新领域编写代码前
  • 回答关于代码库的问题时
  • 团队成员询问某功能的工作方式时

Best Practices

最佳实践

  1. Store immediately: When you discover something, store it right away
  2. Be specific: Store "npm test requires --experimental-vm-modules flag" not "tests need a flag"
  3. Include outcomes: Store what worked AND what did not work
  4. Recall first: Always check for relevant context before starting work
  5. Think team-first: Store knowledge that would help other team members
  6. Attribute individual preferences: Store "Alice prefers X" not just "User prefers X"
  7. Distinguish project vs personal: Project conventions apply to everyone; personal preferences are per-person
  1. 即时存储:发现有效信息后立即存储
  2. 内容具体:存储“npm test需要--experimental-vm-modules参数”而非“测试需要加参数”
  3. 包含结果:同时存储有效方案与无效方案
  4. 先调取再行动:开展工作前务必检查相关上下文
  5. 团队优先:存储对其他团队成员有帮助的知识
  6. 标注个人偏好:存储“Alice偏好X”而非仅“用户偏好X”
  7. 区分项目与个人:项目约定适用于所有人;个人偏好仅针对特定人员