Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 14, 2026

Implements user self-description field and AI memory system with threshold-based filtering (0.1-10.0) to enable personalized, context-aware conversations.

Core Components

Memory Model (Memory.cs, MemoryManager.cs)

  • JSON-backed persistence with CRUD operations, search, and category filtering
  • Relevance scoring: score = importance + recency_decay(30d) + access_frequency
  • Auto-cleanup at 1000 memory limit, removing least relevant entries
  • Duplicate detection on import

Automatic Memory Creation (OllamaClient.cs)

  • Heuristic-based importance scoring from conversation analysis:
    • Personal info ("I am...", "my name"): 8.0
    • Preferences ("I like...", "I prefer..."): 7.0
    • Explicit markers ("remember...", "important"): 9.0
    • Recurring topics: 6.0
    • Long messages (>100 chars): 5.5
  • Only memories exceeding configured threshold are persisted
  • Top 10 relevant memories injected into AI system prompt

UI Integration (MemoryManagerForm.cs, SettingsForm.cs)

  • Memory management dialog: grid view, search, category filter, import/export
  • Settings controls: user description text field, enable toggle, threshold slider (0.1-10.0)
  • "Manage Memories..." menu item in system tray

Example Usage

// User describes themselves in Settings
settings.UserDescription = "Software developer interested in ML and hiking";
settings.EnableMemories = true;
settings.MemoryThreshold = 5.0; // Moderate filtering

// During chat, AI automatically creates memory:
// "User preference: I like hiking" (importance: 7.0) ✓ saved
// "User mentioned coffee" (importance: 3.0) ✗ below threshold

// Next conversation includes top memories in context:
// RELEVANT MEMORIES:
// - Software developer interested in ML and hiking
// - User preference: I like hiking

Storage

Memories: %APPDATA%/MSAgentAI/memories.json
Settings: %APPDATA%/MSAgentAI/settings.json

Categories: user_info, preference, important, recurring, conversation, general

Original prompt

Add user prompting, so the user can describe themselves.
Add memories so the AI can remember things in any conversation, with a threshold (0.1 to 10) of how easily it would be to create a memorable event. Memories should also be editable, addable, removable, and optional.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Jan 14, 2026
Copilot AI and others added 3 commits January 14, 2026 11:42
Co-authored-by: ExtCan <60326708+ExtCan@users.noreply.github.com>
Co-authored-by: ExtCan <60326708+ExtCan@users.noreply.github.com>
… imports

Co-authored-by: ExtCan <60326708+ExtCan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add user prompting and memories functionality Add user profile and persistent AI memory system with configurable importance threshold Jan 14, 2026
Copilot AI requested a review from ExtCan January 14, 2026 11:52
@ExtCan ExtCan marked this pull request as ready for review January 17, 2026 00:11
@ExtCan ExtCan merged commit 8777897 into main Jan 17, 2026
2 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