// Use semantic search to find relevant code and documentation when user asks about specific functionality, features, or implementation patterns. Automatically invoke when user asks "where is...", "how does... work", "find code that...", or similar conceptual queries. More powerful than grep for concept-based searches. Uses odino CLI with BGE embeddings for fully local semantic search.
| name | semantic-search |
| description | Use semantic search to find relevant code and documentation when user asks about specific functionality, features, or implementation patterns. Automatically invoke when user asks "where is...", "how does... work", "find code that...", or similar conceptual queries. More powerful than grep for concept-based searches. Uses odino CLI with BGE embeddings for fully local semantic search. |
| allowed-tools | Bash, Read |
Enable natural language semantic search across codebases and notes using odino CLI with BGE embeddings. Unlike grep (exact text matching) or glob (filename patterns), semantic search finds code by what it does, not what it's called.
Automatically invoke semantic search when the user:
Do not use for:
Odino requires running commands from the directory containing .odino/ config. To make this transparent (like git), use this helper function:
# Function to find .odino directory by traversing up the directory tree
find_odino_root() {
local dir="$PWD"
while [[ "$dir" != "/" ]]; do
if [[ -d "$dir/.odino" ]]; then
echo "$dir"
return 0
fi
dir="$(dirname "$dir")"
done
return 1
}
# Usage in commands
if ODINO_ROOT=$(find_odino_root); then
echo "Found index at: $ODINO_ROOT"
(cd "$ODINO_ROOT" && odino query -q "$QUERY")
else
echo "No .odino index found in current path"
echo "Suggestion: Run /semq:index to create an index"
fi
Why this matters:
.odino/ lives)Before searching, verify an index exists:
if ODINO_ROOT=$(find_odino_root); then
(cd "$ODINO_ROOT" && odino status)
else
echo "No index found. Suggest running /semq:index"
fi
# Basic search
odino query -q "authentication logic"
# With directory traversal
if ODINO_ROOT=$(find_odino_root); then
(cd "$ODINO_ROOT" && odino query -q "$QUERY")
fi
Odino returns results in a formatted table:
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ File ┃ Score ┃ Content ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ knowledge/Search Algorithms.md │ 0.361 │ 1 --- │
│ │ │ 2 tags: [todo/stub] │
│ │ │ 3 module: CMPU 4010 │
│ │ │ ... │
│ │ │ 7 # Search Algorithms in AI │
│ │ │ ... │
└─────────────────────────────────┴──────────┴─────────────────────────────────┘
Found 2 results
Enhanced workflow:
Transform user requests into better semantic queries with realistic output examples.
User asks: "error handling"
Inferred query: error handling exception management try catch validation
Sample odino output:
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ File ┃ Score ┃ Content ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ knowledge/Error Handling.md │ 0.876 │ 1 --- │
│ │ │ 2 tags: [software-eng, best- │
│ │ │ 3 --- │
│ │ │ 4 # Error Handling │
│ │ │ 5 │
│ │ │ 6 Error handling is the proc │
│ │ │ 7 runtime errors gracefully │
│ │ │ 8 system stability. │
│ │ │ 9 │
│ │ │ 10 ## Key Concepts │
│ │ │ 11 - Try-catch blocks for syn │
│ │ │ 12 - Promise rejection handli │
│ │ │ 13 - Input validation to prev │
│ │ │ 14 - Logging errors for debug │
│ │ │ 15 - User-friendly error mess │
│ │ │ 16 │
│ │ │ 17 ## Best Practices │
│ │ │ 18 1. Fail fast - validate ea │
│ │ │ 19 2. Log with context - incl │
│ │ │ 20 3. Don't swallow errors - │
└─────────────────────────────────┴──────────┴─────────────────────────────────┘
User asks: "DB connection code" Inferred query:
database connection pooling setup
import mysql.connector
pool = mysql.connector.pooling.MySQLConnectionPool(
pool_name="mypool",
pool_size=5,
host="localhost",
database="mydb"
)
connection = pool.get_connection()
Sample odino output:
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ File ┃ Score ┃ Content ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ src/db/connection.js │ 0.924 │ 1 const mysql = require('mys │
│ │ │ 2 │
│ │ │ 3 // Create connection pool │
│ │ │ 4 const pool = mysql.createP │
│ │ │ 5 host: process.env.DB_HOS │
│ │ │ 6 user: process.env.DB_USE │
│ │ │ 7 password: process.env.DB │
│ │ │ 8 database: process.env.DB │
│ │ │ 9 waitForConnections: true │
│ │ │ 10 connectionLimit: 10, │
│ │ │ 11 queueLimit: 0 │
│ │ │ 12 }); │
│ │ │ 13 │
│ │ │ 14 // Test connection │
│ │ │ 15 pool.getConnection((err, c │
│ │ │ 16 if (err) { │
│ │ │ 17 console.error('DB conn │
│ │ │ 18 process.exit(1); │
│ │ │ 19 } │
│ │ │ 20 console.log('Connected t │
└─────────────────────────────────┴──────────┴─────────────────────────────────┘
User asks: "BFS algorithm in Python" Inferred query:
breadth first search BFS graph traversal queue
def bfs(graph, start):
visited = set()
queue = [start]
while queue:
node = queue.pop(0)
if node not in visited:
visited.add(node)
queue.extend(graph[node])
return visited
Sample odino output:
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ File ┃ Score ┃ Content ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ knowledge/Search Algorithms.md │ 0.891 │ 1 --- │
│ │ │ 2 tags: [ai, algorithms] │
│ │ │ 3 module: CMPU 4010 AI │
│ │ │ 4 --- │
│ │ │ 5 # Search Algorithms in AI │
│ │ │ 6 │
│ │ │ 7 Algorithms for finding sol │
│ │ │ 8 problem spaces. Used in pa │
│ │ │ 9 game AI, and optimization. │
│ │ │ 10 │
│ │ │ 11 ## Types │
│ │ │ 12 │
│ │ │ 13 ### Uninformed Search │
│ │ │ 14 - **BFS**: Explores level │
│ │ │ 15 - **DFS**: Explores deeply │
│ │ │ 16 - **Uniform Cost**: Expand │
│ │ │ 17 │
│ │ │ 18 ### Informed Search │
│ │ │ 19 - **A***: Uses heuristic + │
│ │ │ 20 - **Greedy**: Only conside │
│ │ │ 21 - **Hill Climbing**: Local │
└─────────────────────────────────┴──────────┴─────────────────────────────────┘
pool.get_connection()Find code by describing what it does, not exact text:
User asks: "Where is the database connection handling?"
Workflow:
find_odino_root)odino query -q "database connection handling"Example:
if ODINO_ROOT=$(find_odino_root); then
RESULTS=$(cd "$ODINO_ROOT" && odino query -q "database connection handling")
# Parse results, read top files, summarize
else
echo "No index found. Would you like me to index this directory?"
fi
Verify indexing status before operations:
if ODINO_ROOT=$(find_odino_root); then
(cd "$ODINO_ROOT" && odino status)
# Shows: indexed files, model, last update
else
echo "No .odino index found"
fi
Semantic search → code-pointer:
# After finding relevant file
echo "Found authentication logic in src/auth/middleware.js:42"
echo "Opening file..."
code -g src/auth/middleware.js:42
Semantic search → grep refinement:
# Use semantic search to find the area
odino query -q "API endpoint handlers"
# Then use grep for exact matches in those files
grep -n "app.get\|app.post" src/routes/*.js
No index found:
if ! ODINO_ROOT=$(find_odino_root); then
echo "No semantic search index found in current path."
echo ""
echo "To create an index, run:"
echo " /semq:index"
echo ""
echo "This will index the current directory for semantic search."
fi
Empty results:
if [[ -z "$RESULTS" ]]; then
echo "No results found for query: $QUERY"
echo ""
echo "Suggestions:"
echo "- Try a different query (more general or specific)"
echo "- Verify the index is up to date (/semq:status)"
echo "- Consider using grep for exact text matching"
fi
This skill provides several slash commands for explicit control:
/semq:search <query> - Search indexed codebase/semq:here <query> - Search with automatic directory traversal/semq:index [path] - Index directory for semantic search/semq:status [path] - Show indexing status and statsfind_odino_root before search operationsGood queries are conceptual, not literal:
❌ "config.js" → Use glob instead
✅ "configuration loading logic"
❌ "validateEmail" → Use grep instead
✅ "email validation functions"
❌ "class AuthService" → Use grep instead
✅ "authentication service implementation"
Model: BAAI/bge-small-en-v1.5 (33M params, ~133MB)
Vector DB: ChromaDB (stored in .odino/chroma_db/)
Index location: .odino/ directory in project root
Embedding batch size: 16 (GPU) or 8 (CPU)
For detailed information, see:
references/cli_basics.md - Odino CLI syntax, commands, and optionsreferences/search_patterns.md - Effective query examples and tipsreferences/integration.md - Workflows with code-pointer, grep, globLoad these references as needed for deeper technical details or complex use cases.