Skip to content

Commit 4225b24

Browse files
committed
fix: remove FAISS requirement from ai-enhanced feature
Changes: - ai-enhanced no longer requires faiss (only needs embeddings) - Added ai-enhanced-faiss for backward compatibility - Fixed cloud_search_impl feature gate (cloud not embeddings) - Unconditionally import std::time::Instant (used in non-FAISS code) This allows building agentic tools without FAISS system library. Agentic tools only use SurrealDB, not FAISS vector search.
1 parent ac81405 commit 4225b24

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

crates/codegraph-mcp/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ embeddings-jina = ["embeddings", "codegraph-vector/jina"]
9393
cloud = ["embeddings-jina", "codegraph-graph/surrealdb"]
9494
server-http = ["dep:axum", "dep:hyper", "dep:tower", "dep:http-body-util"]
9595
qwen-integration = []
96-
ai-enhanced = ["dep:codegraph-ai", "faiss", "embeddings"]
96+
ai-enhanced = ["dep:codegraph-ai", "embeddings"]
97+
ai-enhanced-faiss = ["ai-enhanced", "faiss"]
9798
autoagents-experimental = ["dep:autoagents", "dep:autoagents-derive"]
9899
legacy-mcp-server = []

crates/codegraph-mcp/src/server.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use serde_json::Value;
88
#[cfg(any(feature = "faiss", feature = "legacy-mcp-server"))]
99
use std::path::PathBuf;
1010
use std::sync::Arc;
11-
#[cfg(any(feature = "faiss", feature = "cloud", feature = "legacy-mcp-server"))]
1211
use std::time::Instant;
1312

1413
// Performance optimization: Cache FAISS indexes and embedding generator
@@ -1197,14 +1196,14 @@ pub async fn bin_search_with_scores_shared(
11971196

11981197
match mode {
11991198
SearchMode::Cloud => {
1200-
#[cfg(feature = "embeddings")]
1199+
#[cfg(feature = "cloud")]
12011200
{
12021201
cloud_search_impl(_query, _paths, _langs, _limit, _graph).await
12031202
}
1204-
#[cfg(not(feature = "embeddings"))]
1203+
#[cfg(not(feature = "cloud"))]
12051204
{
12061205
Err(anyhow::anyhow!(
1207-
"Cloud mode requires embeddings feature. Rebuild with --features embeddings"
1206+
"Cloud mode requires cloud feature. Rebuild with --features cloud"
12081207
))
12091208
}
12101209
}

0 commit comments

Comments
 (0)