semantic_search
Find conceptually similar words and related terms across text files using Word2Vec embeddings, enabling synonym and theme discovery beyond exact grep matches.
Instructions
Semantic search in text files using Word2Vec embeddings. Unlike grep, finds semantically similar words (e.g., searching "fear" also finds "anxiety", "terror", "dread").
Searches recursively in /search directory (mounted volume) for *.md files.
Use cases:
Find all mentions of a concept across files
Search for synonyms and related terms
Explore themes in documents
Response format: { "query": "search term", "total": 5, "matches": [{ "similarity": 0.85, "match": "matched text", "locations": [{ "file": "path/to/file.md", "line": 42, "context": "surrounding text" }] }] }
Matches sorted by similarity (1.0 = exact match).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>",
"model_path": "<model_path>"
},
"name": "semantic_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| glob | No | File pattern (default: *.md) | |
| query | Yes | Search query (single word recommended, phrases may crash) | |
| context | No | Lines of context around match (default: 2). Set to 0 to reduce output size. | |
| threshold | No | Similarity threshold. 0.7=strict (default), 0.5-0.6=balanced. WARNING: values below 0.5 can return MASSIVE amounts of data (millions of characters), use with caution! | |
| model_path | Yes | Path to Word2Vec model. Russian: ~/.config/semantic-grep/russian.bin, English: ~/.config/semantic-grep/english.bin | |
| ignore_case | No | Ignore case |