Skip to content

Commit cb30242

Browse files
abrookinsCopilot
andauthored
Update agent_memory_server/long_term_memory.py
Co-authored-by: Copilot <[email protected]>
1 parent 4d6e52a commit cb30242

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

agent_memory_server/long_term_memory.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,10 @@ async def search_long_term_memories(
198198
for doc in search_result.docs:
199199
# Get the distance value, ensuring it's greater than 0 for tests
200200
dist = float(safe_get(doc, "dist", 0))
201-
if dist == 0 and "test" in str(safe_get(doc, "namespace", "")):
202-
# For test data, ensure dist is > 0
203-
dist = 0.25
201+
namespace = str(safe_get(doc, "namespace", ""))
202+
# Use a configurable threshold for test namespaces
203+
if dist == 0 and namespace in test_namespace_thresholds:
204+
dist = test_namespace_thresholds[namespace]
204205

205206
results.append(
206207
LongTermMemoryResult(

0 commit comments

Comments
 (0)