Skip to content

Feature request: User profile learning — build and maintain user preference patterns over time #1283

Description

@ZeR020

Motivation

Codemem excels at capturing and retrieving session memories, but it doesn't build a long-term understanding of the user themselves — their preferences, recurring patterns, and typical workflows. A user profile that evolves over time would complement the existing memory system by providing persistent context about who the user is and how they work, independent of any specific session or project.

Proposed Feature

A user profile learning system that:

  1. Analyzes conversation patterns over time — periodically examines captured memories and session data to extract user preferences, recurring patterns, and common workflows.

  2. Maintains a structured profile with three categories:

    • Preferencescategory, description, confidence (0-1), evidence[] (memory IDs supporting it), lastUpdated
    • Patterns — recurring behaviors with frequency tracking
    • Workflows — multi-step sequences the user regularly follows, with steps[] and frequency
  3. Stores profile data in a dedicated table (e.g., user_profiles + user_profile_changelogs for version tracking) with profile_data as JSON, version, total_prompts_analyzed, and is_active fields.

  4. Injects profile context alongside memory packs — when building a pack for prompt injection, include a concise summary of the user's profile so the AI agent can tailor its responses to known preferences.

  5. Exposes profile via CLI and web viewercodemem profile show / codemem profile update commands, and a profile tab in the web viewer.

Implementation Notes

  • The observer model (already configurable via observer_provider/observer_model) could be reused for profile extraction — run periodic profile analysis as a background job, similar to how raw events are processed.
  • Profile updates should be versioned with a changelog (change_type: added/updated/removed, change_summary, profile_data_snapshot) so users can review what changed and when.
  • Confidence scoring per preference, backed by evidence (memory IDs), ensures transparency — users can see why a preference was inferred.

Reference

opencode-mem (tickernelz/opencode-mem) implements a similar feature in src/services/user-profile/user-profile-manager.ts with UserProfileData = { preferences, patterns, workflows } stored in a dedicated user-profiles.db. This could serve as a design reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions