Reference / Platform / Data Model Data Model This reference documents the core entities in 2Signal, their fields, and relationships. All entities use UUID primary keys and include createdAt / updatedAt timestamps.
Trace A trace represents one complete execution of your agent. Traces contain spans and can have scores attached.
Field Type Description idUUID Unique trace identifier (set by the SDK) projectIdUUID Project this trace belongs to namestring Name of the trace (usually the agent or function name) startTimeISO 8601 When the trace started endTimeISO 8601 | null When the trace ended (null if still running) durationMsinteger | null Computed duration in milliseconds statusenum OK or ERRORtotalCostdecimal Sum of all span costs in USD totalTokensinteger Sum of all span token counts metadataJSON Arbitrary metadata set at trace creation tagsstring[] Tags for filtering and grouping
Span A span represents a single operation within a trace: an LLM call, tool invocation, retrieval step, or custom logic. Spans can be nested via parentSpanId.
Field Type Description idUUID Unique span identifier traceIdUUID Parent trace parentSpanIdUUID | null Parent span for nesting projectIdUUID Project this span belongs to namestring Descriptive name for the operation typeenum AGENT, TOOL, LLM, CHAIN, RETRIEVAL, CUSTOM, DELEGATION, VOICE, HUMAN_HANDOFF, GUARDRAILstartTimeISO 8601 When the span started endTimeISO 8601 | null When the span ended durationMsinteger | null Computed duration in milliseconds inputJSON Input to the operation (e.g., messages for LLM calls) outputJSON Output of the operation (e.g., LLM response) modelstring | null Model name for LLM spans (e.g., gpt-4o) modelParametersJSON | null Parameters like temperature, max_tokens promptTokensinteger | null Input token count completionTokensinteger | null Output token count totalTokensinteger | null Sum of prompt + completion tokens costdecimal | null Cost in USD for this span statusenum OK or ERRORerrorMessagestring | null Error details when status is ERROR metadataJSON Arbitrary metadata
Span Types Type When to Use Example LLMAny LLM API call OpenAI chat.completions.create() TOOLTool or function invocation Calculator, web search, code execution RETRIEVALData retrieval from external source Vector DB query, API call for context CHAINMulti-step processing pipeline LangChain chain execution AGENTAutonomous agent decision loop ReAct agent, CrewAI agent CUSTOMAnything else Custom business logic, validation
Score Scores are evaluator results attached to traces or individual spans.
Field Type Description idUUID Unique score identifier traceIdUUID Trace being scored spanIdUUID | null Specific span being scored (null for trace-level scores) projectIdUUID Project this score belongs to evaluatorNamestring Name of the evaluator that produced this score valuefloat Score value between 0 and 1 labelstring | null Human-readable label (e.g., pass, fail) reasoningstring | null Explanation for the score (especially useful for LLM Judge)
Evaluator Config Defines an evaluator that automatically runs on new traces.
Field Type Description idUUID Config identifier projectIdUUID Project this evaluator belongs to namestring Unique name within the project typeenum LLM_JUDGE, CONTAINS, JSON_SCHEMA, REGEX_MATCH, SIMILARITY, LATENCY, COST, CUSTOMconfigJSON Type-specific configuration (see Evaluators ) enabledboolean Whether this evaluator runs on new traces
Dataset & Dataset Item Datasets hold test cases for systematic evaluation.
Field Type Description idUUID Dataset identifier projectIdUUID Project this dataset belongs to namestring Unique name within the project descriptionstring | null Optional description
Dataset Item:
Field Type Description idUUID Item identifier datasetIdUUID Parent dataset inputJSON Test input for the agent expectedOutputJSON | null Reference output for similarity evaluators metadataJSON | null Additional context (category, difficulty, etc.)
Organization Field Type Description idUUID Organization identifier namestring Organization display name planenum FREE, PRO, TEAM, ENTERPRISEstripeCustomerIdstring | null Stripe customer for billing stripeSubscriptionIdstring | null Active Stripe subscription
Organization Member Field Type Description organizationIdUUID Organization userIdUUID Supabase user ID emailstring Member email roleenum OWNER, ADMIN, MEMBER, VIEWER
Model Routing Config Field Type Description idUUID Config identifier projectIdUUID Project this config belongs to namestring Unique name within the project enabledboolean Whether this routing config is active defaultModelstring Fallback model when no rule matches rulesJSON[] Array of routing rules (see Model Routing Guide )
Usage Record Field Type Description organizationIdUUID Organization projectIdUUID Project monthstring Calendar month (YYYY-MM) traceCountinteger Traces ingested this month spanCountinteger Spans ingested this month evalRunCountinteger Evaluator executions this month
Project A project is a sub-tenant within an organization. Traces, evaluators, API keys, and all other resources are scoped to a project.
Field Type Description idUUID Project identifier organizationIdUUID Parent organization namestring Project display name descriptionstring | null Optional description
API Key Project-scoped credentials for SDK and API authentication. The raw key is shown once at creation; only the bcrypt hash is stored.
Field Type Description idUUID Key identifier projectIdUUID Project this key belongs to namestring Descriptive name keyHashstring Bcrypt hash of the API key keyPrefixstring First characters for identification (e.g., ts_...abc) revokedAttimestamp | null When the key was revoked (null if active) lastUsedAttimestamp | null Last time the key was used for authentication
Trace Annotation Human feedback attached to traces. Annotations allow team members to review and rate agent outputs.
Field Type Description idUUID Annotation identifier traceIdUUID Trace being annotated projectIdUUID Project userIdUUID Supabase user who created the annotation userEmailstring Annotator email sentimentenum POSITIVE, NEGATIVE, NEUTRALnotestring | null Free-text feedback scoreOverridesJSON | null Manual score overrides for evaluators
Eval Run & Eval Run Result Batch evaluation runs execute evaluators across dataset items for systematic testing.
Field Type Description idUUID Eval run identifier projectIdUUID Project datasetIdUUID Dataset being evaluated evaluatorConfigIdUUID Evaluator configuration used statusenum PENDING, RUNNING, COMPLETED, FAILEDtotalItemsinteger Total dataset items to evaluate completedItemsinteger Items evaluated so far failedItemsinteger Items that failed evaluation avgScorefloat | null Average score across all items passRatefloat | null Percentage of items that passed
Eval Run Result:
Field Type Description idUUID Result identifier evalRunIdUUID Parent eval run datasetItemIdUUID Dataset item evaluated scorefloat Score value (0–1) labelstring | null Pass/fail label reasoningstring | null Explanation errorstring | null Error message if evaluation failed durationMsinteger | null Evaluation duration
Prompt Template & Version Version-controlled prompt storage for managing and tracking prompt changes over time.
Field Type Description idUUID Template identifier projectIdUUID Project namestring Unique template name within project descriptionstring | null Optional description
Prompt Template Version:
Field Type Description idUUID Version identifier promptTemplateIdUUID Parent template versioninteger Auto-incrementing version number contenttext The prompt text variablesstring[] Variable names extracted from the content commitMessagestring | null Description of what changed in this version
Alert Rule & Alert Event Configurable alert rules that fire when quality or performance metrics cross thresholds.
Field Type Description idUUID Rule identifier projectIdUUID Project namestring Rule display name enabledboolean Whether this rule is active metricenum EVAL_PASS_RATE, EVAL_SCORE_AVG, ERROR_RATE, P95_LATENCY, TRACE_COST_AVGevaluatorNamestring | null For eval-specific metrics operatorstring lt or gtthresholdfloat Value that triggers the alert windowMinutesinteger Time window for metric aggregation cooldownMinutesinteger Minimum time between repeated alerts channelenum EMAIL, SLACK, WEBHOOKdestinationJSON Channel-specific delivery config (email address, webhook URL, etc.)
Alert Event:
Field Type Description idUUID Event identifier alertRuleIdUUID Rule that triggered projectIdUUID Project metricenum Metric that was evaluated valuefloat Actual metric value thresholdfloat Threshold that was crossed channelenum Delivery channel used deliveredboolean Whether notification was successfully delivered errorstring | null Delivery error if failed
Trace Replay Re-execute traces with different models or prompt templates to compare results.
Field Type Description idUUID Replay identifier projectIdUUID Project originalTraceIdUUID Trace being replayed replayedTraceIdUUID | null New trace created by replay (null until complete) statusenum PENDING, RUNNING, COMPLETED, FAILEDmodelstring | null Model override for replay promptTemplateVersionIdUUID | null Prompt template version override modelParametersJSON | null Model parameter overrides (temperature, etc.) errorstring | null Error message if replay failed triggeredByUUID User who triggered the replay
Entity Relationships Organization ─┬── OrganizationMember
├── Project ─┬── ApiKey
│ ├── EvaluatorConfig ── EvalRun ── EvalRunResult
│ ├── Dataset ── DatasetItem
│ ├── ModelRoutingConfig
│ ├── PromptTemplate ── PromptTemplateVersion
│ ├── AlertRule ── AlertEvent
│ ├── TraceReplay
│ ├── Trace ─┬── Span ── Score
│ │ ├── Score
│ │ └── TraceAnnotation
│ └── UsageRecord
└── UsageAlertHave questions? Join our community!
Connect with other developers and the 2Signal team.
Join Discord