mirror of
https://github.com/colbymchenry/codegraph.git
synced 2026-10-25 12:00:02 +08:00
feat: Always enable embeddings, remove enableEmbeddings config option
Testing showed semantic search produces significantly better results for natural language queries that Claude writes. FTS alone often ranks properties above their parent classes and misses conceptual matches. Embeddings are now always on — the vector manager is created eagerly, with model download and embedding generation still happening lazily. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
8b5622d346
commit
7e6914ddff
@@ -236,16 +236,14 @@ ${symbolIndex}`;
|
||||
|
||||
// GET /api/embeddings/status
|
||||
if (pathname === '/api/embeddings/status') {
|
||||
const config = this.cg.getConfig();
|
||||
const embeddingStats = this.cg.getEmbeddingStats();
|
||||
const isEnabled = config.enableEmbeddings === true;
|
||||
const isInitialized = this.cg.isEmbeddingsInitialized();
|
||||
const totalVectors = embeddingStats?.totalVectors ?? 0;
|
||||
const stats = this.cg.getStats();
|
||||
// Consider ready if we have vectors for at least half the eligible nodes
|
||||
const eligibleNodes = stats.nodeCount - (stats.nodesByKind.file ?? 0) - (stats.nodesByKind.import ?? 0);
|
||||
const isReady = isEnabled && totalVectors > 0 && totalVectors >= eligibleNodes * 0.5;
|
||||
json({ isEnabled, isInitialized, isReady, totalVectors, eligibleNodes });
|
||||
const isReady = totalVectors > 0 && totalVectors >= eligibleNodes * 0.5;
|
||||
json({ isEnabled: true, isInitialized, isReady, totalVectors, eligibleNodes });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -262,14 +260,7 @@ ${symbolIndex}`;
|
||||
};
|
||||
|
||||
try {
|
||||
// Step 1: Enable embeddings in config
|
||||
send('status', { phase: 'config', message: 'Enabling embeddings...' });
|
||||
const config = this.cg.getConfig();
|
||||
if (!config.enableEmbeddings) {
|
||||
this.cg.updateConfig({ enableEmbeddings: true });
|
||||
}
|
||||
|
||||
// Step 2: Initialize embedding model (downloads on first use)
|
||||
// Step 1: Initialize embedding model (downloads on first use)
|
||||
send('status', { phase: 'model', message: 'Loading embedding model (first time may download ~30MB)...' });
|
||||
await this.cg.initializeEmbeddings();
|
||||
send('status', { phase: 'model', message: 'Embedding model ready' });
|
||||
|
||||
Reference in New Issue
Block a user