store (open a store).
Score fields
Rust uses the same names in snake_case;type is score_type.
- A score replaces the stored score with the same target,
name,source,authorIdandevalId. So two people, or two runs of an eval, keep one score each. - A score with no target or two, a boolean that is not 0 or 1, or a category with no label is an error, and its batch is refused whole.
- Scores on a session are not in
getScoresof its traces, and not inanyScore. They go withdeleteSession, and when a delete or a drop removes the last trace of the session.deleteTraceleaves them.
anyScore in findTraces.
Add up scores
Each row has
key, count (every score of the group), avg and labels (the count per label). avg is the average of the numbers and booleans; of a boolean, it is the share of true. It is null for a group of categories.
The trace side is read when the query runs, so a group follows the trace as it is now. A score with no trace in the store has the key null. To compare two experiments, run the query once per group: for example with traces: { root: { attributes: { experiment: 'A' } } }, then with 'B'. More examples: sessions and scores.
List sessions
sessionId. A trace’s session is the sessionId of its root span, or else of its earliest span that has one.
findSessionsgives the newest first, with sums over the traces:traceCount,spanCount,errorCount, tokens andcostNanos. It pages bycursor, as the other lists do.- A row also has
userId(of the earliest trace that has one),firstTraceIdandfirstInput,lastTraceIdandlastOutput(the first 200 characters). - The filter takes
userId,fromandto: the start of the session. getSessiongives every trace of the session, oldest first. For a very large session, pagefindTraceswithfilter.sessionId.
Read and export
Read whole traces, export to JSON Lines.
Delete and maintain
Delete users, drop old spans, free disk space.