Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/dakera/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ async def store_memory(
tags: list[str] | None = None,
ttl_seconds: int | None = None,
expires_at: int | None = None,
valid_from: int | None = None,
) -> dict[str, Any]:
"""Store a memory for an agent.

Expand All @@ -751,6 +752,10 @@ async def store_memory(
after this many seconds from creation.
expires_at: Optional explicit expiry as a Unix timestamp (seconds).
Takes precedence over ``ttl_seconds`` when both are provided.
valid_from: Optional bi-temporal validity start as a Unix timestamp
(seconds). Indicates when this memory becomes temporally valid,
independent of ingest time. Defaults to ingest time when omitted.
Requires server v0.11.98+ (DAK-7424).
"""
data: dict[str, Any] = {"content": content, "memory_type": memory_type}
if importance is not None:
Expand All @@ -765,6 +770,8 @@ async def store_memory(
data["ttl_seconds"] = ttl_seconds
if expires_at is not None:
data["expires_at"] = expires_at
if valid_from is not None:
data["valid_from"] = valid_from
data["agent_id"] = agent_id
response = await self._request("POST", "/v1/memory/store", data=data)
# Server wraps the memory in {"memory": {...}, "embedding_time_ms": ...}
Expand Down
7 changes: 7 additions & 0 deletions src/dakera/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,7 @@ def store_memory(
tags: list[str] | None = None,
ttl_seconds: int | None = None,
expires_at: int | None = None,
valid_from: int | None = None,
) -> dict[str, Any]:
"""Store a memory for an agent.

Expand All @@ -1073,6 +1074,10 @@ def store_memory(
this many seconds from creation.
expires_at: Optional explicit expiry as a Unix timestamp (seconds).
Takes precedence over ``ttl_seconds`` when both are provided.
valid_from: Optional bi-temporal validity start as a Unix timestamp
(seconds). Indicates when this memory becomes temporally valid,
independent of ingest time. Defaults to ingest time when omitted.
Requires server v0.11.98+ (DAK-7424).
"""
data: dict[str, Any] = {"content": content, "memory_type": memory_type}
if importance is not None:
Expand All @@ -1087,6 +1092,8 @@ def store_memory(
data["ttl_seconds"] = ttl_seconds
if expires_at is not None:
data["expires_at"] = expires_at
if valid_from is not None:
data["valid_from"] = valid_from
data["agent_id"] = agent_id
response = self._request("POST", "/v1/memory/store", data=data)
# Server wraps the memory in {"memory": {...}, "embedding_time_ms": ...}
Expand Down
Loading