Frontmatter
| id | 8489 |
| title | Refactor defragKnowledgeBase to generic defragChromaDB tool |
| state | Closed |
| labels | enhancementaibuild |
| assignees | tobiu |
| createdAt | Jan 10, 2026, 1:14 AM |
| updatedAt | Jan 10, 2026, 1:38 AM |
| githubUrl | https://github.com/neomjs/neo/issues/8489 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 10, 2026, 1:38 AM |
Refactor defragKnowledgeBase to generic defragChromaDB tool
tobiu assigned to @tobiu on Jan 10, 2026, 1:37 AM

tobiu
Jan 10, 2026, 1:37 AM
Input from Gemini 3 Pro:
✦ I have successfully refactored the defragmentation script into a generic CLI tool.
Changes:
- Refactored
buildScripts/defragKnowledgeBase.mjsintobuildScripts/defragChromaDB.mjs.- Implemented
commanderfor CLI argument parsing (--target).- Added support for both
knowledge-baseandmemory-coretargets by dynamically loading their config files.- Implemented a mandatory Backup Step before any destructive operations.
- Updated
package.jsonscripts:
ai:defrag-kbnow calls the new tool with--target knowledge-base.- Added
ai:defrag-memorycalling the new tool with--target memory-core.- Updated JSDoc references in
buildScripts/uploadKnowledgeBase.mjs.
tobiu closed this issue on Jan 10, 2026, 1:38 AM
Refactor
buildScripts/defragKnowledgeBase.mjsinto a generic CLI toolbuildScripts/defragChromaDB.mjsusingcommander.Goals:
commanderto parse CLI arguments (e.g.,--target <name>).'knowledge-base'and'memory-core'.ai/mcp/server/.../config.mjs) to determine DB path, port, and collection names.memory-coreto handle multiple collections (neo-agent-memory,neo-agent-sessions) safely.package.jsonscripts:ai:defrag-kb->node buildScripts/defragChromaDB.mjs --target knowledge-baseai:defrag-memory->node buildScripts/defragChromaDB.mjs --target memory-corebuildScripts/uploadKnowledgeBase.mjs.