Commit c0f4c98
committed
Feat: Implement dual-mode search architecture (Phase 1)
Implements automatic mode detection and routing for CodeGraph search:
**Local Mode** (FAISS + local/ollama embeddings):
- Existing FAISS implementation extracted into faiss_search_impl()
- Used when CODEGRAPH_EMBEDDING_PROVIDER=local/ollama/lmstudio
**Cloud Mode** (SurrealDB HNSW + Jina embeddings):
- New cloud_search_impl() with basic SurrealDB integration
- Used when CODEGRAPH_EMBEDDING_PROVIDER=jina
- MVP: Returns filtered results (HNSW search + reranking TODO Phase 2)
**Mode Detection**:
- SearchMode enum (Local/Cloud)
- detect_search_mode() reads CODEGRAPH_EMBEDDING_PROVIDER
- bin_search_with_scores_shared() routes to correct implementation
**Documentation**:
- Updated .env.example with comprehensive dual-mode configuration
- Documents Local vs Cloud trade-offs
- SurrealDB connection settings for cloud mode
**Status**: Phase 1 complete, compiles successfully
**Next**: Phase 2 - SurrealDB HNSW search + Jina reranking integration1 parent b24fab2 commit c0f4c98
File tree
8 files changed
+993
-1512
lines changed- crates
- codegraph-mcp
- src
- codegraph-vector/src
- schema
8 files changed
+993
-1512
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
36 | 77 | | |
37 | 78 | | |
38 | 79 | | |
39 | 80 | | |
40 | 81 | | |
41 | 82 | | |
| 83 | + | |
42 | 84 | | |
43 | 85 | | |
44 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
| 173 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
0 commit comments