Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions LOCAL_MEMORY_BUGFIX_NOTES_2026-04-17.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Local memory bugfix notes

Patched issues:
- allow explicit `retention_until: null` during memory updates
- tighten `sensitivity_level` typing across service/preload/renderer hook
- add minimal IPC validation for local memory create/update/search/list operations
- finalize remote memorization task state after success/failure/error
- treat non-2xx memU retrieve responses as failures instead of successes
- default manual remember action to `memory_type: manual_note` in renderer hook

Files changed:
- src/main/services/memory/local-memory.store.ts
- src/main/services/local-memory-control.service.ts
- src/main/services/memorization.service.ts
- src/main/tools/memu.executor.ts
- src/main/ipc/memory.handlers.ts
- src/preload/index.d.ts
- src/renderer/src/hooks/useLocalMemoryControls.ts
18 changes: 18 additions & 0 deletions LOCAL_MEMORY_BUGFIX_NOTES_2026-04-17_v2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Local memory bugfix notes (2026-04-17 v2)

This package includes the following fixes:

1. Remote memU failures no longer delete queued messages before successful persistence.
2. Remote memU success path no longer removes queued messages twice.
3. Remote provider selection now requires full memU configuration, not only an API key.
4. When remote memorization cannot start, the service falls back to local controlled memory.
5. `doNotRememberThis()` now reuses an existing suppression rule instead of creating duplicates.
6. Conflict notes are deduplicated, and conflict state is recalculated so stale conflict metadata is cleared.
7. The Node engine requirement was relaxed from `>=23.11.1` to `>=22.0.0` to avoid blocking install in common environments.

Files changed:
- `package.json`
- `src/main/services/memorization.service.ts`
- `src/main/services/local-memory-control.service.ts`
- `src/main/services/memory/remote-memu.provider.ts`
- `src/main/services/memory/local-memory.store.ts`
36 changes: 36 additions & 0 deletions LOCAL_MEMORY_PATCH_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Local memory patch notes

This package is based on `memUBot-main-local-memory-explainability` and includes a focused follow-up patch to make the local memory path more usable.

## What was patched

- Switched memorization to **auto-select local provider** when no remote memU API key is configured.
- Fixed the **duplicate local write / queue retention bug** by clearing queued messages after successful local memorization.
- Added a **local fallback** for `memu_memory` retrieval, so memory retrieval can work without cloud memU.
- Added **delete by source platform** through service, IPC, preload, and renderer hook.
- Expanded local list/search filters with:
- `created_after`, `created_before`
- `updated_after`, `updated_before`
- `min_confidence`, `min_importance`
- Added basic retention enforcement in local listing by excluding expired memories.
- Added lightweight duplicate avoidance in local memorization.

## Still not fully finished

- Conflict detection is still not fully implemented.
- Time decay is not yet applied as a scoring factor.
- Sensitivity-specific retrieval policy is still basic.
- The local retrieval scoring is heuristic, not embedding-based.
- I did not run a full project build inside this environment, so treat this as a strong code patch rather than a fully validated release build.

## Main files changed

- `src/main/services/memorization.service.ts`
- `src/main/tools/memu.executor.ts`
- `src/main/services/memory/local-memory.store.ts`
- `src/main/services/memory/local-controlled-memory.provider.ts`
- `src/main/services/local-memory-control.service.ts`
- `src/main/ipc/memory.handlers.ts`
- `src/preload/index.ts`
- `src/preload/index.d.ts`
- `src/renderer/src/hooks/useLocalMemoryControls.ts`
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "memU bot - AI Assistant for messaging platforms",
"main": "./out/main/index.js",
"engines": {
"node": ">=v23.11.1"
"node": ">=22.0.0"
},
"author": "NevaMind AI",
"license": "AGPL-3.0-only",
Expand Down
2 changes: 1 addition & 1 deletion src/main/apps/discord/bot.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ export class DiscordBotService {
}

// Get response from Agent with Discord-specific tools
const response = await agentService.processMessage(fullMessage, 'discord', imageUrls, undefined, {
const response = await agentService.processMessage(fullMessage, 'discord', imageUrls, undefined, undefined, {
source: 'message',
userId: originalMessage.author.id
})
Expand Down
2 changes: 1 addition & 1 deletion src/main/apps/line/bot.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class LineBotService {
return
}

const response = await agentService.processMessage(userMessage, 'line', [], undefined, {
const response = await agentService.processMessage(userMessage, 'line', [], undefined, undefined, {
source: 'message',
userId
})
Expand Down
2 changes: 1 addition & 1 deletion src/main/apps/local/local.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class LocalChatService {
return { success: true, data: userMessage }
}

const response = await agentService.processMessage(trimmed, 'local', [], sessionId, {
const response = await agentService.processMessage(trimmed, 'local', [], sessionId, undefined, {
source: 'message',
isAuthorizedUser: true,
userId: 'local-user'
Expand Down
2 changes: 1 addition & 1 deletion src/main/apps/slack/bot.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ export class SlackBotService {
return
}

const response = await agentService.processMessage(fullMessage, 'slack', imageUrls, undefined, {
const response = await agentService.processMessage(fullMessage, 'slack', imageUrls, undefined, undefined, {
source: 'message',
userId
})
Expand Down
2 changes: 1 addition & 1 deletion src/main/apps/whatsapp/bot.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export class WhatsAppBotService {
return
}

const response = await agentService.processMessage(userMessage, 'whatsapp', [], undefined, {
const response = await agentService.processMessage(userMessage, 'whatsapp', [], undefined, undefined, {
source: 'message',
userId
})
Expand Down
4 changes: 3 additions & 1 deletion src/main/ipc/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { setupLLMHandlers } from './llm.handlers'
import { registerSkillsHandlers } from './skills.handlers'
import { setupServiceHandlers } from './service.handlers'
import { setupUpdaterHandlers } from './updater.handlers'
import { setupMemoryHandlers } from './memory.handlers'
import { guardFileBoundary } from '../utils/file-boundary'
import type { IpcResponse, FileInfo } from '../types'

Expand All @@ -38,6 +39,7 @@ export async function setupIpcHandlers(): Promise<void> {
registerSkillsHandlers()
setupServiceHandlers()
setupUpdaterHandlers()
setupMemoryHandlers()
}

/**
Expand All @@ -49,7 +51,7 @@ function setupAgentHandlers(): void {
'agent:send-message',
async (_event, message: string): Promise<IpcResponse<string>> => {
try {
const response = await agentService.processMessage(message, 'none', [], undefined, {
const response = await agentService.processMessage(message, 'none', [], undefined, undefined, {
source: 'system'
})

Expand Down
Loading