Skip to content

Commit a43246d

Browse files
committed
feat: Force full KB sync on startup (#8414)
1 parent 2592c1a commit a43246d

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

ai/mcp/server/knowledge-base/services/DatabaseService.mjs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -192,20 +192,12 @@ class DatabaseService extends Base {
192192
await ChromaManager.ready();
193193

194194
logger.info('[Startup] Checking knowledge base status...');
195-
const knowledgeBasePath = aiConfig.dataPath;
196-
const kbExists = await fs.pathExists(knowledgeBasePath);
197195

198196
try {
199197
if (aiConfig.data.autoSync) {
200-
if (!kbExists) {
201-
logger.info('[Startup] Knowledge base file not found. Starting full synchronization...');
202-
await this.syncDatabase();
203-
logger.info('✅ [Startup] Full synchronization complete.');
204-
} else {
205-
logger.info('[Startup] Knowledge base file found. Starting embedding process...');
206-
await this.embedKnowledgeBase();
207-
logger.info('✅ [Startup] Embedding process complete.');
208-
}
198+
logger.info('[Startup] Starting full synchronization (Create + Embed)...');
199+
await this.syncDatabase();
200+
logger.info('✅ [Startup] Full synchronization complete.');
209201
}
210202
} catch (error) {
211203
logger.warn('⚠️ [Startup] Knowledge base synchronization/embedding failed:', error.message);

0 commit comments

Comments
 (0)