--- id: hindsight-api-slim version: "0.9.1" license: MIT license_treatment: permissive maintenance: active --- # hindsight-api-slim — Hindsight: Agent Memory That Works Like Human Memory License: permissive · Maintenance: active · Downloads: 80.6K/mo ## 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 above — 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 pip install hindsight-api-slim uv add hindsight-api-slim poetry add hindsight-api-slim ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 80.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags agent memory system, persistent memory for AI, temporal semantic memory, entity relationship tracking, AI agent knowledge store, memory retrieval for LLMs, agent context management, agent-memory, temporal-reasoning, vector-search [View on SkillFed](https://skillfed.io/packages/hindsight-api-slim) · [View on PyPI](https://pypi.org/project/hindsight-api-slim/)