Skip to main content
This reference is auto-generated from SDK docstrings. Run python scripts/generate_api_docs.py to regenerate.
All types are Python dataclasses with slots=True. Each has a from_api class method that constructs the object from an API response dict.

Memory

Returned by query_memories and contained in AugmentedTask.memories.
@dataclass(slots=True)
class Memory:
    id: str
    task: str
    reflection: str
    q_value: float
    similarity: float
    score: float
    success: bool | None = None
FieldTypeDescription
idstrUnique memory identifier.
taskstrThe past task this memory reflects on.
reflectionstrThe learned reflection text.
q_valuefloatLearned Q-value from reviews (higher = more successful).
similarityfloatEmbedding similarity to the query.
scorefloatBlended ranking score (similarity + Q-value).
success`boolNone`True/false from past reviews, or None if unreviewed.

AugmentedTask

Returned by augment_with_memories.
@dataclass(slots=True)
class AugmentedTask:
    augmented_task: str
    memories: list[Memory]
FieldTypeDescription
augmented_taskstrThe original task with formatted memory blocks appended.
memorieslist[Memory]List of Memory objects that were used.

TraceSubmission

Returned by create_trace and create_trace_async.
@dataclass(slots=True)
class TraceSubmission:
    id: str
    ingest_status: str
FieldTypeDescription
idstrUnique trace identifier.
ingest_statusstr"queued" when an inline review is pending background processing, or "completed" when no review was included.

Trace

Returned by get_trace, list_traces, review_trace, wait_for_trace, and create_trace_and_wait.
@dataclass(slots=True)
class Trace:
    id: str
    task: str
    trajectory: list[dict[str, Any]]
    final_response: str
    retrieved_memory_ids: list[str]
    review_status: str
    ingest_status: str
    ingest_attempts: int = 0
    last_ingest_error: str | None = None
    model: str | None = None
    metadata: dict[str, Any] = field(default_factory=dict)
    created_memory_id: str | None = None
    review: Review | None = None
FieldTypeDescription
idstrUnique trace identifier.
taskstrThe task that was executed.
trajectorylist[dict[str, Any]]List of message dicts (e.g. role/content).
final_responsestrThe model’s final response.
retrieved_memory_idslist[str]IDs of memories used.
review_statusstr”pending” or “reviewed”.
ingest_statusstr”queued”, “processing”, “completed”, or “failed”.
ingest_attemptsintNumber of ingestion attempts so far.
last_ingest_error`strNone`Error message if ingestion failed.
model`strNone`Optional model name.
metadatadict[str, Any]Optional key-value metadata.
created_memory_id`strNone`ID of reflection created after review, if any.
review`ReviewNone`Attached Review if reviewed.

Review

Nested in Trace.review.
@dataclass(slots=True)
class Review:
    id: str
    trace_id: str
    result: str
    feedback_text: str | None = None
    mode: str = 'deferred'
FieldTypeDescription
idstrUnique review identifier.
trace_idstrID of the traced run.
resultstr”success” or “failure”.
feedback_text`strNone`Optional human feedback.
modestr”inline” or “deferred”.

ApiKeyInfo

Returned by list_api_keys, revoke_api_key, and nested in CreatedApiKey.key.
@dataclass(slots=True)
class ApiKeyInfo:
    id: str
    public_id: str
    label: str
    scopes: list[str]
    environment: str
    status: str
    is_master: bool = False
    created_at: str | None = None
    last_used_at: str | None = None
    revoked_at: str | None = None
FieldTypeDescription
idstrInternal key identifier.
public_idstrPublic portion of the key (safe to display).
labelstrHuman-readable label.
scopeslist[str]Granted scopes (e.g. memory:read, trace:write).
environmentstr"live" or "test".
statusstr"active" or "revoked".
is_masterboolWhether this is a master key with access to all projects.
created_at`strNone`ISO 8601 creation timestamp.
last_used_at`strNone`ISO 8601 last-use timestamp.
revoked_at`strNone`ISO 8601 revocation timestamp.

CreatedApiKey

Returned by create_api_key.
@dataclass(slots=True)
class CreatedApiKey:
    api_key: str
    key: ApiKeyInfo
FieldTypeDescription
api_keystrPlaintext API key (only shown once at creation time).
keyApiKeyInfoKey metadata.

BootstrapInfo

Returned by ReflectClient.bootstrap.
@dataclass(slots=True)
class BootstrapInfo:
    user_id: str
    project_id: str
    api_key: str
FieldTypeDescription
user_idstrCreated user ID.
project_idstrCreated project ID.
api_keystrPlaintext admin API key.