lance-format/lance/lance-user-guide
- community
Checking that the SKILL.md file is still in the repository.
Guide Code Agents to help Lance users write/read datasets and build/choose indices. Use when a user asks how to use Lance (Python/Rust/CLI), how to write_dataset/open/scan, how to build vector indexes (IVF_PQ, IVF_HNSW_*), how to build scalar indexes (BTREE, BITMAP, LABEL_LIST, NGRAM, INVERTED, BLOOMFILTER, RTREE, etc.), how to combine filters with vector search, or how to debug indexing and scan performance.
Install
npx vskill@latest install lance-format/lance/lance-user-guideSKILL.md
Lance User Guide
Scope
Use this skill to answer questions about:
- Writing datasets (create/append/overwrite) and reading/scanning datasets
- Vector search (nearest-neighbor queries) and vector index creation/tuning
- Scalar index creation and choosing a scalar index type for a filter workload
- Combining filters (metadata predicates) with vector search
Do not use this skill for:
- Contributing to Lance itself (repo development, internal architecture)
- File format internals beyond what is required to use the API correctly
Installation (quick)
Python:
Verify:
Rust:
Or add it to Cargo.toml (choose an appropriate version for your project):
From source (this repository):
Minimal intake (ask only what you need)
Collect the minimum information required to avoid wrong guidance:
- Language/API surface: Python / Rust / CLI
- Storage: local filesystem / S3 / other object store
- Workload: scan-only / filter-heavy / vector search / hybrid (vector + filter)
- Vector details (if applicable): dimension, metric (L2/cosine/dot), latency target, recall target
- Update pattern: mostly append / frequent overwrite / frequent deletes/updates
- Data scale: approximate row count and whether there are many small files
If the user does not specify a language, default to Python examples and provide a short mapping to Rust concepts.
Workflow decision tree
- If the question is "How do I write or update data?": use the Write playbook.
- If the question is "How do I read / scan / filter?": use the Read playbook.
- If the question is "How do I do kNN / vector search?": use the Vector search playbook.
- If the question is "Which index should I use?": consult
references/index-selection.mdand confirm constraints. - If the question is "Why is this slow / why are results missing?": use Troubleshooting and ask for a minimal reproduction.
Primary playbooks (Python)
Write
Prefer lance.write_dataset for most user workflows.
Validation checklist:
- Re-open and count rows:
lance.dataset(uri).count_rows() - Confirm schema:
lance.dataset(uri).schema
Notes:
- Use
storage_options={...}when writing to an object store URI. - If the user mentions non-atomic object stores, mention
commit_lockand point them to the user guide.
Read
Use lance.dataset + scanner(...) for pushdowns (projection, filter, limit, nearest).
Validation checklist:
- If performance is the concern, ask for a minimal
scanner(...)call that reproduces it. - If correctness is the concern, ask for the exact
filterstring and whetherprefilteris enabled (when usingnearest).
Vector search (nearest)
Run vector search with scanner(nearest=...) or to_table(nearest=...).
If combining a filter with vector search, decide whether the filter must run before the vector query:
- Use
prefilter=Truewhen the filter is highly selective and correctness (top-k among filtered rows) matters. - Use
prefilter=Falsewhen the filter is not very selective and speed matters, and accept that results can be fewer thank.
Build a vector index
Create a vector index with LanceDataset.create_index(...).
Start with a minimal working configuration:
Then verify:
ds.describe_indices()(preferred) ords.list_indices()(can be expensive)- A small
nearestquery that uses the index
For parameter selection and tuning, consult references/index-selection.md.
Build a scalar index
Scalar indices speed up scans with filters. Use create_scalar_index for a stable entry point.
Then verify:
ds.describe_indices()- A representative
scanner(filter=...)query
To choose a scalar index type (BTREE vs BITMAP vs LABEL_LIST vs NGRAM vs INVERTED, etc.), consult references/index-selection.md.
Troubleshooting patterns
"Vector search + filter returns fewer than k rows"
- Explain the difference between post-filtering and pre-filtering.
- Suggest
prefilter=Trueif the user expects top-k among filtered rows.
"Index creation is slow"
- Confirm vector dimension and
num_sub_vectors. - For IVF_PQ, call out the common pitfall: avoid misaligned
dimension / num_sub_vectors(seereferences/index-selection.md).
"Scan is slow even with a scalar index"
- Ask whether the filter is compatible with the index (equality vs range vs text search).
- Suggest checking whether scalar index usage is disabled (
use_scalar_index=False).
Local verification (when a repo checkout is available)
When answering API questions, confirm the exact signature and docstrings locally:
- Python I/O entry points:
python/python/lance/dataset.py(write_dataset,LanceDataset.scanner) - Vector indexing:
python/python/lance/dataset.py(create_index) - Scalar indexing:
python/python/lance/dataset.py(create_scalar_index)
Use targeted search:
Bundled resources
- Index selection and tuning:
references/index-selection.md - I/O and versioning cheat sheet:
references/io-cheatsheet.md - Runnable minimal example:
scripts/python_end_to_end.py
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/lance-user-guide/SKILL.md
Popularity
- Repository stars
- 6,121
- Repository forks
- 565
- 7-day trend score
- 44
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/lance-format/lance/lance-user-guide)