What's new in Hindsight 0.8.5
Hindsight 0.8.5 builds on 0.8.4 with a focus on cost, resilience, and operational integrity: cut LLM spend with Anthropic batch and prompt caching and Gemini context caching for reflect, and keep operations running through more resilient model-output parsing. It also lands a wide batch of retain, consolidation, and recall integrity fixes. Self-managed deployments should upgrade, especially anyone who runs consolidation at scale.
- Lower LLM Costs: Anthropic batch API and prompt caching, plus step-by-step context caching for Gemini reflect.
- More Resilient Model Output: Recover from malformed and fenced JSON instead of failing the operation.
- Per-Bank Audit & Operations Control: Toggle audit logging per bank, delete terminal operations, and safer database configuration.
- Retain, Consolidation & Recall Integrity: Why you should upgrade.
Lower LLM Costs
Three changes meaningfully reduce the token spend behind extraction, consolidation, and reflect:
- Anthropic Message Batches. Retain and consolidation can now run their Anthropic calls through the batch API for a 50% token discount on eligible workloads.
- Anthropic prompt caching. Repeated prompt prefixes are cached, so high-volume workloads stop paying full price for the same context on every call — including for batched system prompts.
- Gemini context caching for reflect. Reflect's multi-step tool loop now caches context step by step, cutting the cost of long, multi-turn reasoning on Gemini.
If you run on Anthropic or Gemini at volume, these are opt-in wins you can turn on without changing how you call the API.
More Resilient Model Output
Language models occasionally emit JSON that is wrapped in code fences, truncated, or slightly malformed — and previously that could fail an otherwise good operation. 0.8.5 adds several layers of recovery so a single formatting slip no longer costs you the whole call:
- Last-resort repair of malformed JSON. When a model returns structurally broken JSON, Hindsight now attempts to repair and parse it before giving up, while still failing loudly when there's genuinely nothing to recover.
- Recovery from code fences and stray text. JSON that is fenced, surrounded by prose, or contains inner backticks is now extracted correctly instead of being truncated.
- Stricter structured output where it helps. Per-operation strict JSON schemas (with an explicit per-call opt-out) and canonical tool-result messages make structured responses more reliable across OpenAI-compatible and Anthropic providers.
- Easier debugging of rejected calls. A new opt-in mode dumps the exact request payload on a 4xx rejection, across all providers, so you can see precisely what a provider refused.
The net effect: fewer failed retains and reflects caused by provider formatting quirks.
Per-Bank Audit & Operations Control
- Per-bank audit logging.
audit_log_enabledis now hierarchical, so you can turn audit logging on or off per bank instead of only globally. - Delete terminal operations. Completed and failed bank operations can now be deleted, with control-plane support, to keep operation history manageable.
- Safer database configuration. Percent-encoded database URLs are preserved through migrations,
pg0://URLs can carry user and password credentials, embedded Postgres honors credentials in the database URL, and session settings are correctly re-applied when a pooled connection is acquired. - Schema-scoped maintenance routines. Maintenance routines are installed into the configured schema, and expired-operation cleanup discovers schemas in a single query with retention off by default.
- Vector-index recovery. In the rare case where a per-bank vector index ends up incomplete after a database restore, upgrade, or vector-extension switch, Hindsight now repairs its coverage so recall stays complete, and a re-runnable
repair-bankadmin command lets you reconcile a bank on demand.
Retain, Consolidation & Recall Integrity
The core reason to upgrade — a broad set of fixes that protect what gets stored and keep background work healthy:
- Entity linking correctness. Resolved entities are reasserted before linking units, and every co-occurrence pair is preserved when canonicalizing, so links land on the right, committed entities.
- Degenerate text is rejected, not stored. Retain now rejects degenerate fact text before storage while preserving fact alignment when filtering it out.
- Atomic bank creation. Lazy bank creation is now atomic, closing a race under concurrent first writes.
- No stuck operations. Operation completion is isolated from best-effort side effects, so a failing webhook or aggregation can no longer leave an operation stuck in
processing; crash-recovery attempts now count toward the retry budget. - Reliable webhooks and watermarks.
retain.completedwebhooks are queued even on boundary and zero-fact batches, and no-op delta refreshes advance the watermark instead of reprocessing. - Tougher consolidation. Dedup decisions are requested as JSON and normalized, invalid actions default to keep, and a foreign-key violation during parallel consolidation is fixed.
- Curation and metadata fidelity. Bank attribution is preserved during curation, search vectors are refreshed on edit, occurred dates can be cleared with
null, and browse endpoints return full metadata.
Other notable changes:
- Tag filtering on list endpoints.
list_memoriesandlist_memory_unitsnow accept tag filters. - Recall tuning. An opt-in BM25 query-term cap, preserved combined graph-activation scores, and fact-type-scoped entity fanout give more predictable retrieval.
- Reflect polish. Answer length is capped, expanded memories are paired with the correct memory, horizontal rules stay inside fenced code blocks, and bank attribution is preserved in provider calls.
- Date parsing. The strongest date match now wins, and day-month-year dates no longer collapse to the whole month.
- Security updates. Vulnerable API runtime packages were removed and several dependencies bumped for security.
