hindsight-api-slim
Hindsight: Agent Memory That Works Like Human Memory
What it is and what it does
Hindsight-api-slim is a memory backend for AI agents that mimics human memory by storing facts, tracking entities and their relationships, and reasoning about time and context. It runs as a FastAPI server (default port 8888) backed by PostgreSQL with pgvector for semantic search, and exposes both a REST API and an MCP server interface for tool integration. The system supports three memory types (world facts, experience facts, and observations), combines multiple retrieval strategies (semantic, keyword, graph, and temporal), and allows agents to form opinions based on configurable disposition traits like skepticism and empathy.
The package is designed for AI agent frameworks and LLM applications that need persistent, queryable context across conversations. It integrates with multiple LLM providers (OpenAI, Anthropic, Gemini, Groq, Ollama, LMStudio) and includes Python SDK methods for creating memory banks, storing facts, recalling relevant memories, and reflecting on queries with reasoning. The dependency footprint is substantial—54 runtime packages including aiohttp, asyncpg, langchain-core, litellm, and observability tools—reflecting its role as infrastructure for complex agent systems.
Use it for:
- Build a conversational AI assistant that remembers user preferences and past interactions across sessions without re-prompting.
- Create a multi-turn agent that tracks entities (people, projects, dates) and reasons about temporal relationships ("what happened last spring?").
- Implement a code review agent that learns from feedback, stores coding style preferences, and applies them to future reviews.
- Develop a customer support bot that maintains a knowledge graph of customer issues, resolutions, and patterns to improve future responses.
- Run an autonomous research agent that accumulates findings, tracks source relationships, and synthesizes insights over time.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Hindsight-api-slim provides a persistent memory system for AI agents that stores facts, tracks entities and relationships, and enables temporal and semantic reasoning using PostgreSQL with pgvector.
Yes, if you are building AI agents or LLM applications that require persistent, queryable memory with temporal and semantic reasoning. The low install friction, active maintenance, permissive license, and zero known vulnerabilities make it a solid choice. The substantial dependency footprint and requirement for Python 3.11+ and external LLM credentials are expected trade-offs for agent infrastructure. Not suitable if you need a lightweight memory layer or are working with Python versions below 3.11.
Install
hindsight-api-slim on PyPI
pip
pip install hindsight-api-slimuv
uv add hindsight-api-slimpoetry
poetry add hindsight-api-slimInstalling hindsight-api-slim
Before you install
Low friction installation with a pure-Python wheel. Active maintenance as of 2026-08-14 with recent release. Requires Python 3.11 or later and brings in 54 runtime dependencies including LLM SDKs, async database drivers, and observability tools—a substantial dependency footprint typical of agent infrastructure.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely in both open-source and commercial projects with minimal restrictions.
Quickstart
pip install hindsight-api-slim
from hindsight_api import MemoryEngine
memory = MemoryEngine()
await memory.initialize()
bank = await memory.create_memory_bank(name="agent", background="helpful assistant")
await memory.retain(memory_bank_id=bank.id, content="user prefers Python")
results = await memory.recall(memory_bank_id=bank.id, query="programming language preference?")
Requires Python 3.11+. Async/await context required. Needs a PostgreSQL database (embedded by default, or external via HINDSIGHT_API_DATABASE_URL). Requires LLM API credentials (OpenAI, Anthropic, Gemini, Groq, Ollama, or LMStudio).
Verify before relying
- Whether the embedded PostgreSQL (pg0) is suitable for production workloads or intended only for development.
- Performance characteristics and scaling limits for memory recall with large fact stores.
- Whether the TEMPR retrieval strategy (semantic, keyword, graph, temporal with RRF fusion) is documented with benchmarks.
- Support status and breaking-change policy between 0.9.1 and future releases.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 54 — aiohttp, alembic, anthropic, asyncpg, authlib, boto3, claude-agent-sdk, cohere, croniter, cryptography, dateparser, fastapi, fastmcp, filelock, google-auth, google-genai, greenlet, httpx, json-repair, langchain-core, langchain-text-splitters, langsmith, litellm, markitdown, obstore, openai, opentelemetry-api, opentelemetry-exporter-otlp-proto-http, opentelemetry-exporter-prometheus, opentelemetry-instrumentation-fastapi |
| Maintenance | actively maintained — 0 days since the last release |
| First released | |
| Downloads | 80,552/month — #14,286 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: hindsight_api_slim-0.9.1-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
agent-framework-mem0Integrates Mem0 persistent memory into…
permissive · top 15,000 on PyPI
graphiti-coreGraphiti builds and queries temporal context…
permissive · top 5,000 on PyPI
hindsight-clientA Python client library for interacting with…
permissive · top 15,000 on PyPI
agent-framework-azure-aiIntegrates Azure AI Foundry memory capabilities…
permissive · top 15,000 on PyPI
cogneeCognee builds a self-hosted knowledge graph…
permissive · top 15,000 on PyPI
mem0aiMem0 adds a persistent, searchable memory layer…
permissive · top 5,000 on PyPI
pydantic-ai-absurdAdds durable execution to Pydantic AI agents by…
permissive · top 15,000 on PyPI
mindroomMindRoom is a multi-agent runtime that deploys…
permissive · top 15,000 on PyPI
memoriMemori is a Python SDK that automatically…
permissive · top 15,000 on PyPI
memsearchMemsearch builds a searchable semantic memory…
permissive · top 15,000 on PyPI