Skip to content

Semantic conventions

The registry of ctxflow-semconv is the only place where ctxflow attribute keys, span names and enums are defined. The Python constants (import ctxflow_semconv as sc), the JSON Schema that the core validates against, and the tables below are all generated from it. An unknown ctxflow.* key is left out when it arrives (the request is still accepted); see OTLP endpoint.

Generated from the registry of ctxflow-semconv 0.2.2.

Flags: chunk ids = the attribute holds chunk ids; content hash = a plain sha256 of text or document bytes. What leaves your process is on What is sent.

The tables below are the ctxflow.* keys. A turn also needs keys of the conventions ctxflow reads. These are the ones you write yourself when no instrumentation does (content keys lists which of them carry text):

Key Value Where it is explained
openinference.span.kind AGENT (or CHAIN) on the turn, RETRIEVER on a retrieval, TOOL on a tool call Agent turns
input.value, output.value The question and the plain-text answer, on the turn span Agent turns
retrieval.documents.N.document.id The chunk id as the vector store holds it A manual retrieval span
retrieval.documents.N.document.score The retrieval score A manual retrieval span
retrieval.documents.N.document.content The chunk text A manual retrieval span
retrieval.documents.N.document.metadata JSON string with the C1 keys of the chunk Source identity
gen_ai.operation.name chat, text_completion or generate_content on a model call Agent turns
gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens Model and token counts Agent turns
tool.name The tool name; a failure is the span status ERROR Agent turns
Span nameDescription
agent.turnOne turn of the agent.
agent.tool_callTool call seen on the agent side.
retrievalRetrieval span (OpenInference RETRIEVER).
mcp.tool {name}MCP server span of a tool call.
ingress.requestIngress proxy span; identity from the mapping file.
ctxflow.n8n.executionn8n connector span with the identity of an execution.
node.executen8n node span.
workflow.executen8n workflow span.
ingest.runOne ingestion run over a corpus version.
ingest.documentIngestion of one document.
ingest.parseParse of one document.
ingest.chunkChunking of one document.
ingest.embedEmbedding of the chunks of one document.
ingest.upsertWrite of the chunks of one document to the index.
ingest.deleteRemoval of the chunks of a deleted document.
index.changeDeprecated: not produced by the current SDKs and collector.
source.versionDeprecated: not produced by the current SDKs and collector.
AttributeTypeDescription
ctxflow.source_idstringStable id of the document in its source system.
ctxflow.source_versionstringVersion in which the current content of the document first appeared. Without an explicit version, a content-derived label: h:<12 hex> of a plain sha256.
ctxflow.source_hashstringsha256 (64 hex) of the original document bytes as they are (no normalization).
ctxflow.chunker_versionstringParser and splitter with their settings, e.g. docling-<ver>/llamaindex-<splitter>-<size>-<overlap>.
ctxflow.embed_modelstringName of the embedding model.
ctxflow.ingest.skippedboolThe document was left in the index unchanged.
ctxflow.ingest.skip_reasonstringWhy the document was skipped.
ctxflow.reingestboolThe run rebuilds an index that already had chunks.
ctxflow.parse.charsintLength of the parsed text, in characters.
ctxflow.chunks.countintNumber of chunks a step produced or wrote.
ctxflow.chunks.idsstring[]Ids of the chunks a step produced or wrote, as the vector store holds them (the same ones the read side emits).
ctxflow.chunks.text_hashesstring[]Write-side chunk identity: sha256 (64 hex) of the normalized text of each chunk as stored (the same hash as ctxflow.retrieval.item_hashes: Unicode NFC, whitespace runs as one space, trim), same order as ctxflow.chunks.ids. An empty string where the chunk has no text.
ValueDescription
unchanged_hashSkip reason when the source hash is already indexed.
AttributeTypeDescription
ctxflow.id_modestringHow the chunk ids of the index are produced.
enum IdMode
Enum IdMode: Which index a chunk lives in, i.e. how its id is produced.
defaultIds from the ingestion framework defaults (random).
deterministicuuid5 of source id, source version, chunker version and chunk index.
unstructuredIds from a third-party ingestion stack, not from us.
ValueDescription
ctxflowSeed of the uuid5 namespace for deterministic chunk ids.
AttributeTypeDescription
session.idstringConversation id.
owner: openinference
gen_ai.conversation.idstringConversation id, OTel GenAI name.
owner: otel-genai
user.idstringEnd user of the agent, as sent by the app.
owner: openinference
ctxflow.turnintIndex of the turn in the conversation.
ctxflow.semconv.versionstringResource attribute. The SEMCONV_VERSION of the contract the SDK was built with.
tool.namestringName of the tool called.
owner: openinference
ctxflow.action.targetstringDestination of an action without content (collection name or recipient domain, never an address).
ctxflow.action.params_hashstringHash of the action parameters as recorded on the span (gen_ai.tool.call.arguments or input.value), same rule as ctxflow.data.result_hash.
ctxflow.action.statusstringOutcome of the action (server side).
enum ActionStatus
ctxflow.tool.statusstringOutcome of the tool call (client side).
enum ActionStatus
ctxflow.agent.idstringWhich agent or workflow, from the MCP gateway token.
gen_ai.agent.idstringAgent id, OTel GenAI name.
owner: otel-genai
ctxflow.agent.backendstringAgent runtime that produced the turn (e.g. codex).
ctxflow.agent.propagatedboolTrace context and baggage were propagated to the MCP server.
ctxflow.agent.tool_calls_seenintTool calls seen in the agent events of the turn.
ctxflow.agent.events_invalidintAgent events of the turn that could not be parsed.
gen_ai.operation.namestringOTel GenAI operation name.
owner: otel-genai
n8n.execution.idstringn8n execution id; join key of the n8n connector.
owner: n8n
retrieval.documents.{i}.document.idstringId of the i-th retrieved document, as the vector store holds it.
owner: openinference
retrieval.documents.{i}.document.scoredoubleRetrieval score of the i-th retrieved document.
owner: openinference
retrieval.documents.{i}.document.metadatastringJSON metadata of the i-th retrieved document (C1 attributes, no content).
owner: openinference
Enum ActionStatus: Outcome of an action or tool call.
OKSucceeded.
ERRORFailed.
ValueDescription
x-ctxflow-id-modeHTTP header from the agent to the MCP server with the index to query.
invoke_agentgen_ai.operation.name of an agent invocation.
execute_toolgen_ai.operation.name of a tool execution.

