refactor: Remove semantic search and vector embedding functionality

Removes @xenova/transformers dependency, vector storage tables, embedding generation, and semantic search APIs. Simplifies context building to use only FTS search. Eliminates visualizer server, postinstall model download, and related CLI commands. Reduces package size and complexity while maintaining core static analysis capabilities.
This commit is contained in:
Colby McHenry
2026-04-07 14:59:48 -05:00
parent 7507605be5
commit 453c39d774
16 changed files with 12 additions and 4424 deletions
+1 -9
View File
@@ -58,10 +58,6 @@ src/
│ ├── index.ts # GraphQueryManager
│ ├── traversal.ts # GraphTraverser (BFS/DFS, impact radius)
│ └── queries.ts # High-level graph queries
├── vectors/ # Semantic search with embeddings
│ ├── index.ts # VectorManager
│ ├── embedder.ts # ONNX runtime + model loading
│ └── search.ts # Similarity search
├── context/ # Context building for AI assistants
│ ├── index.ts # ContextBuilder
│ └── formatter.ts # Markdown/JSON output formatting
@@ -83,14 +79,12 @@ src/
### Key Classes
- **CodeGraph** (`src/index.ts`): Main entry point. Lifecycle methods (`init`, `open`, `close`), indexing (`indexAll`, `sync`), graph queries (`traverse`, `getCallGraph`, `getImpactRadius`), semantic search (`semanticSearch`, `findSimilar`), context building (`buildContext`)
- **CodeGraph** (`src/index.ts`): Main entry point. Lifecycle methods (`init`, `open`, `close`), indexing (`indexAll`, `sync`), graph queries (`traverse`, `getCallGraph`, `getImpactRadius`), context building (`buildContext`)
- **ExtractionOrchestrator** (`src/extraction/index.ts`): Coordinates file scanning, parsing, and storing. Uses tree-sitter native bindings for each supported language
- **GraphTraverser** (`src/graph/traversal.ts`): BFS/DFS traversal, call graph construction, impact radius calculation, path finding
- **VectorManager** (`src/vectors/manager.ts`): Manages embeddings using `@xenova/transformers` for ONNX inference. Stores vectors in SQLite BLOB format
- **ReferenceResolver** (`src/resolution/index.ts`): Resolves unresolved references after full indexing using framework patterns, import resolution, and name matching
### Database Schema
@@ -100,7 +94,6 @@ SQLite database with:
- `edges`: Relationships (calls, imports, extends, contains, etc.)
- `files`: Tracked source files with content hashes
- `unresolved_refs`: References pending resolution
- `vectors`: Embeddings stored as BLOBs
- `nodes_fts`: FTS5 virtual table for full-text search
### Supported Languages
@@ -153,7 +146,6 @@ Tests are in `__tests__/` directory with files mirroring the module structure:
- `extraction.test.ts` - Tree-sitter parsing for all languages
- `resolution.test.ts` - Reference resolution
- `graph.test.ts` - Traversal and graph queries
- `vectors.test.ts` - Embedding and semantic search
- `context.test.ts` - Context building
- `sync.test.ts` - Incremental updates and git hooks