hindsight
FreeNo executable scriptsNot checkedHindsight is a self-hosted agent memory server: an agent stores facts with retain, searches them with recall, and asks for reasoned answers over them with…
by TerminalSkills★ 221 GitHub starsAbout this skill
Hindsight — Memory Server for Agents That Learn
Overview
Hindsight is a memory service for AI agents. You run a server (Docker, pip, or Helm), and agents talk to it through a Python, Node.js or Go client, a REST API, or a built-in MCP endpoint. Everything lives in banks: strictly isolated stores, typically one per user, agent or project.
Three operations do the work:
- retain pushes text in. The server uses its configured LLM to extract facts, entities, relationships and dates.
- recall searches a bank with semantic, keyword (BM25), graph and temporal strategies in parallel, merges and reranks, and trims to a token budget.
- reflect answers a question by reasoning over the bank, not just returning matches. Facts are consolidated in the background into observations and mental models.
The server needs an LLM key for extraction and reflection, and PostgreSQL with a vector extension (the Docker image and the pip package embed one for development). The README includes benchmark claims; this skill does not rely on them.
Choose Hindsight when you want a standalone memory service shared by several agents or users. For a simple file-based memory inside one project, the agent-memory skill is lighter.
Instructions
Run the server in Docker
export OPENAI_API_KEY="$(cat ~/.secrets/openai-key)" # create at platform.openai.com/api-keys
docker run -d --name hindsight --restart unless-stopped \
-p 127.0.0.1:8888:8888 -p 127.0.0.1:9999:9999 \
-e HINDSIGHT_API_LLM_API_KEY="$OPENAI_API_KEY" \
-v hindsight-data:/home/hindsight/.pg0 \
ghcr.io/vectorize-io/hindsight:latest
The API listens on http://127.0.0.1:8888 and the web UI on http://127.0.0.1:9999. The README's example omits the 127.0.0.1 prefix, which would publish both ports on every network interface; keep it unless you have put authentication in front.
Other providers use HINDSIGHT_API_LLM_PROVIDER (for example openai, anthropic, gemini, groq, ollama), with HINDSIGHT_API_LLM_MODEL and HINDSIGHT_API_LLM_BASE_URL for a custom endpoint. Pass them as extra -e flags.
Check the container is up:
docker logs --tail 20 hindsight
Run the server with pip instead
python3 -m venv .venv
.venv/bin/pip install hindsight-api
export HINDSIGHT_API_LLM_PROVIDER=openai
export HINDSIGHT_API_LLM_API_KEY="$OPENAI_API_KEY"
.venv/bin/hindsight-api --host 127.0.0.1 --port 8888
hindsight-api accepts --host, --port (default 8888) and --workers. Use hindsight-api-slim when you supply your own embeddings, reranker and database (needed on Intel Macs).
For a throwaway in-process server in a script, pip install hindsight-all provides HindsightServer and HindsightClient (from hindsight import HindsightServer, HindsightClient); the server is a context manager and server.url gives its address.
Install the client
.venv/bin/pip install -U hindsight-client
Node.js: npm install @vectorize-io/hindsight-client, then new HindsightClient({ baseUrl }) with client.retain(bankId, content) and client.recall(bankId, query).
Retain, recall, reflect from Python
from hindsight_client import Hindsight
client = Hindsight(base_url="http://127.0.0.1:8888")
client.retain(
bank_id="user-4812",
content="Marta moved the Lisbon offsite to 14 March and wants vegetarian catering.",
context="planning chat",
timestamp="2026-10-12T09:30:00Z",
tags=["offsite", "catering"],
)
found = client.recall(bank_id="user-4812", query="What does Marta need for the offsite?")
for item in found.results:
print(item.type, item.text)
answer = client.reflect(bank_id="user-4812", query="What should I keep in mind when booking for Marta?")
print(answer.text)
Verified signatures (hindsight-client 1.1.0):
retain(bank_id, content, timestamp=None, context=None, document_id=None, metadata=None, tags=None, retain_async=False, ...).recall(bank_id, query, types=None, max_tokens=4096, budget="mid", tags=None, tags_match="any", ...)returns an object whoseresultshavetext,type,tags,context,occurred_start.reflect(bank_id, query, budget="low", context=None, max_tokens=None, tags=None, include_facts=False, ...)returns an object withtext;based_onis filled only wheninclude_facts=True.retain_batch(bank_id, items, document_id=None, retain_async=False)takes a list of dicts, one per memory.- Async variants carry an
aprefix:aretain,arecall,areflect.
Create a bank with a mission
Banks are created on first use, but you can set their purpose and behavior up front:
client.create_bank(
bank_id="support-agent",
name="Support agent memory",
mission="Remember customer environments, recurring failures and what fixed them.",
)
Other create_bank parameters include disposition_skepticism, disposition_literalism, disposition_empathy, enable_observations and `reflect_missio
Install hindsight in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the hindsight skill do?
Hindsight is a self-hosted agent memory server: an agent stores facts with retain, searches them with recall, and asks for reasoned answers over them with reflect, per isolated memory bank. Use when an agent or chatbot must remember users and projects across sessions, or when asked to "set up Hindsight", "retain and recall memories", "add per-user memory banks", "run a memory server for my agent", or "connect an MCP client to Hindsight memory".
How do I install the hindsight skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the hindsight skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
by Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
by Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
by Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
by Anthropic