Overview
Hindsight is an agent memory system from Vectorize. Where most memory layers concentrate on replaying conversation history, Hindsight is built around the idea that an agent should form durable understanding: memories are pushed through an extraction pipeline and consolidated into evidence-backed beliefs the agent can act on later.
It organizes what it stores into four kinds of memory. World facts describe the world ("the stove gets hot"), experiences record what the agent itself did, observations are consolidated beliefs formed from many memories, and mental models are the synthesized understanding built on top. Memories live in named banks, and recall runs four retrieval strategies in parallel — semantic vector similarity, BM25 keyword matching, entity and temporal graph links, and time-range filtering.
You run it as a server (Docker, pip, Helm, or the managed Hindsight Cloud) and talk to it from Python, Node.js, Go, a CLI, or the REST API. Every server also exposes a Model Context Protocol endpoint per bank, so any MCP client can call retain, recall, and reflect as tools. The code is MIT-licensed; the project reports state-of-the-art results on the LongMemEval benchmark and publishes live benchmark numbers.
What it does
- Four memory types — world facts, experiences, consolidated observations, and synthesized mental models — instead of a flat conversation log
- Three operations: retain to store, recall to retrieve, and reflect to answer with the memory applied
- Parallel retrieval across semantic, keyword (BM25), graph, and temporal strategies
- An LLM wrapper that adds memory to an existing OpenAI or Anthropic client in about two lines, plus 60+ framework and app integrations
- A built-in MCP endpoint per memory bank, so MCP clients get retain/recall/reflect as tools
- Works with 25+ LLM providers, including fully local ones (Ollama, LM Studio, llama.cpp) and any OpenAI-compatible endpoint
- Deploy with Docker, pip, Helm, an embedded Python server with no separate process, or the managed cloud
Getting started
Start a server, then connect a client in your language. Docker is the recommended path; the embedded Python option skips the server entirely for local experiments.
Start a server with Docker
The API listens on 8888 and a UI on 9999. Point HINDSIGHT_API_LLM_API_KEY at whichever provider you want Hindsight to use for extraction and consolidation.
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:latestOr install it bare metal
The server is also a pip package if you would rather not use Docker.
pip install hindsight-api
export HINDSIGHT_API_LLM_API_KEY=sk-xxx
hindsight-apiConnect a client
Clients exist for Python, Node.js/TypeScript, Go, and the command line.
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 # GoRetain, recall, reflect
Store something, search it back, then ask Hindsight to answer with the memory applied. Memories are scoped to a bank id.
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 a disposition-aware response
client.reflect(bank_id="my-bank", query="Tell me about Alice")Add memory to an existing agent
The LLM wrapper recalls relevant memories before each call and retains the conversation after it, with no other changes to your code. wrap_anthropic() does the same for the Anthropic SDK.
pip install hindsight-litellmWrap your client
Swap the client you already have for a wrapped one and pass the bank you want the memories to land in.
from openai import OpenAI
from hindsight_litellm import wrap_openai
client = wrap_openai(
OpenAI(),
bank_id="user-123",
hindsight_api_url="http://localhost:8888",
)
response = client.chat.completions.create(
model="gpt-5-mini",
messages=[{"role": "user", "content": "What do you know about me?"}],
)Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Give an assistant memory that survives sessions, so it recalls a user's facts, preferences, and history without re-prompting
- Let a long-running agent accumulate its own experiences and act on what previously worked or failed
- Give a CLI coding agent per-repository memory built from git history and past sessions
- Expose a shared memory bank to several tools at once through the MCP endpoint
How Hindsight compares
Hindsight alongside other open-source agent memory tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Claude-Mem | ★ 93.6k | Persistent memory layer for coding agents: it captures what an agent does during a session, compresses it into semantic summaries, and injects the relevant parts back into later sessions. |
| Mem0 | ★ 65.1k | A memory layer that you add to existing LLM agents to extract, store, and recall user facts and preferences across sessions using vector, graph, and key-value backends. |
| MemPalace | ★ 59k | Local-first agent memory that stores conversations verbatim instead of summarising them, with a structured palace index, pluggable vector backends and an MCP server. |
| OpenViking | ★ 36.5k | A context database that stores an agent's memories, resources, and skills as one browsable viking:// filesystem with three-tier (abstract/overview/details) on-demand loading. |
| Graphiti | ★ 30.8k | A library that builds a temporal knowledge graph from an agent's conversations and data so facts can be tracked and queried as they change over time. |
| Cognee | ★ 30.6k | A graph-native memory engine that turns raw documents and conversations into a queryable knowledge graph for agents that need to build lasting knowledge. |
| Supermemory | ★ 29.6k | A memory and context engine that ingests information across tools and sessions and can run fully locally, acting as a second brain for AI applications. |
| Hindsight | ★ 23.4k | An agent memory server built so agents learn, not just recall chat history |