Skip to content

fix: skip telemetry vector store init when MEM0_TELEMETRY is disabled#4351

Merged
kartik-mem0 merged 2 commits intomainfrom
fix/skip-telemetry-vector-store-when-disabled
Mar 16, 2026
Merged

fix: skip telemetry vector store init when MEM0_TELEMETRY is disabled#4351
kartik-mem0 merged 2 commits intomainfrom
fix/skip-telemetry-vector-store-when-disabled

Conversation

@kartik-mem0
Copy link
Copy Markdown
Contributor

@kartik-mem0 kartik-mem0 commented Mar 16, 2026

Summary

  • Skip mem0migrations vector store initialization when MEM0_TELEMETRY=false
  • Applies to both Memory (sync) and AsyncMemory classes
  • No behavior change when telemetry is enabled

Description

The mem0migrations vector store was always initialized in Memory.__init__() and AsyncMemory.__init__() regardless of the MEM0_TELEMETRY setting. This collection is used exclusively for anonymous telemetry (storing a user identity for event tracking).

When MEM0_TELEMETRY=false, the vector store was created but never used — capture_event() already returns early when telemetry is disabled. This caused unnecessary overhead:

  • Remote vector stores (Qdrant Cloud, Pinecone, etc.): unnecessary network connections and collection creation on user's paid services
  • Local vector stores (FAISS, Qdrant local): unnecessary directory creation and index initialization

The fix wraps the telemetry vector store initialization behind an if MEM0_TELEMETRY: check. The existing hasattr guard in capture_event() (telemetry.py:69) already handles the case where _telemetry_vector_store doesn't exist.

Closes #4200

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Unit Test

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

kartik-mem0 and others added 2 commits March 16, 2026 14:18
The mem0migrations vector store was always initialized regardless of
the MEM0_TELEMETRY setting, creating unnecessary connections and
collections on remote vector stores for users who opted out.

Closes #4200

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kartik-mem0 kartik-mem0 merged commit 8fcf2b0 into main Mar 16, 2026
8 checks passed
jamebobob pushed a commit to jamebobob/mem0-vigil-recall that referenced this pull request Mar 29, 2026
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.

what's the use of mem0migrations when MEM0_TELEMETRY=false?

2 participants