Skip to content

Add CLI client analytics and error event reporting #613

Description

@ankaisen-bot

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_id locally on first CLI use.
  • Submit events to POST /api/memu/analytics/events once 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_started
    • cli_setup_completed
    • first_memory_committed
    • first_retrieve_succeeded
    • core_action_completed
  • Track sanitized CLI errors using structured fields such as error_code, failure_stage, success, duration_ms, and recoverable.
  • 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=0 disables submissions completely.
  • Sensitive data is not included in telemetry payloads.

Priority: P2
Size: M
Schedule: Now

Metadata

Metadata

Assignees

Labels

area/analyticsProduct analytics, attribution, and measurementarea/hostsHost adapters and host CLI behaviorpriority/P2Important product improvementtype/featureNew product capability

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions