AI-powered semantic search using Voyage AI embeddings and SQLite vector similarity search (VSS). Enables natural language search over command history, documentation, and error solutions.
- Voyage AI API key (get one at https://www.voyageai.com/)
- SQLite VSS extension (bundled with the server)
Add VOYAGE_API_KEY to your MCP server config:
{
"macos-shell": {
"env": {
"VOYAGE_API_KEY": "pa-YOUR-KEY-HERE"
}
}
}Or set it as an environment variable:
export VOYAGE_API_KEY="pa-YOUR-KEY-HERE"To verify initialization, check the server logs for:
Semantic search initialized
Embedding service initialized with voyage-3.5-lite
Search command history by intent rather than exact text.
Parameters:
query(required): natural language description of what you want to findlimit(optional): max results (default: 10)min_similarity(optional): minimum similarity score 0-1 (default: 0.3)session(optional): filter to a specific session
Example:
{"query": "deploy to production", "limit": 5}Search command documentation using semantic similarity.
Parameters:
query(required): what you want to learn aboutlimit(optional): max results (default: 5)command_filter(optional): filter to a specific command (e.g., "git", "docker")
Example:
{"query": "how to list files", "command_filter": "ls"}Indexes 70+ common commands across file management, git, docker, network, and system categories.
Get command suggestions based on intent and historical patterns.
Parameters:
intent(required): what you want to accomplishmax_recommendations(optional): max results (default: 5)min_confidence(optional): minimum confidence 0-1 (default: 0.4)session(optional): session for context
Recommendations factor in historical success rate, usage frequency, temporal patterns, and working directory context.
Find solutions for error messages from the knowledge base.
Parameters:
error_message(required): the error textlimit(optional): max results (default: 3)min_similarity(optional): minimum similarity 0-1 (default: 0.6)
Covers errors in categories: network, filesystem, process, git, docker.
Extract patterns, insights, and suggestions from command output.
Parameters:
command(required): the command that was executedstdout(required): standard outputstderr(optional): standard errorexit_code(required): exit codeduration_ms(optional): duration in millisecondscwd(optional): working directory
Detects output types (structured, error, success, informational) and extracts URLs, file paths, error codes, warnings, process IDs, and port numbers.
Get statistics about the semantic search system. Takes no parameters.
Returns command count, embeddings generated, cache hit rate, average search latency, and initialization status.
Uses voyage-3.5-lite with 512 dimensions, 8192 token context, and asymmetric query/document embedding. Cost is $0.016 per 1M tokens.
Queries use query input type; indexed content uses document input type. These exist in different embedding spaces, so similarity scores of 30-50% are typical for good matches.
SQLite with sqlite-vss extension, stored at ~/.macos-shell/embeddings/vectors.db. Three vector stores: command history, documentation, and error solutions. Uses cosine similarity for search.
| Tool | Default | Notes |
|---|---|---|
| semantic_command_search | 0.3 | Lower for broader results |
| search_documentation | 0.3 | Optimized for query-to-document |
| error_solution_lookup | 0.6 | Higher for precise matches |
| recommend_commands | 0.4 | Balanced confidence |
Score interpretation: 0.8-1.0 very high, 0.6-0.8 high, 0.4-0.6 moderate, 0.3-0.4 low.
- First embedding call: 300-500ms (API request)
- Cached embedding: <1ms (LRU cache, 1-hour TTL)
- Vector search: 5-15ms
- Cold search total: 300-500ms
- Warm search total: 150-200ms
Embedding cache uses LRU eviction with 1-hour TTL and 1000 entry capacity. Keys are SHA-256 hashes. Typical hit rate is around 68%.
- Test your API key:
curl https://api.voyageai.com/v1/embeddings -H "Authorization: Bearer YOUR_KEY" -H "Content-Type: application/json" -d '{"input": ["test"], "model": "voyage-3.5-lite"}' - Try lowering
min_similarity(e.g., 0.2) - Check
semantic_search_stats-- ifcommandCountis 0, run some commands first - Check server logs for initialization errors
- Verify
VOYAGE_API_KEYis set in your config - Check network connectivity to
api.voyageai.com - Free tier rate limit is 300 requests/minute
Scores of 30-50% for good matches are expected behavior. Voyage AI uses different embedding spaces for queries and documents, so scores are lower than same-type comparisons.
rm -f ~/.macos-shell/embeddings/vectors.db*
# Restart the server to re-initialize- Embedding cost: ~10,000 commands per $1.60, caching reduces cost by ~70%
- Database: ~2KB per command, no automatic cleanup
- Optimized for English commands and documentation
- No graceful degradation if Voyage AI is unavailable