Add CLI client analytics and error event reporting
Author: ankaisen-botCreated Jul 31, 2026Updated Aug 4, 2026
Labelspriority/P2type/featurearea/hostsarea/analytics
Context
The memU CLI should report acquisition-to-activation and client-side error events through the memu-service backend ingestion API. This must be best-effort and user-controllable.
Scope
Implement v1 CLI client event reporting.
Requirements
- Generate and persist a frontend-owned
client_instance_idlocally on first CLI use. - Submit events to
POST /api/memu/analytics/eventsonce the backend issue is available. - Include
client_type=memu_cli,client_instance_id, CLI version, session id, agent platform, OS, deployment mode, install source, and memory mode where available. - Track v1 activation events:
cli_install_startedcli_setup_completedfirst_memory_committedfirst_retrieve_succeededcore_action_completed
- Track sanitized CLI errors using structured fields such as
error_code,failure_stage,success,duration_ms, andrecoverable. - Do not report API keys, prompts, memory content, retrieve queries, file paths, plaintext identity, tokens, or full stack traces.
- Support opt-out, including
MEMU_TELEMETRY=0. - Telemetry failures must never fail the core CLI command.
Acceptance Criteria
- CLI has a stable local
client_instance_id. - Supported events are submitted best-effort to the backend endpoint.
MEMU_TELEMETRY=0disables submissions completely.- Sensitive data is not included in telemetry payloads.
Priority: P2 Size: M Schedule: Now
Source: NevaMind-AI/memU