Hindsight: AI Long-Term Memory
Hindsight is a PostgreSQL-native long-term memory service for AI agents.
Pigsty provides the app/hindsight configuration template (conf/app/hindsight.yml). By default, it uses Pigsty-managed PostgreSQL instead of Hindsight’s built-in development database.
Quick Start
Default access URLs:
- UI:
http://hs.pigstyorhttp://<IP>:9999 - API:
http://hs-api.pigstyorhttp://<IP>:8888
Key Settings
conf/app/hindsight.yml overrides /opt/hindsight/.env through apps.hindsight.conf. Key parameters:
HINDSIGHT_API_PORT: API port inside the container, default8888; the control plane’sHINDSIGHT_CP_DATAPLANE_API_URLfollows this port by defaultHINDSIGHT_API_PUBLISH_PORT: published API port on the host, default8888HINDSIGHT_UI_PUBLISH_PORT: published UI port on the host, default9999HINDSIGHT_DB_HOST/HINDSIGHT_DB_PORT/HINDSIGHT_DB_NAME/HINDSIGHT_DB_USER/HINDSIGHT_DB_PASSWORDHINDSIGHT_API_VECTOR_EXTENSION: defaultpgvectorHINDSIGHT_API_TEXT_SEARCH_EXTENSION: defaultnativeHINDSIGHT_API_LLM_PROVIDER: defaultnoneHF_HUB_OFFLINE: defaults to1to use models bundled in the official image without contacting Hugging Face Hub at runtime; set it to0and allow outbound access to download uncached models
With the default LLM provider, none, Hindsight can retain text and recall it using local embedding/reranker models. Fact extraction, reflection, and consolidation require Ollama or an OpenAI-compatible API.
Compose mounts the named volume hindsight-cache at /home/hindsight/.cache. Docker’s initial volume copy-up preserves the models bundled in the image, and the volume retains the cache across container recreation.
Enable vector and install pg_trgm in the public schema, which upstream trigram index migrations require. conf/app/hindsight.yml already declares extensions: [ vector, { name: pg_trgm, schema: public } ]. For an existing database, verify that pg_trgm is in public; CREATE EXTENSION IF NOT EXISTS does not move an extension installed in another schema.
Operations
The container health check and make health probe both the API’s /health/ready and the UI proxy’s /api/banks?limit=1, verifying data plane readiness and control plane access to the API.
References
- Hindsight project: https://github.com/vectorize-io/hindsight
- Pigsty template: https://github.com/pgsty/pigsty/blob/main/conf/app/hindsight.yml