Skip to content

Commit fb3142c

Browse files
committed
feat: include created_at timestamp in search results (closes #465)
Surface the existing filed_at metadata as created_at in search result objects returned by search_memories(). Enables temporal reasoning over search hits without additional queries.
1 parent 045023f commit fb3142c

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

mempalace/searcher.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ def search_memories(
397397
"wing": meta.get("wing", "unknown"),
398398
"room": meta.get("room", "unknown"),
399399
"source_file": Path(source).name if source else "?",
400+
"created_at": meta.get("filed_at"),
400401
"similarity": round(max(0.0, 1 - effective_dist), 3),
401402
"distance": round(dist, 4),
402403
"effective_distance": round(effective_dist, 4),

tests/test_searcher.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ def test_result_fields(self, palace_path, seeded_collection):
5151
assert "source_file" in hit
5252
assert "similarity" in hit
5353
assert isinstance(hit["similarity"], float)
54+
assert "created_at" in hit
55+
56+
def test_created_at_contains_filed_at(self, palace_path, seeded_collection):
57+
"""created_at surfaces the filed_at metadata from the drawer."""
58+
result = search_memories("JWT authentication", palace_path)
59+
hit = result["results"][0]
60+
assert hit["created_at"] == "2026-01-01T00:00:00"
5461

5562
def test_search_memories_query_error(self):
5663
"""search_memories returns error dict when query raises."""

0 commit comments

Comments
 (0)