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
| Field | Type | Description | |
|---|
id | str | Unique memory identifier. | |
task | str | The past task this memory reflects on. | |
reflection | str | The learned reflection text. | |
q_value | float | Learned Q-value from reviews (higher = more successful). | |
similarity | float | Embedding similarity to the query. | |
score | float | Blended ranking score (similarity + Q-value). | |
success | `bool | None` | 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]
| Field | Type | Description |
|---|
augmented_task | str | The original task with formatted memory blocks appended. |
memories | list[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
| Field | Type | Description |
|---|
id | str | Unique trace identifier. |
ingest_status | str | "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
| Field | Type | Description | |
|---|
id | str | Unique trace identifier. | |
task | str | The task that was executed. | |
trajectory | list[dict[str, Any]] | List of message dicts (e.g. role/content). | |
final_response | str | The model’s final response. | |
retrieved_memory_ids | list[str] | IDs of memories used. | |
review_status | str | ”pending” or “reviewed”. | |
ingest_status | str | ”queued”, “processing”, “completed”, or “failed”. | |
ingest_attempts | int | Number of ingestion attempts so far. | |
last_ingest_error | `str | None` | Error message if ingestion failed. |
model | `str | None` | Optional model name. |
metadata | dict[str, Any] | Optional key-value metadata. | |
created_memory_id | `str | None` | ID of reflection created after review, if any. |
review | `Review | None` | 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'
| Field | Type | Description | |
|---|
id | str | Unique review identifier. | |
trace_id | str | ID of the traced run. | |
result | str | ”success” or “failure”. | |
feedback_text | `str | None` | Optional human feedback. |
mode | str | ”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
| Field | Type | Description | |
|---|
id | str | Internal key identifier. | |
public_id | str | Public portion of the key (safe to display). | |
label | str | Human-readable label. | |
scopes | list[str] | Granted scopes (e.g. memory:read, trace:write). | |
environment | str | "live" or "test". | |
status | str | "active" or "revoked". | |
is_master | bool | Whether this is a master key with access to all projects. | |
created_at | `str | None` | ISO 8601 creation timestamp. |
last_used_at | `str | None` | ISO 8601 last-use timestamp. |
revoked_at | `str | None` | ISO 8601 revocation timestamp. |
CreatedApiKey
Returned by create_api_key.
@dataclass(slots=True)
class CreatedApiKey:
api_key: str
key: ApiKeyInfo
| Field | Type | Description |
|---|
api_key | str | Plaintext API key (only shown once at creation time). |
key | ApiKeyInfo | Key metadata. |
BootstrapInfo
Returned by ReflectClient.bootstrap.
@dataclass(slots=True)
class BootstrapInfo:
user_id: str
project_id: str
api_key: str
| Field | Type | Description |
|---|
user_id | str | Created user ID. |
project_id | str | Created project ID. |
api_key | str | Plaintext admin API key. |