hindsightai/hindsight
A bank-based memory service that turns agent interactions into durable knowledge
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Hindsight is a Python agent-memory service organized around banks. retain uses an LLM to extract facts, entities, relationships, and temporal information, then normalizes them into canonical entities, time series, and search indexes. Banks distinguish world facts from agent experiences and combine structured relationships with sparse and dense vector representations. Observations consolidate evidence across memories; mental models synthesize a stored answer to a standing question.
The Python uv workspace includes hindsight-api, hindsight-api-slim, hindsight-all, hindsight-all-slim, and hindsight-embed; hindsight-control-plane/ is a separate top-level module. The service exposes memory operations through REST, client SDKs, and a built-in per-bank MCP endpoint. Python applications can also launch a local server through HindsightServer and connect a client to its URL instead of provisioning a separate service.
Key Capabilities & Differentiators
recall searches a bank for relevant memories, including time-oriented queries; reflect synthesizes a response from bank knowledge. For recurring questions, a mental model moves synthesis off the read path: Hindsight refreshes a stored answer in the background, and reading it is a database operation with neither retrieval nor an LLM call. Pages expose the same mechanism as searchable, folder-organized documents that can be projected to disk as Markdown.
Optional typed decisions replace some general-purpose LLM judgments across recall, consolidation, reflect, and Pages. The published model family includes the 0.8B hs-decide-1-flash decision model, the 114M hs-rerank-1 reranker, and the 112M hs-embed-1 model with 384-dimensional output. All three support eight languages. Main LLM options include hosted providers such as OpenAI and Anthropic, local runtimes such as Ollama and llama.cpp, and OpenAI-compatible endpoints.
Trade-offs & Limitations
Compared with a vector store and a conventional chunk-and-retrieve pipeline, Hindsight is a better fit when accumulated interactions must become structured, reusable memory. The cost is a heavier write path: LLM extraction and subsequent consolidation add work beyond indexing chunks. Stored mental models avoid generation on repeated reads, but background refresh means an answer may lag a recent write. Measure write-to-recall visibility and page freshness separately from query latency.
Use plain document RAG when the application mainly needs to retrieve and cite source passages; Hindsight can complement it rather than replace it. Self-hosting gives control over storage placement, but hosted inference creates a separate data boundary. For a multi-user rollout, verify authorization at both REST and the default-enabled MCP endpoints rather than assuming a bank ID is a security boundary. Use workload-specific tests for memory quality, inference cost, and update lag rather than treating a LongMemEval result as a capacity estimate.
Hardware & Deployment Guide
For a trial, use images.hindsight.ai/hindsight:latest, persist /home/hindsight/.pg0, and use ports 8888 and 9999 for the API and UI. The OpenAI example supplies the credential through HINDSIGHT_API_LLM_API_KEY. Other paths include external PostgreSQL via docker/docker-compose, a pip installation launched with hindsight-api, and Kubernetes via oci://images.hindsight.ai/charts/hindsight. On Intel Macs, use hindsight-all-slim for the Python all-in-one install.
Self-hosting the API and database does not make the system offline; that requires local inference for the models your configuration uses. Size storage for retained history and indexes, and measure ingestion, recall, and background refresh under realistic concurrency. Choose a tested image version for production rather than following latest unpinned. Release v1.3.0 stops the slim image from overwriting :latest and adds per-bank instructions to MCP initialization; v1.2.3 addresses ingestion failures on malformed and large files.
retain extracts facts, entities, relationships, and time information, then normalizes them into searchable bank records.hs-decide-1-flash is a 0.8B decision model; hs-rerank-1 is 114M; hs-embed-1 is 112M and emits 384-dimensional vectors.Long-lived assistants that need user preferences, prior experiences, and recurring answers to carry across sessions, with control over deployment and memory writes.
You only need stateless document retrieval, or cannot accommodate model-assisted writes and background refresh.
Quick Start & Installation
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 \ images.hindsight.ai/hindsight:latest
Comparison vs. Top RAG, Data & Memory Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| hindsight ★ | 64.7k | +884 | Python | MIT | A bank-based memory service that turns agent interactions into durable knowledge |
| graphiti | 33.3k | +143 | Python | Apache-2.0 | Temporal graph framework for agent memory with traceable, evolving facts |
| Memori | 17.9k | +337 | Python | — | An SDK-based agent memory layer for persistent state across sessions. |
| mem0 | 70k | +498 | Python | Apache-2.0 | A vector-backed memory layer for AI agents that need to recall past conversation |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/hindsightai/hindsight.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about hindsight
How should an existing agent integrate Hindsight?
retain at application-defined write points, recall when the agent needs matching memories, and reflect when it needs a synthesized response. Use the REST API or an SDK for explicit control. The LLM wrapper automates retention and retrieval on model calls; MCP clients can use /mcp/{bank_id}/.Do I need a GPU, and how should I size the service?
Can we use it commercially and keep memory data on premises?
hs-decide-1-flash is Apache 2.0, while the listed embedding and reranking models are MIT. If data must stay within your environment, verify every inference endpoint as well as database access, backups, and retention.When is Hindsight a better fit than a vector database with a RAG pipeline?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy