A memory space groups related sessions and memories together, providing an isolation
boundary for conversational, semantic, and episodic memories in agentic applications.
Added in version v3.15.
Variables:
id (str) – The ID of the memory space.
user_id (str) – The ID of the user who owns the memory space.
tenant_id (str) – The ID of the tenant.
description (str or None) – Optional. A human-readable description.
llm_model_name (str or None) – Optional. An LLM model name associated with the memory space (maximum 200 characters).
Non-reasoning models such as gpt-4o are recommended. Reasoning-capable models are
significantly slower for fact extraction without producing meaningfully better results.
llm_base_url (str or None) – Optional. The chat API URL used for memory extraction.
The memory service uses the DataRobot LLM gateway by default; set this only when
the default does not work — for example, in air-gapped environments or when the
required LLM model is not provided by the gateway and cannot be added.
custom_instructions (str or None) – Optional. Custom prompt instructions for fact extraction (maximum 10,000 characters).
None means the default memory extraction prompt is used.
created_at (datetime.datetime) – The timestamp when the memory space was created.
description (str or None) – Optional. A human-readable description for the memory space.
llm_model_name (str or None) – Optional. An LLM model name to associate with the memory space (maximum 200 characters).
Non-reasoning models such as gpt-4o are recommended. Reasoning-capable models are
significantly slower for fact extraction without producing meaningfully better results.
llm_base_url (str or None) – Optional. Chat API URL used for memory extraction.
The memory service uses the DataRobot LLM gateway by default; set this only when
the default does not work — for example, in air-gapped environments or when the
required LLM model is not provided by the gateway and cannot be added.
custom_instructions (str or None) – Optional. Custom prompt instructions for fact extraction (maximum 10 000 characters).
If called without arguments, there is no effect. Pass None to clear a field.
Added in version v3.15.
Parameters:
description (str or None) – The new description. Pass None to clear the existing description.
llm_model_name (str or None) – The new LLM model name (maximum 200 characters). Pass None to clear an existing LLM.
Non-reasoning models such as gpt-4o are recommended. Reasoning-capable models are
significantly slower for fact extraction without producing meaningfully better results.
llm_base_url (str or None) – The new chat API URL used for memory extraction.
Pass None to clear and fall back to the DataRobot LLM gateway (the default).
Set this only when the gateway does not work — for example, in air-gapped
environments or when the required LLM model is not provided by the gateway and cannot be added.
custom_instructions (str or None) – The new custom instructions (maximum 10 000 characters). Pass None to revert to
the default memory extraction prompt.
Sessions track conversations between participants and store the sequence of
Event objects that reflect either a single message or a state.
Added in version v3.15.
Variables:
id (str) – The session ID.
participants (list of str) – IDs of the participants in this session.
description (str or None) – Optional. A human-readable description.
metadata (dict or None) – Optional. Application-defined metadata.
created_at (datetime.datetime) – The timestamp when the session was created.
lifecycle_strategies (list of dict) – The lifecycle strategy configurations attached to this session.
version (int or None) – A monotonic counter incremented by the server on every successful update.
Populated when the session is loaded from the server; None for
manually constructed instances or older servers that do not return it.
Used as the default If-Match precondition on update().
memory_space_id (str or None) – The ID of the parent memory space. This value is set automatically.
Every session must have at least one lifecycle strategy. If lifecycle_strategies
is not provided or is an empty list, the server attaches a default strategy.
Added in version v3.15.
Parameters:
memory_space_id (str) – The ID of the memory space to create the session in.
participants (list of str) – IDs of the participants in the session.
lifecycle_strategies (list of dict or None) – Optional. The lifecycle strategy configurations. When omitted, the server
applies a default strategy.
description (str or None) – Optional. A human-readable description.
metadata (dict or None) – Optional. Application-defined metadata.
If called without arguments, there is no effect. Pass None to clear a field.
By default the SDK uses version (set by a prior load) as an
optimistic-concurrency precondition. If the server’s stored version no
longer matches, it returns 409 (surfaced as
datarobot.errors.ClientError). The caller is expected to reload
the session via get() and retry.
Added in version v3.15.
Parameters:
description (str or None) – The new description. Pass None to clear.
metadata (dict or None) – The new metadata. Pass None to clear.
if_match (int or None) – Optimistic-concurrency precondition. When omitted, the SDK uses
version automatically. Pass None to opt out (legacy
last-writer-wins). Pass an integer to override the version.
When created_at is provided, the server uses it for optimistic concurrency
control. Specifically, if the event has been modified since that timestamp, the server rejects
the update. The caller must handle this error and reload the event before retrying.
Added in version v3.15.
Parameters:
sequence_id (int) – The ordinal position of the event to update.
body (dict or None) – The new event payload.
event_type (str or None) – The new event-type label.
emitter (dict or None) – The new emitter information; the type of entity that emitted the event (e.g. "agent" or "user").
created_at (datetime.datetime or None) – Optional timestamp for optimistic concurrency control.
Returns:
The updated event, or None if called with no changes.