Problem
jcode's MemoryTool (the LLM-callable tool exposing remember/recall/search/list/forget/tag/link/related actions) currently calls MemoryManager directly. It needs to use MempalaceAdapter when memory_backend = "mempalace" config is set, without changing the tool's external API.
Scope
Files: crates/jcode-app-core/src/tool/memory.rs, crates/jcode-config-types/src/lib.rs
-
Add config option:
// In AgentsConfig:
pub memory_backend: MemoryBackend, // default: MemoryBackend::Native
pub enum MemoryBackend {
Native, // current JSON-based MemoryManager
Mempalace, // mempalace MemoryProvider via MempalaceAdapter
}
-
Backend dispatch in MemoryTool:
enum MemoryBackend {
Native(MemoryManager),
Mempalace(MempalaceAdapter),
}
The execute() method dispatches based on which variant is active. Same 8 actions (remember, recall, search, list, forget, tag, link, related) — only the backend changes.
-
Construction: When memory_backend = "mempalace", construct MempalaceAdapter instead of MemoryManager at the tool initialization site in the tool registry.
-
TUI activity events: Wire PalaceBuilder::activity_sink() to emit jcode's MemoryActivity events so the TUI info widget continues working.
-
Feature flag: #[cfg(feature = "mempalace-backend")] gates the mempalace path.
Acceptance Criteria
Dependencies
Reference
jcode MemoryTool: crates/jcode-app-core/src/tool/memory.rs lines 10-428
jcode MemoryInput: lines 45-78
jcode action dispatch: lines 117-428
jcode tool registry: crates/jcode-app-core/src/tool/mod.rs line 245
Problem
jcode's
MemoryTool(the LLM-callable tool exposing remember/recall/search/list/forget/tag/link/related actions) currently callsMemoryManagerdirectly. It needs to useMempalaceAdapterwhenmemory_backend = "mempalace"config is set, without changing the tool's external API.Scope
Files:
crates/jcode-app-core/src/tool/memory.rs,crates/jcode-config-types/src/lib.rsAdd config option:
Backend dispatch in MemoryTool:
The
execute()method dispatches based on which variant is active. Same 8 actions (remember, recall, search, list, forget, tag, link, related) — only the backend changes.Construction: When
memory_backend = "mempalace", constructMempalaceAdapterinstead ofMemoryManagerat the tool initialization site in the tool registry.TUI activity events: Wire
PalaceBuilder::activity_sink()to emit jcode'sMemoryActivityevents so the TUI info widget continues working.Feature flag:
#[cfg(feature = "mempalace-backend")]gates the mempalace path.Acceptance Criteria
memory_backend = "native"(default) works exactly as beforememory_backend = "mempalace"delegates all 8 tool actions to MempalaceAdapter.jcode/config.jsonor env varJCODE_MEMORY_BACKENDcargo test --workspacepassesDependencies
jcode --mode rpc: strict LF-delimited JSONL protocol for IDE / external integrations #12 (MempalaceAdapter must exist)Reference
jcode MemoryTool:
crates/jcode-app-core/src/tool/memory.rslines 10-428jcode MemoryInput: lines 45-78
jcode action dispatch: lines 117-428
jcode tool registry:
crates/jcode-app-core/src/tool/mod.rsline 245