LLMDB.History (LLM DB v2026.3.0)

Copy Markdown View Source

Read-only runtime access to generated model history artifacts.

History is loaded from priv/llm_db/history (or config :llm_db, :history_dir). NDJSON files are parsed into ETS-backed indexes for fast timeline/recent lookups.

Summary

Functions

Returns true when history artifacts are available and readable.

Returns parsed history metadata from meta.json.

Returns most recent events globally, ordered by captured_at then event_id descending.

Returns all timeline events for a model, lineage-aware and ordered by captured_at then event_id ascending.

Types

event()

@type event() :: map()

Functions

available?()

@spec available?() :: boolean()

Returns true when history artifacts are available and readable.

meta()

@spec meta() :: {:ok, map()} | {:error, :history_unavailable | term()}

Returns parsed history metadata from meta.json.

recent(limit)

@spec recent(pos_integer()) :: {:ok, [event()]} | {:error, term()}

Returns most recent events globally, ordered by captured_at then event_id descending.

Limit is capped to 500.

timeline(provider, model_id)

@spec timeline(atom() | String.t(), String.t()) :: {:ok, [event()]} | {:error, term()}

Returns all timeline events for a model, lineage-aware and ordered by captured_at then event_id ascending.