Index a directory for semantic search using odino with BGE embeddings.
Create a semantic search index for a directory using the BGE embedding model. Use this to set up searchable codebases or reindex after major changes.
/plugin marketplace add cadrianmae/claude-marketplace/plugin install semantic-search@cadrianmae-claude-marketplaceIndex a directory for semantic search using odino with BGE embeddings.
/semq:index [path] [--force]
Arguments:
path - Directory to index (optional, defaults to current directory)--force - Force reindex even if index existsodino index with BGE model (BAAI/bge-small-en-v1.5).odino/ directory with:
config.json - Configuration settingschroma_db/ - Vector database with embeddingsIndex current directory:
/semq:index
Index specific directory:
/semq:index ~/projects/myapp
Force reindex:
/semq:index --force
# Parse arguments
INDEX_PATH="."
FORCE_FLAG=""
for arg in "$@"; do
case "$arg" in
--force)
FORCE_FLAG="--force"
;;
*)
if [[ -d "$arg" ]]; then
INDEX_PATH="$arg"
else
echo "Warning: Directory not found: $arg"
fi
;;
esac
done
# Convert to absolute path
INDEX_PATH="$(cd "$INDEX_PATH" && pwd)"
echo "Indexing directory: $INDEX_PATH"
# Check if already indexed
if [[ -d "$INDEX_PATH/.odino" ]] && [[ -z "$FORCE_FLAG" ]]; then
echo ""
echo "⚠️ Directory is already indexed"
echo ""
echo "To reindex, use: /semq:index --force"
echo "To check status: /semq:status"
exit 0
fi
# Create .odinoignore if it doesn't exist
if [[ ! -f "$INDEX_PATH/.odinoignore" ]]; then
cat > "$INDEX_PATH/.odinoignore" << 'EOF'
# Build artifacts
build/
dist/
*.pyc
__pycache__/
# Dependencies
node_modules/
venv/
.venv/
.virtualenv/
# Config and secrets
.env
.env.local
*.secret
.git/
# IDE
.vscode/
.idea/
*.swp
*.swo
# OS
.DS_Store
Thumbs.db
EOF
echo "Created .odinoignore file"
fi
# Run indexing with BGE model
echo ""
echo "Indexing with BGE model (this may take a moment)..."
echo ""
(cd "$INDEX_PATH" && odino index $FORCE_FLAG --model BAAI/bge-small-en-v1.5)
if [[ $? -eq 0 ]]; then
echo ""
echo "✅ Indexing complete!"
echo ""
echo "You can now search with:"
echo " /semq:search <query>"
else
echo ""
echo "❌ Indexing failed"
echo ""
echo "Troubleshooting:"
echo "- Ensure odino is installed: pipx install odino"
echo "- Check disk space"
echo "- Try again with --force flag"
fi
Indexing directory: /home/user/project
Created .odinoignore file
Indexing with BGE model (this may take a moment)...
Indexed 63 files
Generated 142 chunks (529.5 KB)
Model: BAAI/bge-small-en-v1.5
✅ Indexing complete!
You can now search with:
/semq:search <query>
Use /semq:index when:
The command automatically creates .odinoignore to exclude:
Customize .odinoignore for your project:
# Project-specific ignores
generated/
*.min.js
vendor/
The command uses BAAI/bge-small-en-v1.5 by default:
Why BGE?
.odino/config.json (16 for GPU, 8 for CPU)"Command not found: odino"
pipx install odino
GPU out of memory
# Edit .odino/config.json after first index
{
"embedding_batch_size": 8 # or 4
}
# Then reindex
/semq:index --force
Slow indexing
# BGE model is already the fastest option
# But you can reduce batch size if needed
# Edit .odino/config.json: "embedding_batch_size": 8
/semq:status - Check index status/semq:search <query> - Search the index/semq:here <query> - Search with traversalAfter indexing, configuration is stored in .odino/config.json:
{
"model_name": "BAAI/bge-small-en-v1.5",
"embedding_batch_size": 16,
"chunk_size": 512,
"chunk_overlap": 50
}
Edit this file to change settings, then reindex with --force.