Skip to content

Conversation

@harshalmore31
Copy link
Collaborator

@harshalmore31 harshalmore31 commented Dec 22, 2025

This pull request introduces comprehensive debug logging capabilities and improved observability throughout the Memori codebase. It adds user-facing documentation for enabling and controlling debug logs, implements a global mechanism for truncating sensitive or lengthy log output, and integrates detailed logging into core modules such as networking, search, and LLM integration. These enhancements make it easier for developers to troubleshoot, monitor, and understand the internal behavior of Memori.

Debug Logging Features and Documentation:

  • User documentation now includes a dedicated section on debug logging, with examples for enabling, customizing, and filtering logs, as well as controlling log truncation for sensitive or lengthy content. [1] [2] [3]
  • The Memori class and Config now support a debug_truncate option, allowing users to toggle truncation of long log content for deeper debugging. [1] [2]

Core Logging Infrastructure:

  • Added a new module memori/_logging.py providing:
    • A global truncation mechanism for debug logs (set_truncate_enabled, truncate).
    • A utility for sanitizing payloads to mask sensitive data in logs.
  • All major modules (_network.py, _search.py, llm/_base.py) now initialize a logger and use it for structured debug, info, warning, and error messages. [1] [2] [3] [4]

Enhanced Logging in Core Operations:

Networking and API:

  • Detailed debug and error logging added for all HTTP operations (GET, POST, PATCH, DELETE), including request/response status, retry/backoff logic, and error conditions such as rate limits, validation errors, and SSL/network issues. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Vector Search:

  • Logging added to trace the flow of embedding search, including database queries, FAISS index construction, dimension mismatches, and similarity results. [1] [2] [3] [4] [5] [6]

LLM Integration:

  • Logging of user queries (with truncation) and fact injection steps, improving traceability of prompt construction.

These changes collectively provide developers with granular visibility into Memori's internal processes, facilitating easier debugging and system monitoring.

@harshalmore31 harshalmore31 marked this pull request as ready for review December 22, 2025 17:40
@devwdave devwdave merged commit 71d2b02 into MemoriLabs:main Jan 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants