JohnXu22786/semantic-search ↗★ 2
dsh-semantic-search
A DeepSeek Harness (dsh) plugin for local semantic code search. Builds a fragment-level index of a workspace (symbol-aware chunking for many languages), computes local embeddings (lightweight lexical TF-IDF feature vectors by default, or a configurable OpenAI-compatible embedding endpoint), and answers natural-language queries with hybrid retrieval (vector cosine + BM25, fused with reciprocal-rank fusion). Ships dsh tools sema_search / sema_reindex / sema_stats plus a stand-alone CLI.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:JohnXu22786/semantic-search说明文档
阅读完整 README ↗CLI usage
sema index build the full index from the workspace
sema reindex [--full] incremental refresh (or full rebuild with --full)
sema search hybrid vector + BM25 search, prints top hits
sema stats [--json] index health, provider, and sizing numbers
Global options:
--root workspace root (default: current directory)
--data-dir index storage directory (default: /.sema)
--provider embedding provider: lexical | openai (default: lexical)
--dim embedding dimension (lexical default: 4096; openai 0 = auto)
--base-url OpenAI-compatible embeddings endpoint base URL
--model embeddings model name (openai only)
--api-key API key (openai only; env: SEMA_EMBEDDING_API_KEY)
--top hits to print for search (default: 20)
--json machine-readable output where supported
--help show this help
CLI exit codes
0— success (including a search with zero hits and a--version/--helpcall).1— a runtime failure (config error, build/index/search error).2— a usage error: unknown command, unknown flag, or a missing query.
Configuration
The plugin is configurable through the bundle row's config (see
cordis.patch.yml for an example), the CLI flags above, or defaults in code:
| Option | Default | Meaning |
|---|---|---|
root | cwd | workspace root to index |
dataDir | .sema | index storage directory |
provider.kind | lexical | lexical (offline) or openai |
provider.dimension | 0 (lexical: 4096) | embedding dimension; 0 = auto-infer from the endpoint |
provider.baseUrl | https://api.openai.com/v1 | OpenAI-compatible endpoint root |
provider.model | text-embedding-3-small | embedding model name |
provider.apiKeyEnv | SEMA_EMBEDDING_API_KEY | env var holding the API key |
allowFallback | true | fall back to the lexical provider when a remote one fails |
include / ignore | defaults | glob sets of files to index / skip |
maxLinesPerChunk | 80 | hard chunk size upper bound |
nGram | 2 | CJK n-gram size (1 disables n-gramming) |
topK | 20 | hits returned by default |
rrfK | 60 | RRF fusion constant |
vectorK | 300 | candidates per channel before fusion |
autosave | true | persist the index after builds |
autoIndex | true | build lazily on first search |
watch | true | watch the workspace for changes |