Skip to content

Commit c98ebe1

Browse files
committed
Remove some logging/prints
1 parent 2647e0a commit c98ebe1

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

agent_memory_server/api.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,12 @@ async def put_working_memory(
308308
if user_id is not None:
309309
memory.user_id = user_id
310310

311-
# Validate that all structured memories have id (if any)
312-
for mem in memory.memories:
313-
if not mem.id:
311+
# Validate that all long-term memories have id (if any)
312+
for long_term_mem in memory.memories:
313+
if not long_term_mem.id:
314314
raise HTTPException(
315315
status_code=400,
316-
detail="All memory records in working memory must have an ID",
316+
detail="All long-term memory records in working memory must have an ID",
317317
)
318318

319319
# Handle summarization if needed (before storing) - now token-based
@@ -453,17 +453,13 @@ async def search_long_term_memory(
453453
# Extract filter objects from the payload
454454
filters = payload.get_filters()
455455

456-
print("Long-term search filters: ", filters)
457-
458456
kwargs = {
459457
"distance_threshold": payload.distance_threshold,
460458
"limit": payload.limit,
461459
"offset": payload.offset,
462460
**filters,
463461
}
464462

465-
print("Kwargs: ", kwargs)
466-
467463
kwargs["text"] = payload.text or ""
468464

469465
# Pass text and filter objects to the search function (no redis needed for vectorstore adapter)
@@ -568,8 +564,6 @@ async def memory_prompt(
568564
redis = await get_redis_conn()
569565
_messages = []
570566

571-
print("Received params: ", params)
572-
573567
if params.session:
574568
# Use token limit for memory prompt, fallback to message count for backward compatibility
575569
if params.session.model_name or params.session.context_window_max:

agent_memory_server/cli.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@
2121
from agent_memory_server.utils.redis import ensure_search_index_exists, get_redis_conn
2222

2323

24-
configure_logging()
25-
logger = get_logger(__name__)
24+
# Don't configure logging at module level - let each command handle it
25+
def _get_logger():
26+
"""Get logger instance after ensuring logging is configured."""
27+
configure_logging()
28+
return get_logger(__name__)
29+
2630

2731
VERSION = "0.2.0"
2832

@@ -113,7 +117,7 @@ async def setup_and_run():
113117

114118
# Run the MCP server
115119
if mode == "sse":
116-
logger.info(f"Starting MCP server on port {port}\n")
120+
_get_logger().info(f"Starting MCP server on port {port}\n")
117121
await mcp_app.run_sse_async()
118122
elif mode == "stdio":
119123
# Try to force all logging to stderr because stdio-mode MCP servers

agent_memory_server/vectorstore_adapter.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -832,16 +832,12 @@ async def search_memories(
832832
score_threshold = 1.0 - distance_threshold
833833
search_kwargs["score_threshold"] = score_threshold
834834

835-
print("Search kwargs: ", search_kwargs)
836-
837835
search_results = (
838836
await self.vectorstore.asimilarity_search_with_relevance_scores(
839837
**search_kwargs
840838
)
841839
)
842840

843-
print("Search results: ", search_results)
844-
845841
# Convert results to MemoryRecordResult objects
846842
memory_results = []
847843
for i, (doc, score) in enumerate(search_results):

0 commit comments

Comments
 (0)