Skip to main content
Agent runs and transcript groups support arbitrary key-value metadata. Updates use deep merge — nested dictionaries are merged recursively, preserving existing keys. See Metadata for more on how metadata works in Docent.

Agent Run Metadata

Get Metadata

from docent import Docent

client = Docent()

metadata = client.get_agent_run_metadata("my-collection-id", "run-id-123")
print(metadata)  # {"model": "gpt-4", "score": 0.95}
collection_id
str
required
ID of the collection containing the agent run.
agent_run_id
str
required
ID of the agent run.

Update Metadata

Deep-merges new metadata into existing values.
updated = client.update_agent_run_metadata(
    "my-collection-id",
    "run-id-123",
    {"evaluated": True, "reviewer": "alice"},
)
collection_id
str
required
ID of the collection.
agent_run_id
str
required
ID of the agent run.
metadata
dict
required
Metadata to merge. Nested dicts are merged recursively; non-dict values are overwritten.
Returns the full merged metadata dictionary.

Delete Metadata Keys

metadata, not_found = client.delete_agent_run_metadata_keys(
    "my-collection-id",
    "run-id-123",
    keys=["reviewer", "config.temperature"],
)
collection_id
str
required
ID of the collection.
agent_run_id
str
required
ID of the agent run.
keys
list[str]
required
Keys to remove. Supports dot-delimited paths for nested keys (e.g., "config.model").
Returns a tuple of (metadata_after_deletion, keys_not_found).

Transcript Group Metadata

Transcript groups share the same metadata API pattern as agent runs.

Get Metadata

metadata = client.get_transcript_group_metadata("my-collection-id", "group-id-456")
collection_id
str
required
ID of the collection.
transcript_group_id
str
required
ID of the transcript group.

Update Metadata

updated = client.update_transcript_group_metadata(
    "my-collection-id",
    "group-id-456",
    {"label": "high-quality"},
)
collection_id
str
required
ID of the collection.
transcript_group_id
str
required
ID of the transcript group.
metadata
dict
required
Metadata to merge.

Delete Metadata Keys

metadata, not_found = client.delete_transcript_group_metadata_keys(
    "my-collection-id",
    "group-id-456",
    keys=["label"],
)
collection_id
str
required
ID of the collection.
transcript_group_id
str
required
ID of the transcript group.
keys
list[str]
required
Keys to remove. Supports dot-delimited paths.