Hindsight 0.4+ integration for semantic memory capabilities.
Uses the Hindsight REST API (not MCP). Server runs at localhost:8888,
REST endpoints at /v1/default/banks/{bank_id}/....
Provides:
- Semantic search (recall) with intelligent caching
- Insight queries (reflect) with longer TTL caching
- Content retention with write-behind buffering
- Auto-discovery, retry logic, and circuit breaker
Configuration
Configure in ~/.llm_core/config.yml:
memory:
hindsight:
url: http://localhost:8888
enabled: true
default_bank_id: platform
cache_ttl_ms: 300000Usage
# Semantic search
{:ok, results} = Hindsight.recall("authentication patterns", bank_id: "my-bank")
# Insights
{:ok, insight} = Hindsight.reflect("What patterns work best?", bank_id: "my-bank")
# Store content (async)
:ok = Hindsight.retain("New pattern discovered", %{}, bank_id: "my-bank")
# Store content (sync, for critical data)
{:ok, _} = Hindsight.retain_sync("Critical execution", %{}, bank_id: "my-bank")
Summary
Functions
Checks if Hindsight API is available and enabled.
Returns stats for a specific bank.
Creates or updates a memory bank.
Deletes a memory bank and all its contents.
Performs a health check on the Hindsight API.
Lists available Hindsight memory banks.
Semantic search for similar content with caching.
Natural language reflection/synthesis over a bank's memories.
Stores content in Hindsight for semantic indexing (async, buffered).
Stores content synchronously, bypassing the write buffer.
Returns the effective Hindsight base URL.
Functions
@spec available?() :: boolean()
Checks if Hindsight API is available and enabled.
Returns stats for a specific bank.
Creates or updates a memory bank.
Deletes a memory bank and all its contents.
Performs a health check on the Hindsight API.
Lists available Hindsight memory banks.
Semantic search for similar content with caching.
Options
:limit- max results (default 10):bank_id/:target_bank- Memory bank to query (defaults to config):budget-"low"|"mid"|"high"(impacts recall cost):max_tokens- maximum tokens for result summarization:bypass_cache- force fresh query
@spec reflect( String.t(), keyword() ) :: {:ok, String.t()} | {:error, term()}
@spec reflect( atom(), keyword() ) :: {:ok, map()} | {:error, term()}
Natural language reflection/synthesis over a bank's memories.
Options
:bank_id/:target_bank- Memory bank to reflect on:budget-"low"|"mid"|"high":context- Additional context for the reflection
Stores content in Hindsight for semantic indexing (async, buffered).
Options
:bank_id/:target_bank- Memory bank to write to:context- Short descriptor for the memory
Stores content synchronously, bypassing the write buffer.
Use for critical data that must be persisted immediately.
@spec url() :: String.t() | nil
Returns the effective Hindsight base URL.