Skip to content

store

diapason.traces.store

SQLite-backed trace storage.

TraceStore

Append-only SQLite store for interaction traces.

close()

Close the underlying SQLite connection.

count()

Return the total number of stored traces.

get(trace_id)

Retrieve a trace by id, or None if not found.

list_traces(*, agent=None, model=None, outcome=None, since=None, until=None, limit=100)

Query traces with optional filters.

save(trace)

Persist a complete trace with all its steps.

trace_id is a primary key: saving a second, different trace under an existing id raises sqlite3.IntegrityError (the external-corpus adapter relies on this to surface duplicate record ids). The server avoids re-saving the same trace by keeping the TraceCollector the single writer — see server/app.py — rather than swallowing collisions here.

search(query, *, agent=None, limit=20)

Full-text search across traces. Optionally filter by agent.

subscribe_to_bus(bus)

Subscribe to TRACE_COMPLETE events on bus.

update_feedback(trace_id, score)

Update the feedback score for a trace.

Returns True if the trace was found and updated, False otherwise.