Loading...
Loading...
Semantic and multi-modal search across documents using LanceDB vector embeddings. Use when searching knowledge bases, finding information semantically, ingesting documents for RAG, or performing vector similarity search. Triggers on "search documents", "semantic search", "find in knowledge base", "vector search", "index documents", "LanceDB", or RAG/embedding operations.
npx skill4agent add lanej/dotfiles lancerlancerlancer# Search all tables
lancer search "how to deploy kubernetes"
# Search specific table with more results
lancer search -t docs -l 20 "authentication methods"
# Search with similarity threshold
lancer search --threshold 0.7 "error handling patterns"# Ingest a single file
lancer ingest document.md
# Ingest a directory
lancer ingest ./docs/
# Ingest multiple paths
lancer ingest file1.md file2.pdf ./images/# Ingest to specific table
lancer ingest -t my_docs document.md
# Ingest with file extension filter
lancer ingest -e md,txt,pdf ./docs/
# Ingest from stdin (pipe file paths)
find ./docs -name "*.md" | lancer ingest --stdin
# Ingest from file list
lancer ingest --files-from paths.txt
# Custom chunk size and overlap
lancer ingest --chunk-size 2000 --chunk-overlap 400 document.mdtxtmdpdfsqljpgjpegpnggifbmpwebptifftifsvgico# Default: all-MiniLM-L6-v2 (fast, good quality)
lancer ingest document.md
# Larger model for better quality
lancer ingest --text-model all-MiniLM-L12-v2 document.md
# BGE models (better semantic understanding)
lancer ingest --text-model bge-small-en-v1.5 document.md
lancer ingest --text-model bge-base-en-v1.5 document.md# Default: clip-vit-b-32 (cross-modal text/image)
lancer ingest image.jpg
# ResNet50 for image-only search
lancer ingest --image-model resnet50 image.jpg# Force CLIP for text (enables future image additions)
lancer ingest --embedding-model clip-vit-b-32 document.md
# Force BGE for performance (text-only)
lancer ingest --embedding-model BAAI/bge-small-en-v1.5 document.md# Filter by file size
lancer ingest --min-file-size 1000 --max-file-size 10000000 ./docs/
# Skip embedding generation (metadata only)
lancer ingest --no-embeddings document.md
# Custom batch size for database writes
lancer ingest --batch-size 200 ./large-dataset/
# JSON output for scripting
lancer ingest --format json document.md# Basic search
lancer search "kubernetes deployment"
# Search specific table
lancer search -t docs "authentication"
# Limit results
lancer search -l 5 "error handling"
# Set similarity threshold (0.0-1.0)
lancer search --threshold 0.6 "database migration"
# Include embeddings in results
lancer search --include-embeddings "API design"
# JSON output
lancer search --format json "machine learning"# Single filter (field:operator:value)
lancer search --filter "author:eq:John" "AI research"
# Multiple filters
lancer search \
--filter "author:eq:John" \
--filter "year:gt:2020" \
"deep learning"
# Available operators:
# eq (equals), ne (not equals)
# gt (greater than), lt (less than)
# gte (greater/equal), lte (less/equal)
# in (in list), contains (string contains)# Find recent documentation
lancer search \
-t docs \
--filter "date:gte:2024-01-01" \
-l 10 \
"API endpoints"
# Search by category
lancer search \
--filter "category:eq:tutorial" \
"getting started"
# Multi-criteria search
lancer search \
-t technical_docs \
--filter "language:eq:python" \
--filter "level:eq:advanced" \
--threshold 0.7 \
-l 15 \
"async programming patterns"# List all tables
lancer tables list
# JSON output
lancer tables list --format json# Get table details
lancer tables info my_table
# JSON output for scripting
lancer tables info my_table --format json# Delete a table (be careful!)
lancer tables delete old_table# Remove specific documents from a table
lancer remove -t docs document_id
# Remove multiple documents
lancer remove -t docs id1 id2 id3# Specify config file
lancer -c ~/.lancer/config.toml search "query"
# Set default table in config
lancer -c config.toml ingest document.md# Set default table
export LANCER_TABLE=my_docs
lancer search "query" # Searches my_docs
# Set log level
export LANCER_LOG_LEVEL=debug
lancer ingest document.md# Error only
lancer --log-level error search "query"
# Warning
lancer --log-level warn ingest document.md
# Info (default)
lancer --log-level info search "query"
# Debug
lancer --log-level debug ingest document.md
# Trace (verbose)
lancer --log-level trace search "query"# 1. Ingest markdown docs
lancer ingest -t docs -e md ./documentation/
# 2. Verify ingestion
lancer tables info docs
# 3. Test search
lancer search -t docs "installation guide"
# 4. Refine search with threshold
lancer search -t docs --threshold 0.7 -l 5 "configuration"# 1. Ingest images with CLIP model
lancer ingest -t images -e jpg,png,webp \
--image-model clip-vit-b-32 \
./photos/
# 2. Search images with text query
lancer search -t images "sunset over mountains"
# 3. Search with higher threshold for precision
lancer search -t images --threshold 0.8 "red car"# 1. Ingest with CLIP for cross-modal search
lancer ingest -t knowledge_base \
--embedding-model clip-vit-b-32 \
-e md,pdf,jpg,png \
./content/
# 2. Search text and images together
lancer search -t knowledge_base "architecture diagrams"
# 3. Filter by file type
lancer search -t knowledge_base \
--filter "file_type:eq:png" \
"system design"# 1. Generate file list
find ./corpus -type f -name "*.md" > files.txt
# 2. Ingest from list with custom settings
lancer ingest -t corpus \
--files-from files.txt \
--chunk-size 1500 \
--chunk-overlap 300 \
--batch-size 150
# 3. Verify ingestion
lancer tables info corpus
# 4. Test search quality
lancer search -t corpus -l 10 "sample query"# 1. Ingest new documents
lancer ingest -t docs ./new_docs/
# 2. Search to verify new content
lancer search -t docs "recent feature"
# 3. Remove outdated documents
lancer remove -t docs old_doc_id
# 4. Verify final state
lancer tables info docs# Fast and efficient
lancer ingest --text-model all-MiniLM-L6-v2 document.md
# Better quality
lancer ingest --text-model bge-base-en-v1.5 document.md# Cross-modal search (text queries → image results)
lancer ingest --embedding-model clip-vit-b-32 content/lancer ingest --chunk-size 500 --chunk-overlap 100 article.mdlancer ingest --chunk-size 2000 --chunk-overlap 400 book.pdflancer ingest --chunk-size 1000 --chunk-overlap 200 docs/# Separate tables by content type
lancer ingest -t api_docs ./api/*.md
lancer ingest -t tutorials ./tutorials/*.md
lancer ingest -t images ./screenshots/*.png
# Search specific context
lancer search -t api_docs "authentication endpoints"lancer search --threshold 0.4 "general topic"lancer search --threshold 0.75 "specific concept"lancer search --threshold 0.85 -l 3 "exact information"# Combine semantic search with metadata
lancer search \
--filter "status:eq:published" \
--filter "category:eq:tutorial" \
--threshold 0.6 \
"getting started guide"# JSON output for automation
lancer search --format json "query" | jq '.results[] | .path'
# List tables programmatically
lancer tables list --format json | jq '.[] | .name'# Start MCP server for Claude Desktop integration
lancer mcp
# With custom config
lancer mcp -c ~/.lancer/config.toml
# With specific log level
lancer mcp --log-level info~/Library/Application Support/Claude/claude_desktop_config.json{
"mcpServers": {
"lancer": {
"command": "lancer",
"args": ["mcp"]
}
}
}# Ingest multiple files at once
lancer ingest file1.md file2.md file3.md
# Use --stdin for large batches
find ./docs -name "*.md" | lancer ingest --stdin# Larger batches for bulk ingestion
lancer ingest --batch-size 500 ./large-corpus/
# Smaller batches for limited memory
lancer ingest --batch-size 50 ./documents/# Index metadata without generating embeddings
lancer ingest --no-embeddings ./archive/# Faster ingestion with smaller model
lancer ingest --text-model all-MiniLM-L6-v2 ./docs/
# Better quality with larger model (slower)
lancer ingest --text-model bge-base-en-v1.5 ./docs/# Lower the similarity threshold
lancer search --threshold 0.3 "query"
# Check table exists and has documents
lancer tables list
lancer tables info my_table
# Try different search terms
lancer search "alternative phrasing"# Check supported extensions
lancer ingest -e md,txt,pdf ./docs/
# Set file size limits
lancer ingest --max-file-size 100000000 ./docs/
# Use debug logging
lancer --log-level debug ingest document.pdf# Use better embedding model
lancer ingest --text-model bge-base-en-v1.5 document.md
# Adjust chunk size
lancer ingest --chunk-size 1500 --chunk-overlap 300 document.md
# Adjust search threshold
lancer search --threshold 0.6 "query"# Increase batch size
lancer ingest --batch-size 300 ./docs/
# Use faster embedding model
lancer ingest --text-model all-MiniLM-L6-v2 ./docs/
# Skip embeddings if not needed
lancer ingest --no-embeddings ./docs/# Ingestion
lancer ingest document.md # Ingest single file
lancer ingest -t docs ./directory/ # Ingest to specific table
lancer ingest -e md,pdf ./docs/ # Filter by extensions
lancer ingest --chunk-size 2000 document.md # Custom chunk size
# Search
lancer search "query" # Search all tables
lancer search -t docs "query" # Search specific table
lancer search -l 20 "query" # Limit results
lancer search --threshold 0.7 "query" # Set similarity threshold
lancer search --filter "author:eq:John" "query" # Metadata filter
# Table management
lancer tables list # List all tables
lancer tables info my_table # Table information
lancer tables delete old_table # Delete table
# Configuration
lancer -c config.toml search "query" # Use config file
lancer --log-level debug ingest doc.md # Set log level
export LANCER_TABLE=docs # Set default table
# MCP server
lancer mcp # Start MCP serverlancer search -t docs --threshold 0.7 -l 5 "how to configure authentication"lancer ingest -t test_docs document.md && \
lancer search -t test_docs "key concept from document"lancer search -t images --threshold 0.8 "sunset landscape photography"find ./docs -name "*.md" | lancer ingest -t docs --stdin && \
lancer tables info docslancer search -t technical_docs \
--filter "language:eq:rust" \
--threshold 0.75 \
-l 10 \
"async trait implementation patterns"lancer ingest document.mdlancer search "query"lancer tables listlancer search -t docs --threshold 0.7 "query"