← Catalog

@ersintarhan/pi-hindsight-memory

Minimal Hindsight memory for pi: retain/recall/reflect tools plus one project-scoped recall per session. No session export.

Extension

Install

Install with PiG

pig install npm:@ersintarhan/pi-hindsight-memory

Install with Pi

pi install npm:@ersintarhan/pi-hindsight-memory
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.2 (README.md). PiG does not review it.

pi-hindsight-memory

Minimal Hindsight memory for pi.

  • hindsight_retain: the agent stores durable facts explicitly. It is always available.
  • hindsight_recall: search memory. Results are scoped to the current project by default; pass allProjects: true to search everything.
  • hindsight_reflect: an LLM-synthesized answer over memories. It is slow; use it for "what did we decide about X" questions.
  • Auto recall runs once, on the first prompt of a session. It is scoped to the current project and persisted as a message, so it is written once and then served from prompt cache.

No session export: only what the agent explicitly retains is sent to Hindsight.

Install

pi install git:github.com/ersintarhan/pi-hindsight-memory

Config

Put the API key in the HINDSIGHT_API_TOKEN environment variable. An apiKey field in the config file overrides it.

Create ~/.pi/agent/hindsight-memory.json:

{
  "apiUrl": "https://your-hindsight",
  "bankId": "default",
  "tags": ["harness:pi", "user:me"],
  "observationScopes": [["user:me"], ["{project}"]],
  "stacks": ["~/Projects/my-stack"],
  "autoRecall": true,
  "autoRecallMaxTokens": 1024
}

The project name is the git repository name (worktree-safe), or the cwd basename outside git. Every memory is tagged project:<name>, session:<id> and store_method:tool. In observation scopes, {project} expands to project:<name>.

Stacks

A stack is a non-git directory that holds several repos, for example a planner agent running in ~/Projects/my-stack with workers in ~/Projects/my-stack/<repo> or in worktrees of those repos.

cwdtags on retainrecall filter
stack rootproject:my-stack, stack:my-stackproject:my-stack or stack:my-stack (stack-level memories plus every repo's memories)
repo or worktree inside the stackproject:<repo>, stack:my-stackproject:<repo> or project:my-stack (the repo's own memories plus stack-level memories)