Semantic Search
MidOS uses LanceDB with Gemini embeddings (3072-dimensional vectors) to provide semantic search across 290,000+ knowledge vectors.
Search Tools Comparison
Section titled “Search Tools Comparison”| Tool | Tier | Best For |
|---|---|---|
search_knowledge | Free | Quick keyword lookup |
semantic_search | Dev | Conceptual similarity |
hybrid_search | Dev | Best of both worlds |
smart_search | Ops | Auto-detecting best mode |
Search Modes
Section titled “Search Modes”Keyword Mode
Section titled “Keyword Mode”Fast grep-based search. Finds exact or partial text matches.
{ "name": "semantic_search", "arguments": { "query": "useEffect cleanup", "search_mode": "keyword" }}Best for: Known terms, function names, specific patterns.
Vector Mode
Section titled “Vector Mode”Pure semantic similarity. Finds conceptually related content even with completely different wording.
{ "name": "semantic_search", "arguments": { "query": "how to handle side effects when a component unmounts", "search_mode": "vector" }}Best for: Conceptual queries, “how do I…” questions, finding patterns you don’t know the name of.
Hybrid Mode (Default)
Section titled “Hybrid Mode (Default)”Combines keyword and vector search. Keyword results are checked first, then semantic results fill in gaps.
{ "name": "semantic_search", "arguments": { "query": "React hooks cleanup patterns", "search_mode": "hybrid", "rerank": true }}Best for: General-purpose searching. This is the recommended default.
Filtering by Stack
Section titled “Filtering by Stack”Narrow results to a specific technology:
{ "name": "semantic_search", "arguments": { "query": "authentication patterns", "stack": "fastapi", "top_k": 10 }}Reranking
Section titled “Reranking”When rerank: true (default), results go through a secondary relevance scoring pass. This improves precision but adds slight latency.
Disable reranking when speed matters more than precision:
{ "name": "semantic_search", "arguments": { "query": "quick lookup", "rerank": false }}Tips for Better Results
Section titled “Tips for Better Results”- Be specific: “FastAPI dependency injection with async database sessions” beats “dependency injection”
- Use natural language: The vector model understands questions better than keywords
- Try different modes: If keyword gives no results, hybrid will automatically try semantic
- Filter by stack: Reduces noise significantly when you know the technology
- Increase top_k: Set
top_k: 20when exploring a broad topic to see more variety