Skip to content

feat: memory dashboard redesign and AI tool integration#236

Merged
dvlin-dev merged 9 commits intomainfrom
feat/memory-dashboard-redesign-and-tool-integration
Mar 16, 2026
Merged

feat: memory dashboard redesign and AI tool integration#236
dvlin-dev merged 9 commits intomainfrom
feat/memory-dashboard-redesign-and-tool-integration

Conversation

@dvlin-dev
Copy link
Copy Markdown
Owner

@dvlin-dev dvlin-dev commented Mar 16, 2026

Summary

  • Redesign Memory module from scratch: separate "Memories" (personal, about the user) from "Knowledge" (file-derived), with Connections as a derived graph lens
  • Add 4 AI tools (memory_search / memory_save / memory_update / knowledge_search) for AI-driven memory read/write during conversations
  • Inject top 30 personal memories into system prompt on conversation start
  • Fix storage download endpoint 403 signature verification bug

Changes

Data Layer

  • MemoryFact IPC type: add sourceType, factScope fields
  • ServerMemoryFact raw type separation in API client
  • IPC handler: enrichFact / enrichSearchFactItem compute factScope

UI (42 files, zero backward compat)

  • Card-based dashboard: Memories hero card + Knowledge status card + Connections compact row
  • Side panel detail for Memories/Knowledge, full-screen for Connections/Search
  • Workspace-scoped state via scopeKey, reset on switch
  • Disabled/unauthorized state handling
  • Batch delete via batchDeleteFacts API
  • AI-saved memories marked with metadata.origin='agent_tool', shown as "Saved by AI"

AI Tools

  • memory_search: semantic search, returns editable personal facts only
  • memory_save: saves with AI provenance, session-scoped workspace (write fails without session)
  • memory_update: session-scoped, update existing memories
  • knowledge_search: semantic search across workspace files
  • Per-workspace memory block cache with 1-min TTL + agent invalidation

Storage Fix

  • Download endpoint was missing @Query('contentType') and @Query('filename'), causing HMAC signature mismatch (all sync downloads returned 403)

Test plan

  • tsc --noEmit pass (node + renderer)
  • eslint 0 errors 0 warnings
  • 209 test files / 939 tests all pass (26 new tests added)
  • electron-vite build pass
  • Pre-commit hooks pass (lint-staged + typecheck + full test suite)
  • Deploy and run post-deployment validation checklist (see plan doc)

Open with Devin

Redesign the Memory module from scratch:

**Phase 1 — UI Restructure**
- Replace old dashboard (mixed facts + graph) with card-based hub layout
- Separate "Memories" (personal, about the user) from "Knowledge" (file-derived)
- Connections as derived graph lens, conditionally rendered
- Side panel navigation for Memories/Knowledge, full-screen for Connections/Search
- IPC: add sourceType, factScope to MemoryFact for future-proof domain separation
- IPC handler: enrichFact/enrichSearchFactItem compute factScope from kind
- Workspace-scoped state via scopeKey binding, reset on switch
- Design system compliant: Lucide icons, destructive confirmations, no toast/emoji

**Phase 2 — AI Tool Integration**
- memory_search: semantic search via Memory API, returns editable personal facts
- memory_save: save personal facts with metadata.origin='agent_tool' provenance
- memory_update: update existing memories, session-scoped workspace
- knowledge_search: semantic search across workspace files
- System prompt: inject top 30 personal memories on conversation start
- Tool instructions in prompt encourage proactive use
- Write tools require session-bound workspace (no active-profile fallback)
- Per-workspace memory block cache with 1-minute TTL + agent invalidation

**Also includes**: fix storage download endpoint signature verification (#403 fix)

Testing: 26 new tests across 4 suites (memory-tools, memory-prompt,
use-memory-page, memories-panel), 209 files / 939 tests all passing
devin-ai-integration[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

- Reset memoryBlockCachedAt and memoryBlockWorkspaceId when workspace
  context throws, preventing stale empty cache within TTL window
- Add loadMorePersonalFacts with page tracking for >30 memories
- Reset page counter on workspace switch
@dvlin-dev
Copy link
Copy Markdown
Owner Author

Addressed both review comments in 30ad83e:

Cache staleness fix (both @devin-ai-integration and @chatgpt-codex-connector):

  • refreshMemoryBlock error path now resets memoryBlockCachedAt = 0 and memoryBlockWorkspaceId = ''
  • Next call after workspace recovery will re-fetch immediately instead of serving stale empty cache within TTL

Personal facts pagination (@chatgpt-codex-connector):

  • Added loadMorePersonalFacts() with page tracking (personalFactsPageRef)
  • First load fetches page 1; subsequent calls append next page
  • Page counter resets on workspace switch
  • personalFactsHasMore drives the load-more UX

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

…ial load with undefined scopeKey

- refreshMemoryBlock: only overwrite cache if fresh result is non-empty
  or workspace changed; transient API failure no longer wipes valid cache
- useMemoryPage: use Symbol sentinel for prevScopeKeyRef so the effect
  fires on first mount even when scopeKey is undefined
devin-ai-integration[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

…es in-app

- refreshMemoryBlock now accepts chatId, resolves workspace from session
  first via memoryToolDeps.getWorkspaceId (prevents cross-workspace leakage)
- Search overlay file results now use openFileFromTree (in-app navigation)
  instead of desktopAPI.files.openPath (OS shell)
devin-ai-integration[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

…er on overlay close

- buildMemoryPromptBlock now accepts chatId, resolves workspace from
  session scope (fixes cross-workspace memory injection)
- Connections overlay resets graph filter via onQueryGraph() on close
chatgpt-codex-connector[bot]

This comment was marked as resolved.

… on overlay close

- isEmpty now checks overview.facts/graph counts instead of overview nullity
- Connections overlay cancels pending debounced query on close
chatgpt-codex-connector[bot]

This comment was marked as resolved.

- MemoryToolDeps adds onMemoryMutated callback
- memory_save and memory_update call it after successful writes
- Runtime resets memoryBlockCachedAt=0 so next turn refreshes
devin-ai-integration[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

…esPanel

- Reset memoryBlockCachedAt/WorkspaceId unconditionally on workspace error
- Pass hasMore + onLoadMore to MemoriesPanel with "Load more" button
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c651f8fa28

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/moryflow/pc/src/main/agent-runtime/index.ts
@dvlin-dev dvlin-dev merged commit 0124cbc into main Mar 16, 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.

1 participant