---
title: Hindsight
description: Recall relevant context before every turn and retain each exchange automatically.
type: extension
keywords:
  - memory
  - long-term memory
  - automatic recall
  - retention
  - user profile
  - context
  - Hindsight Cloud
  - self-hosted
  - Vectorize
---

# Hindsight

Extension integration for eve. Recall relevant context before every turn and retain each exchange automatically.

## Install

Install Hindsight memory for eve:

```bash
eve add extension/hindsight
```

This installs `@vectorize-io/hindsight-eve` and writes `agent/instructions/hindsight.ts` for recall plus `agent/hooks/hindsight.ts` for retention. The package requires Node.js 24 or later.

## Quick start

Create a Hindsight Cloud API key and add it to the agent's environment. The API URL defaults to Hindsight Cloud, and the bank defaults to `default`:

```bash title=".env.local"
HINDSIGHT_API_KEY=...
HINDSIGHT_BANK_ID=my-agent
```

The registry creates both capability files:

```ts title="agent/instructions/hindsight.ts"
import { hindsightMemory } from "@vectorize-io/hindsight-eve";

export default hindsightMemory();
```

```ts title="agent/hooks/hindsight.ts"
import { hindsightRetainHook } from "@vectorize-io/hindsight-eve";

export default hindsightRetainHook();
```

Before each turn, the dynamic instructions resolver recalls the user's ambient profile and working context. After the turn, the hook retains the user message and assistant reply. Neither path depends on the model choosing to call a tool.

## Configure

Recall uses a fixed broad query rather than the live user message. Tune the profile context and response budget in the instructions file when needed:

```ts title="agent/instructions/hindsight.ts"
import { hindsightMemory } from "@vectorize-io/hindsight-eve";

export default hindsightMemory({
  recallQuery: "user preferences, identity, projects, and working context",
  budget: "high",
  maxTokens: 2048,
});
```

For a self-hosted server, set `HINDSIGHT_API_URL` and pass `apiKey: null` to both factories when the server has no authentication. Other shared options include `bankId`, `context`, `includeAssistantReply`, `timeoutMs`, and `onError`.

A bank is one isolated memory store, and both files must use the same bank. Do not share the default bank across untrusted users; use separate agent deployments with distinct `HINDSIGHT_BANK_ID` values for separate users or tenants. See the [Hindsight eve integration guide](https://hindsight.vectorize.io/sdks/integrations/eve) for Cloud, self-hosted, and factory configuration.

[Read the full extension documentation](https://hindsight.vectorize.io/sdks/integrations/eve)

---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/llms.txt](/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/agents.md](/agents.md)