memorix_deduplicate: LLM analysis not implemented despite tool description and config support
Summary
The memorix_deduplicate tool description states:
"Scan active memories for duplicates, contradictions, and outdated information using LLM analysis."
However, after investigating the source code (src/memory/consolidation.ts), the deduplication logic is purely heuristic-based (Jaccard token similarity), with no LLM integration whatsoever. The tool always outputs [heuristic] tags regardless of whether an LLM API key is properly configured.
Environment
- Memorix version: 1.0.4
-
- LLM provider: OpenRouter (confirmed working via
/api/v1/auth/key)
- LLM provider: OpenRouter (confirmed working via
-
-
- Config:
memorix.ymlwithllm.provider: openrouter,.envwith validMEMORIX_LLM_API_KEY
- Config:
-
-
-
-
- MCP host also injects
MEMORIX_LLM_API_KEYvia env
- MCP host also injects
-
-
Steps to Reproduce
- Configure Memorix with a valid OpenRouter API key
-
- Store several observations with semantic overlap but different wording
-
-
- Run
memorix_deduplicate(withdryRun: trueorfalse)
- Run
-
-
-
-
- Observe that all results are tagged
[heuristic]- no OpenRouter API calls are made Verified by checking OpenRouter Logs dashboard: no API calls were triggered by the deduplicate command.
- Observe that all results are tagged
-
-
Expected Behavior
When an LLM API key is configured and memorix_deduplicate is called:
- Semantic dedup: Use LLM to detect observations that mean the same thing but use different wording
-
- Contradiction detection: Identify memories that conflict with each other
-
- Outdated info detection: Flag memories that may be superseded by newer information
These capabilities are described in the tool's own description but not implemented in
consolidation.ts.
- Outdated info detection: Flag memories that may be superseded by newer information
These capabilities are described in the tool's own description but not implemented in
Current Behavior
consolidation.tsuses only Jaccard similarity on tokenized text-
- No LLM client is imported or called in the deduplication path
-
-
- GitHub code search for "deduplicate" in the repo returns 0 file matches
-
-
-
-
- The
memorix_store-> Formation Pipeline DOES call the LLM (confirmed via OpenRouter logs), butmemorix_deduplicatedoes not
- The
-
-
Suggestion
The heuristic approach works well for obvious text-level duplicates, but two high-value capabilities - contradiction detection and outdated information flagging - fundamentally require LLM reasoning and cannot be achieved with token similarity alone.
A possible approach:
- Keep heuristic as the fast first pass (current behavior)
-
- When LLM is configured, run a second pass on heuristic candidates + borderline cases for semantic analysis
-
-
- Add a dedicated contradiction/staleness scan that sends observation pairs to the LLM Token cost would be minimal (~$0.001-0.003 per dedup run with GPT-4o-mini).
-
Related
- Formation Pipeline already successfully uses LLM via the configured API key
-
- The
memorix_consolidatetool has the same limitation (heuristic only)
- The
Thanks for the detailed report. This was valid against 1.0.4, but it is no longer accurate on current main / v1.0.5. We re-verified memorix_deduplicate through the real HTTP MCP tools/call path (not just direct source invocation): initialize -> ools/list -> memorix_session_start -> memorix_deduplicate, and the tool now reaches the LLM-backed deduplication path when LLM is enabled. We also fixed a related doctor runtime-reporting issue so the active LLM mode is reported correctly in the CLI. Closing this as resolved in the current release.