selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Hindsight logo

Self-host Hindsight

v1.2.1

Agent memory layer that learns, not just recalls

ReleaseOpen SourceMIT
docker run -it --pull always --name hindsight --restart unless-stopped --shm-size=1g -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:latest
Updated3 hours ago
LanguagePython
Setup difficultyModerate
Stars
60 259
RAM
4GB RAM minimum (8GB recommended for production)
Ports
8888 (Hindsight API server (also serves the per-bank MCP endpoints)), 9999 (Control Plane web UI)
Requires
LLM provider, PostgreSQL
Docker
ghcr.io/vectorize-io/hindsight

What is Hindsight?

Hindsight is a memory server for AI agents: rather than only replaying chat history, it extracts facts, entities and time-linked relationships from whatever you feed it so an agent can search or reason over them later. Three core operations drive it — retain to store, recall to search, reflect to produce an answer grounded in stored memories — reachable through Python, TypeScript, Go and CLI clients, a REST API, and a per-bank MCP endpoint. Memories sit in isolated banks, usually one per user, agent or project, and a background worker consolidates duplicates into evidence-backed observations, standing mental models and wiki-style knowledge pages. Retrieval runs vector similarity, BM25 keyword search, entity-graph traversal and time-range filtering in parallel, then merges and reranks the hits. Operationally you can start a single container that bundles an embedded PostgreSQL, install it with pip, or use the Helm chart against your own PostgreSQL/pgvector store (an Oracle AI Database backend exists too); a Next.js control-plane UI runs alongside the API. An LLM is mandatory and 25+ hosted and local providers are supported. The server is MIT-licensed, with a usage-billed managed cloud and an enterprise tier beside the self-hosted option; the API has no authentication until you enable the built-in API-key tenant extension, and the UI can be gated with a shared access key.

Hindsight alternatives

All self-hosted alternatives to Neo4j-style knowledge graphs → All self-hosted alternatives to RAG systems →

Should you self-host Hindsight?

Hindsight scores 87/100 on selfhost.directory (how scoring works) and ranks #4 of 209 in AI Agents. It has 60 259 GitHub stars, +8 212 in the last 30 days.

It shipped 4 stable releases in the past year. The latest, v1.2.1, came out on 10 November 2026. New versions land roughly every 8 days.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is MIT-licensed and written mostly in Python.

Its closest alternative on selfhost.directory is Orca (91/100, 121 134 stars). It scores higher overall, so compare the two before you pick. See Hindsight vs Orca side by side.

Features

  • Control Plane web UI
  • Hybrid multi-strategy retrieval
  • Isolated memory banks
  • Knowledge pages
  • MCP Server
  • Mental models
  • Multilingual memories
  • Observation consolidation
  • Prometheus Metrics
  • Retain / recall / reflect memory operations
  • Secret and PII redaction (Memory Defense)opt-in
  • Tag and metadata filtering
  • Webhooks

Hindsight README


What is Hindsight?

Hindsight™ is an agent memory system built to create smarter agents that learn over time. Most agent memory systems focus on recalling conversation history. Hindsight is focused on making agents that learn, not just remember.

hindsight-learning-demo.mp4

How to install Hindsight

Install Hindsight with Docker

Environment variables
HINDSIGHT_API_LLM_API_KEY, HINDSIGHT_API_WORKER_ID
export OPENAI_API_KEY=sk-xxx
docker run -it --pull always --name hindsight --restart unless-stopped --shm-size=1g -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:latest

Single container with embedded PostgreSQL (pg0); API on 8888, UI on 9999. Bind-mounted data directories must be owned by UID 1000.

How to configure Hindsight

  • HINDSIGHT_API_DATABASE_URLpg0 (embedded)PostgreSQL connection string
  • HINDSIGHT_API_READ_DATABASE_URLUnset (uses primary)Optional read-replica PostgreSQL URL. When set, recall queries (semantic, BM25, graph, temporal) are routed through a separate connection pool against this URL, offloading the primary. Typically points to a read-only endpoint (e.g., CNPG's <cluster>-ro service or Aurora reader endpoint).
  • HINDSIGHT_API_MIGRATION_DATABASE_URLFalls back to DATABASE_URLDirect PostgreSQL URL for running migrations, bypassing connection poolers (e.g. PgBouncer). When set, advisory locks and Alembic migrations use this URL instead of DATABASE_URL.
  • HINDSIGHT_API_DATABASE_SCHEMApublicPostgreSQL schema name for tables
  • HINDSIGHT_API_RUN_MIGRATIONS_ON_STARTUPtrueRun database migrations on API startup

Hindsight releases & version history

@ Every self-hosted release, weekly

One Monday email with the week's stable releases across the directory.

FAQ

What's the typical latency for recall operations?

Around 50-100 ms without reranking and 200-500 ms with reranking, depending on the reranker model and installation.

What's the difference between a mental model and a knowledge page?

They use the same engine; a knowledge page adds a place in a folder tree and document-oriented defaults — built from observations only, refreshed incrementally after each consolidation, and a larger content budget.

When should I use mental models?

When you need higher-level understanding or long-term behavioural patterns available instantly with no reasoning on the request path; Hindsight builds and refreshes the content, and reflect consults mental models first.

When should I use recall vs reflect?

Use recall when you want raw facts, need speed (50-500 ms) and will synthesize the answer yourself; use reflect when you want a ready-made, disposition-aware answer with citations, accepting 1-10 s latency.

What's the difference between retain, recall, and reflect?

Retain stores facts, entities and relationships; recall searches and returns raw memory data for a query; reflect uses an AI agent to answer the query from retrieved memories.

How do I isolate user data?

Either give each user their own memory bank, which is fully isolated, or keep one bank and tag memories with user identifiers at retain time so recall and reflect can filter per user while still allowing cross-user analysis.

What are "zombie" operations and how do I recover them?

A background task left stuck in processing because the worker that claimed it disappeared, usually after a container restart with an unstable worker ID. Recover with the admin CLI commands decommission-worker or decommission-workers, and prevent it by setting a stable HINDSIGHT_API_WORKER_ID.

What are the minimum system requirements for self-hosting?

Python 3.11 or newer, 4 GB RAM minimum (8 GB recommended for production), and an LLM API key or a local LLM setup.

Do I need to host my own infrastructure?

No — you can use the fully managed Hindsight Cloud or deploy the self-hosted server on your own infrastructure with Docker or a direct install.

Which model should I use with Hindsight?

The public Model Leaderboard benchmarks models on accuracy, speed, cost and reliability for retain, reflect and observation consolidation.

Which clients and languages are supported?

Python, TypeScript, Go and a CLI clients, plus plain HTTP against the REST API.

Why use Hindsight instead of other solutions?

The project cites top LongMemEval benchmark accuracy, a PostgreSQL foundation, horizontal scalability, self-hosted or cloud deployment, long-term memory consolidation and graph-based reasoning.

What is Hindsight and how does it differ from RAG?

Hindsight stores structured facts instead of raw document chunks, builds mental models that consolidate knowledge over time, links entities and concepts in a graph, supports time-aware retrieval and adds disposition-aware reflection.

More in AI Agents

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…