Skip to content

hsml.deployment_memory_config #

DeploymentMemoryConfig #

Memory an agent deployment is given, for an agent that configures none itself.

The agent SDK applies this only when the agent passed no memory store of its own, so code always wins: an agent that built one keeps it, and one that deliberately passed none stays without memory.

The policy names the tiers: working memory is the conversation kept server-side, short-term memory folds older turns into a rolling summary, semantic memory keeps what the agent decides to remember across conversations, and episodic memory searches what was said before. All of them are on unless you say otherwise, except the summarizer, which has nothing to fold with until a provider is named.

ms = project.get_model_serving()

agent = ms.deploy_agent(
    entry="my_agent.py",
    memory=DeploymentMemoryConfig(
        summarize={"provider": "hopsworks", "deployment": "my-llm"},
        long_term=True,
    ),
)
PARAMETER DESCRIPTION
enabled

Whether the deployment configures memory at all. Defaults to True.

TYPE: bool | None DEFAULT: True

summarize

Which model folds older turns into the rolling summary, as a dict with a provider of hopsworks, openai or anthropic. The Hopsworks provider names an LLM deployed in the same project with deployment and needs no key; the others take an optional model, api_key_secret and base_url. None keeps every turn verbatim.

TYPE: dict[str, Any] | str | None DEFAULT: None

long_term

Whether the agent keeps what it decides to remember across conversations. This is the store the remember / recall / forget tools write to, scoped to the person it is talking to by default, or to one conversation. On by default; pass False to leave semantic memory out.

TYPE: bool | None DEFAULT: True

search

Semantic search over the person's past conversations, as a dict naming an embedding model from the project's model registry, or {} for the SDK's default. Implies long_term. On by default; pass False to search by keyword instead.

TYPE: dict[str, Any] | bool | None DEFAULT: True

summarize_after_messages

Messages before older turns are folded.

TYPE: int | None DEFAULT: None

keep_recent_messages

Messages left verbatim by a fold. Must be smaller than summarize_after_messages.

TYPE: int | None DEFAULT: None

message_retention_days

Days a recorded conversation is kept. None keeps it.

TYPE: int | None DEFAULT: None

max_messages

How many of a conversation's messages the agent is handed on a turn. The window the model reads, not a retention rule: older messages stay recorded and readable through the conversation routes. None leaves the agent SDK's own default.

TYPE: int | None DEFAULT: None

enabled property writable #

Whether the deployment configures memory at all.

keep_recent_messages property writable #

Messages left verbatim by a fold.

long_term property writable #

Whether what the agent remembers is kept across conversations.

max_messages property writable #

How many of a conversation's messages the agent is handed on a turn.

message_retention_days property writable #

Days a recorded conversation is kept.

search property writable #

Semantic search over the person's past conversations.

summarize property writable #

Which model folds older turns into the rolling summary.

summarize_after_messages property writable #

Messages before older turns are folded.

describe #

describe()

Print a JSON description of the memory configuration.