The ctxflow.observe.* attributes and enums of this section are deprecated: no current SDK or collector produces them.

AttributeTypeDescription
ctxflow.retrieval.item_idsstring[]Read-side item identity: the id of each item the vector store returned, in order, measured at the retrieval call before any reranker, compressor or snippet; the same id as ctxflow.chunks.ids, as the vector store holds it. An empty string where the item had no id.
ctxflow.retrieval.item_hashesstring[]sha256 (64 hex) of the normalized text of each returned item (Unicode NFC, whitespace runs as one space, trimmed), same order as the ids; the same hash the write side computes. An empty string where the item had no text.
ctxflow.retrieval.item_verifiablebool[]Same order as the ids. False for an item with neither an id nor a text (for example a summary): it cannot be checked against the index and counts as neither up to date nor stale.
ctxflow.retrieval.toolboolTrue on a ctxflow tool-call span (agent.tool_call, tool.<name>, mcp.tool <name>, or a span with ctxflow.action.* attributes) whose result lists retrieved items, for example an MCP search tool: the call then counts as a retrieval call. It does not deliver chunks (those come from retrieval.documents.* and reranker.output_documents.*), and OpenInference TOOL and GenAI execute_tool spans ignore it.
ctxflow.observe.indexstringDeprecated: not produced by the current SDKs and collector.
ctxflow.observe.chunk_idstringDeprecated: not produced by the current SDKs and collector.
ctxflow.observe.opstringDeprecated: not produced by the current SDKs and collector.
enum IndexOp
ctxflow.observe.versionstringDeprecated: not produced by the current SDKs and collector.
ctxflow.observe.text_hashstringDeprecated: not produced by the current SDKs and collector.
ctxflow.observe.levelstringDeprecated: not produced by the current SDKs and collector.
enum ObserveLevel
ctxflow.observe.observed_atstringDeprecated: not produced by the current SDKs and collector.
ctxflow.observe.poll_interval_sdoubleDeprecated: not produced by the current SDKs and collector.
ctxflow.observe.config_versionstringDeprecated: not produced by the current SDKs and collector.
ctxflow.observe.resyncboolDeprecated: not produced by the current SDKs and collector.
ctxflow.observe.sincestringDeprecated: not produced by the current SDKs and collector.
ctxflow.observe.event_idstringDeprecated: not produced by the current SDKs and collector.
Enum IndexOp: Kind of change seen (index, source or rows).
insertFirst seen.
updateContent changed.
deleteRemoved.
Enum ObserveLevel: Deprecated: not produced by the current SDKs and collector.
N1Metadata only - ids, versions and C1 keys (index) or ETag/lastModified/size (source).
N2Adds a hash computed inside the customer's system (text_hash of a chunk, sha256 of an original).

ctxflow no longer judges whether the answer used a retrieved chunk (Context delivered). The ctxflow.usage span and its attributes are deprecated: no current SDK or collector produces them, and the core accepts them from older ones and ignores them. The omission kinds in the enum below are still produced, except context_ignored.

