feat: add ids to archival memory search [LET-6642] (#8355)

* feat: add id to archival memory search tool

* stage api
This commit is contained in:
Ari Webb
2026-01-06 15:51:20 -08:00
committed by Caren Thomas
parent 4ee267a57c
commit 956e7783ad
4 changed files with 9 additions and 3 deletions

View File

@@ -24532,6 +24532,11 @@
},
"ArchivalMemorySearchResult": {
"properties": {
"id": {
"type": "string",
"title": "Id",
"description": "Unique identifier of the archival memory passage"
},
"timestamp": {
"type": "string",
"title": "Timestamp",
@@ -24552,7 +24557,7 @@
}
},
"type": "object",
"required": ["timestamp", "content"],
"required": ["id", "timestamp", "content"],
"title": "ArchivalMemorySearchResult"
},
"Archive": {

View File

@@ -217,7 +217,7 @@ async def archival_memory_search(
top_k: Maximum number of results to return (default: 10)
Returns:
A list of relevant memories with timestamps and content, ranked by similarity.
A list of relevant memories with IDs, timestamps, and content, ranked by similarity.
Examples:
# Search for project discussions

View File

@@ -456,6 +456,7 @@ class CreateArchivalMemory(BaseModel):
class ArchivalMemorySearchResult(BaseModel):
id: str = Field(..., description="Unique identifier of the archival memory passage")
timestamp: str = Field(..., description="Timestamp of when the memory was created, formatted in agent's timezone")
content: str = Field(..., description="Text content of the archival memory passage")
tags: List[str] = Field(default_factory=list, description="List of tags associated with this memory")

View File

@@ -2461,7 +2461,7 @@ class AgentManager:
# Use ISO format if no timezone is set
formatted_timestamp = str(timestamp) if timestamp else "Unknown"
result_dict = {"timestamp": formatted_timestamp, "content": passage.text, "tags": passage.tags or []}
result_dict = {"id": passage.id, "timestamp": formatted_timestamp, "content": passage.text, "tags": passage.tags or []}
# Add relevance metadata if available
if metadata: