Hindsight 0.4+ REST backend 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.toml (select this backend and set its options):
[memory]
backend = "hindsight_rest"
[memory.hindsight_rest]
enabled = true
url = "http://localhost:8888"
default_bank_id = "platform"
timeout_recall_ms = 4000
timeout_reflect_ms = 5000[memory.hindsight] is accepted as a legacy alias for
[memory.hindsight_rest]. This is the default backend, so it is active
even when [memory].backend is unset.
Usage
# Semantic search
{:ok, results} = LlmCore.Memory.recall("authentication patterns", bank_id: "my-bank")
# Insights
{:ok, insight} = LlmCore.Memory.reflect("What patterns work best?", bank_id: "my-bank")
# Store content (async)
:ok = LlmCore.Memory.retain("New pattern discovered", %{}, bank_id: "my-bank")
# Store content (sync, for critical data)
{:ok, _} = LlmCore.Memory.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
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.