Skip to content

Commit 6d07ea3

Browse files
committed
fix: store actual embedding model name in nodes metadata
Bug: embedding_model field in nodes table was showing hardcoded fallback 'jina-embeddings-v4' instead of the actual configured model (e.g., 'qwen3-embedding:0.6b' for Ollama). Root cause: annotate_node() function (line 2325) was not adding embedding_model to node metadata attributes, so when nodes were converted to SurrealNodeRecord, the embedding_model field remained None and fell back to schema default ('jina-embeddings-v4'). Fix: Added embedding_model from self.embedding_model (which is correctly set from config at line 474-478) to node metadata attributes at line 2347. This ensures nodes table accurately reflects which embedding provider was actually used during indexing.
1 parent 07b050a commit 6d07ea3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/codegraph-mcp/src/indexer.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2341,6 +2341,10 @@ impl ProjectIndexer {
23412341
.attributes
23422342
.insert("domain".to_string(), domain.clone());
23432343
}
2344+
// Add embedding model name for tracking which embedding provider was used
2345+
node.metadata
2346+
.attributes
2347+
.insert("embedding_model".to_string(), self.embedding_model.clone());
23442348
}
23452349

23462350
async fn persist_nodes_batch(&self, chunk: &[CodeNode]) -> Result<()> {

0 commit comments

Comments
 (0)