Frontmatter
| id | 8490 |
| title | Harden and Refactor ChromaDB Defrag Tool |
| state | Closed |
| labels | enhancementairefactoringbuild |
| assignees | tobiu |
| createdAt | Jan 10, 2026, 1:47 AM |
| updatedAt | Jan 10, 2026, 1:59 AM |
| githubUrl | https://github.com/neomjs/neo/issues/8490 |
| author | tobiu |
| commentsCount | 3 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 10, 2026, 1:55 AM |
Harden and Refactor ChromaDB Defrag Tool
tobiu assigned to @tobiu on Jan 10, 2026, 1:50 AM

tobiu
Jan 10, 2026, 1:51 AM
Input from tobiu:
◆ Implemented enterprise-grade improvements to the ChromaDB defragmentation tool:
- Centralized Backups: Backups are now stored in
dist/chromadb-backups/<target>/to prevent cluttering the root directory.- Retention Policy: Added automated cleanup to keep only the last 3 backups and delete those older than 7 days.
- Error Handling: The script now tracks partial failures across collections and exits with a non-zero status code if any errors occur, ensuring better CI/CD integration.
- Robustness: Added validation for database paths and configuration loading.
Refactoring complete.

tobiu
Jan 10, 2026, 1:54 AM
Input from tobiu:
◆ Added a missing
import Neo from '../src/Neo.mjs';tobuildScripts/defragChromaDB.mjs. This was necessary because the configuration files (ai/mcp/server/memory-core/config.mjs) rely on the globalNeonamespace andNeo.setupClass, which are not available in a standalone Node.js script unless explicitly imported.Verified by successfully running
npm run ai:defrag-memory.

tobiu
Jan 10, 2026, 1:55 AM
Input from tobiu:
◆ Task complete. The
defragChromaDB.mjsscript is now robust, backup-enabled, and verified working. Closing.
tobiu closed this issue on Jan 10, 2026, 1:55 AM
Improve the
buildScripts/defragChromaDB.mjstool to be more robust and enterprise-ready.Changes:
dist/chromadb-backups/<target>/to avoid polluting the root directory.Goal: Provide a reliable maintenance tool for the AI infrastructure.