Class RedbEvalRunStore
REDB-backed . One
row per run; the run id lives in _objects.value_string (partial index
on PostgreSQL/SQLite; MSSQL cannot index NVARCHAR(MAX)) and, normalized, in
_objects._value_unique — concurrent saves of one run converge on a
single row. Per-iteration metrics are kept as a typed
nested array on the row — REDB persists them natively, no JSON roundtrip.
The store does not own an instance — each call
resolves one through IRouteContext.GetRedbService(name, exchange),
which honours the per-exchange scope cache. The redb name is read from
exchange.Properties[LlmKeys.RedbName] (set by the LLM endpoint URI),
falling back to the constructor-supplied default name and then to the host's
default unnamed instance.
public sealed class RedbEvalRunStore : IEvalRunStore
Inheritance
Implements
Methods
GetAsync(string, IExchange?, CancellationToken)
Loads a single run by its identifier.
public Task<EvalRunRecord?> GetAsync(string runId, IExchange? exchange = null, CancellationToken ct = default)
ListAsync(string?, int, IExchange?, CancellationToken)
Lists runs filtered by scenario name. Returns newest first.
public Task<IReadOnlyList<EvalRunRecord>> ListAsync(string? scenario = null, int take = 50, IExchange? exchange = null, CancellationToken ct = default)
SaveAsync(EvalRunRecord, IExchange?, CancellationToken)
Persists a completed evaluation run.
public Task SaveAsync(EvalRunRecord record, IExchange? exchange = null, CancellationToken ct = default)
SaveManyAsync(IEnumerable<EvalRunRecord>, IExchange?, CancellationToken)
Persists many evaluation runs at once. Bulk-friendly stores commit the
public Task SaveManyAsync(IEnumerable<EvalRunRecord> records, IExchange? exchange = null, CancellationToken ct = default)
Constructors
RedbEvalRunStore(IRouteContext, string?)
Creates the store. Scheme is synced by the host's redb.InitializeAsync().