AttributeTypeDescription
ctxflow.usage.chunk_idsstring[]Deprecated: not produced by the current SDKs and collector.
ctxflow.usage.scoresdouble[]Deprecated: not produced by the current SDKs and collector.
ctxflow.usage.used_chunk_idsstring[]Deprecated: not produced by the current SDKs and collector.
ctxflow.usage.methodstringDeprecated: not produced by the current SDKs and collector.
ctxflow.usage.thresholddoubleDeprecated: not produced by the current SDKs and collector.
ctxflow.usage.completeboolDeprecated: not produced by the current SDKs and collector.
ctxflow.usage.expected_retrievalsintDeprecated: not produced by the current SDKs and collector.
ctxflow.usage.found_retrievalsintDeprecated: not produced by the current SDKs and collector.
Span nameDescription
ctxflow.usageDeprecated: not produced by the current SDKs and collector.
Enum OmissionKind: Observable context omissions computed from traces.
no_retrievalTurn without any retrieval span.
context_ignoredDeprecated: not produced by the current SDKs and collector.
tool_failedAction span with status ERROR.
stale_contextRetrieved chunk whose source changed before the turn (C6).
unattributedRetrieval or action span without session or user.
Enum Confidence: Confidence of a reconstructed link.
verifiedIds match the C1 metadata of a chunk valid at t (DB log, traceparent).
observedIds match only an earlier record of the chunk, not its C1 metadata.
unresolvedIds match nothing known.
ValueDescription
lexical-overlap-v1Deprecated: not produced by the current SDKs and collector.

The ctxflow.observe.* attributes of this section are deprecated: no current SDK or collector produces them.

AttributeTypeDescription
ctxflow.observe.sourcestringDeprecated: not produced by the current SDKs and collector.
ctxflow.observe.etagstringDeprecated: not produced by the current SDKs and collector.
ctxflow.observe.last_modifiedstringDeprecated: not produced by the current SDKs and collector.
ctxflow.observe.sizeintDeprecated: not produced by the current SDKs and collector.
Enum SourceState: Is what the agent was shown still what the source had published at t?
currentPublished hash equals the chunk source hash.
staleThe source changed or was deleted after the chunk was built.
unknownNo publication seen at t, or the span has no source hash. Never inferred.
ambiguousThe evidence does not decide at t (t inside the poll window of the deciding event, a resync gap, or two sources disagree). Never counted as current or stale.
AttributeTypeDescription
ctxflow.data.kindstringKind of client system the tool result came from.
enum DataKind
ctxflow.data.sourcestringTable or endpoint template, e.g. client.orders or GET /customers/{id}.
ctxflow.data.record_idsstring[]Primary keys or resource ids read.
ctxflow.data.record_versionsstring[]Row version or ETag of each record, same order as the ids.
ctxflow.data.record_tagsstringJSON object {id -> tags of its values, as the app sets them}.
ctxflow.data.result_hashstringsha256 (64 hex) of the result text (output.value on the span), normalized as the chunk text hashes (NFC, whitespace runs as one space, trim). Compute it with ctxflow_otel.content_hash.
ctxflow.data.query_hashstringHash of the SQL text or the request line (db.query.text or db.statement on the span), same rule as ctxflow.data.result_hash.
ctxflow.data.row_countintRows or resources returned.
ctxflow.data.truncatedboolThe row cap was hit.
ctxflow.data.statusstringOutcome of the read.
enum DataStatus
ctxflow.usage.record_idsstring[]Deprecated: not produced by the current SDKs and collector.
ctxflow.usage.used_record_idsstring[]Deprecated: not produced by the current SDKs and collector.
ctxflow.usage.stale_recordsstring[]Records that changed before the turn ended, as <read span id>:<record id>.
ctxflow.usage.unknown_recordsstring[]Records whose currency could not be determined.
Enum DataKind: Kind of client system a tool result came from.
sqlSQL database.
apiREST API.
Enum DataStatus: Outcome of a data read.
OKSucceeded with rows.
EMPTYSucceeded without rows, or 404.
DENIEDPermission denied (SQL privilege, HTTP 401/403).
ERRORAny other failure.
Enum DataOmissionKind: C5 omissions of SQL and API tool results.
empty_resultThe read succeeded and returned nothing.
truncated_resultRow cap hit, the agent saw part of the data.
permission_deniedThe role cannot read what the agent asked for.
stale_dataA record read changed before the turn ended.
tool_failedThe read failed for another reason.
context_ignoredDeprecated: not produced by the current SDKs and collector.
ValueDescription
value-match-v1Deprecated: not produced by the current SDKs and collector.
traceparentKey of the sqlcommenter tag in the database log.