TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/vectorize-io/hindsight/llms.txt
Use this file to discover all available pages before exploring further.
hindsight-all package bundles the Hindsight API server, embedded PostgreSQL, and the Python client into a single pip install. Your Python code spawns and manages a local Hindsight daemon — no external server, no Docker, no infrastructure setup required.
The daemon runs as a separate OS process on
127.0.0.1. Your application communicates with it over HTTP using the standard HindsightClient. If you already have a Hindsight server running elsewhere, use hindsight-client directly.When to use embedded vs server
| Scenario | Recommended approach |
|---|---|
| Tests, short-lived scripts, deterministic startup/shutdown | HindsightServer (context manager) |
| Long-running application, auto-start on first use | HindsightEmbedded (daemon) |
| Existing Hindsight server running elsewhere | hindsight-client directly |
| Production multi-user or network-accessible deployments | Dedicated API service + PostgreSQL |
Installation
hindsight-all bundles hindsight-api-slim, hindsight-client, and hindsight-embed — one install gets you everything. Use hindsight-all-slim to skip locally bundled embedding and reranker model weights (the server will download them on first use instead).
HindsightServer — explicit lifecycle
HindsightServer is a context manager that starts the server when you enter the block and shuts it down cleanly when you exit. Use it in tests and scripts where you need deterministic lifecycle control.
Configuration parameters
LLM provider for memory extraction and reflection:
openai, anthropic, gemini, groq, minimax, or ollama.API key for the chosen LLM provider.
Model name for the LLM provider. Defaults to
gpt-4o-mini for OpenAI.Port to bind the server on. Defaults to an available port chosen automatically.
HindsightEmbedded — auto-managed daemon
HindsightEmbedded handles daemon lifecycle automatically. The daemon starts on the first call, stays alive across multiple calls, and optionally shuts down after an idle timeout. This is the easiest integration for application code that doesn’t want to manage server lifecycle.
Profiles
A profile is an isolated Hindsight environment. Each profile gets its own embedded PostgreSQL database stored at~/.pg0/instances/hindsight-embed-{profile}/ and its own API server port. Use separate profiles to isolate environments (dev/prod), applications, or users.
LLM provider examples
API namespaces
BothHindsightEmbedded and HindsightClient expose organised sub-clients for bank management, mental models, directives, and memories. The namespace methods automatically ensure the daemon is running before each call, so daemon crashes are handled gracefully.
Configuration via environment variables
The underlyinghindsight-embed daemon reads configuration from environment variables. You can also set these in the file ~/.hindsight/embed.
| Variable | Description | Default |
|---|---|---|
HINDSIGHT_EMBED_LLM_API_KEY | Required. API key for the LLM provider | — |
HINDSIGHT_EMBED_LLM_PROVIDER | Provider: openai, anthropic, gemini, groq, minimax, ollama | openai |
HINDSIGHT_EMBED_LLM_MODEL | Model name | gpt-4o-mini |
HINDSIGHT_EMBED_BANK_ID | Default memory bank ID | default |
HINDSIGHT_EMBED_DAEMON_IDLE_TIMEOUT | Seconds before the daemon shuts down when idle (0 = never) | 0 |
