This issue consolidates several related changes aimed at improving the stability and usability of the AI infrastructure SDK.
1. Fix ChromaDB Embedding Function Warning
The ChromaDB client emits a persistent warning ("No embedding function configuration found") because our dummyEmbeddingFunction was too simple and flagged as "legacy".
- Change: Update
dummyEmbeddingFunction in ai/mcp/server/*/config.mjs to fully implement the IEmbeddingFunction interface (adding name, getConfig, buildFromConfig) with clear intent-driven comments explaining why.
2. Enable Database Backup/Restore via SDK
The Memory_DatabaseService was not exposed in the public SDK, preventing agents from programmatically triggering backups.
- Change: Export
Memory_DatabaseService in ai/services.mjs.
- Change: Update
Memory_DatabaseService to allow optional paths for export, defaulting to the config.
- Change: Fix relative path issues in
ai/mcp/server/memory-core/config.mjs by using __dirname to ensure backups work regardless of the execution context (npm run vs node).
3. Refactor Import Logic
- Change: Update
importDatabase in Memory_DatabaseService to cleanly handle collection clearing (replace mode) without using ternary operators, improving readability.
4. Cleanup Example Scripts
- Change: Remove redundant
LifecycleService.ready() calls in ai/examples/self-healing.mjs (since ChromaManager.ready() now handles it).
- New Artifacts: Add
ai/examples/db-backup.mjs and ai/examples/db-restore.mjs as working proofs of the new SDK capabilities.
This issue consolidates several related changes aimed at improving the stability and usability of the AI infrastructure SDK.
1. Fix ChromaDB Embedding Function Warning The ChromaDB client emits a persistent warning ("No embedding function configuration found") because our
dummyEmbeddingFunctionwas too simple and flagged as "legacy".dummyEmbeddingFunctioninai/mcp/server/*/config.mjsto fully implement theIEmbeddingFunctioninterface (addingname,getConfig,buildFromConfig) with clear intent-driven comments explaining why.2. Enable Database Backup/Restore via SDK The
Memory_DatabaseServicewas not exposed in the public SDK, preventing agents from programmatically triggering backups.Memory_DatabaseServiceinai/services.mjs.Memory_DatabaseServiceto allow optional paths for export, defaulting to the config.ai/mcp/server/memory-core/config.mjsby using__dirnameto ensure backups work regardless of the execution context (npm run vs node).3. Refactor Import Logic
importDatabaseinMemory_DatabaseServiceto cleanly handle collection clearing (replace mode) without using ternary operators, improving readability.4. Cleanup Example Scripts
LifecycleService.ready()calls inai/examples/self-healing.mjs(sinceChromaManager.ready()now handles it).ai/examples/db-backup.mjsandai/examples/db-restore.mjsas working proofs of the new SDK capabilities.