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:
@@ -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": {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user