Skip to content

[docs] Python SDK Reference #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 27 additions & 13 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
site_name: LanceDB Documentation
site_url: https://lancedb.github.io/docs
repo_url: https://github.com/lancedb/documentation
edit_uri: https://github.com/lancedb/documentation
repo_name: lancedb/documentation
site_url: https://lancedb.com/documentation
repo_url: https://github.com/lancedb/lancedb
edit_uri: https://github.com/lancedb/lancedb
repo_name: lancedb/lancedb
docs_dir: src
watch:
- src
Expand Down Expand Up @@ -64,7 +64,7 @@ plugins:
'guides/scalar_index.md': 'guides/indexing/scalar-index.md'
'cloud/rest.md': 'api/cloud.md'
'api_reference.md': 'api/index.md'
'migration.md': 'api/api-changes.md'
'migration.md': 'api/cloud.md'
'faq.md': 'overview/faq.md'
'cloud/cloud_faq.md': 'cloud/cloud-faq.md'
'ann_indexes.md': 'guides/indexing/vector-index.md'
Expand Down Expand Up @@ -353,16 +353,30 @@ nav:
- HyDE: rag/advanced_techniques/hyde.md
- FLARE: rag/advanced_techniques/flare.md

- API & SDK Reference:
- API Reference:
- Overview: api/index.md
- API Changes: api/api-changes.md
- LanceDB Cloud REST API: api/cloud.md
- Client SDKs:
- Python SDK: python/python.md
- JavaScript SDK:
- Current SDK (@lancedb/lancedb): js/globals.md
- Legacy SDK (vectordb): javascript/modules.md
- Rust SDK: https://docs.rs/lancedb/latest/lancedb/
- Python SDK:
- Overview: python/index.md
- Connections:
- Sync: python/sync/connections.md
- Async: python/async/connections.md
- Tables & Data:
- Sync: python/sync/tables.md
- Async: python/async/tables.md
- Pydantic Data Models: python/integrations/pydantic.md
- Search & Querying:
- Sync: python/sync/querying.md
- Async: python/async/querying.md
- Indexes: python/features/indices.md
- AI & ML Features:
- Embeddings: python/integrations/embeddings.md
- Reranking: python/integrations/reranking.md
- Context: python/features/context.md
- LanceDBCloud: python/saas/index.md
- JavaScript SDK:
- Overview: js/index.md
- Rust SDK: https://docs.rs/lancedb/latest/lancedb/
- Changelog:
- LanceDB Cloud & Enterprise: changelog/lancedb-changelog.md
- ↗LanceDB Open Source: https://github.com/lancedb/lancedb/releases
Expand Down
2 changes: 1 addition & 1 deletion docs/overrides/main.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base.html" %}

{% block announce %}
<div class="custom-announce" style="text-align: center;">June 1st, 2025: We just launched <a href="https://accounts.lancedb.com/sign-up" target="_blank" style="font-weight: bold;">LanceDB Cloud - Sign up and access LanceDB for free!</a></div>
<div class="custom-announce" style="text-align: center;">We just launched <a href="https://accounts.lancedb.com/sign-up" target="_blank" style="font-weight: bold;">LanceDB Cloud Beta - Sign up for early access!</a></div>
{% endblock %}
129 changes: 0 additions & 129 deletions docs/src/api/api-changes.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/src/api/cloud.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
---
title: LanceDB Cloud REST API Specification
hide:
- navigation
---

[Return to the previous page.](index.md)

[OAD(../docs/openapi.yml)]


Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions docs/src/python/async/connections.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Connections (Asynchronous)

Connections represent a connection to a LanceDb database and can be used to create, list, or open tables.

::: lancedb.connect_async

::: lancedb.db.AsyncConnection
15 changes: 15 additions & 0 deletions docs/src/python/async/querying.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Querying (Asynchronous)

Queries allow you to return data from your database. Basic queries can be created with the [AsyncTable.query][lancedb.table.AsyncTable.query] method to return the entire (typically filtered) table. Vector searches return the rows nearest to a query vector and can be created with the [AsyncTable.vector_search][lancedb.table.AsyncTable.vector_search] method.

::: lancedb.query.AsyncQuery
options:
inherited_members: true

::: lancedb.query.AsyncVectorQuery
options:
inherited_members: true

::: lancedb.query.AsyncHybridQuery
options:
inherited_members: true
5 changes: 5 additions & 0 deletions docs/src/python/async/tables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Tables (Asynchronous)

Tables hold your actual data as a collection of records / rows.

::: lancedb.table.AsyncTable
5 changes: 5 additions & 0 deletions docs/src/python/features/context.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Context

::: lancedb.context.contextualize

::: lancedb.context.Contextualizer
13 changes: 13 additions & 0 deletions docs/src/python/features/fts.md

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lancedb.fts module is private, and it contains the deprecated Tantivy FTS implementation. I wouldn't document it going forward.

Much more interesting to document are the FullTextQuery and subclasses within query.py

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Full Text Search

This section covers the core Full Text Search (FTS) functionality in LanceDB. For building FTS queries in your application, see the [Synchronous FTS Query Builder](../sync/querying.md#lancedb.query.LanceFtsQueryBuilder) or [Asynchronous FTS Query Builder](../async/querying.md).

## Core FTS Functions

These functions provide the fundamental FTS capabilities:

::: lancedb.fts.create_index

::: lancedb.fts.populate_index

::: lancedb.fts.search_index
19 changes: 19 additions & 0 deletions docs/src/python/features/indices.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Indexes

Indices can be created on a table to speed up queries. This section lists the indices that LanceDb supports.

::: lancedb.index.BTree

::: lancedb.index.Bitmap

::: lancedb.index.LabelList

::: lancedb.index.FTS

::: lancedb.index.IvfPq

::: lancedb.index.HnswPq

::: lancedb.index.HnswSq

::: lancedb.index.IvfFlat
47 changes: 47 additions & 0 deletions docs/src/python/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Python API Reference

This section contains the API reference for the Python API. LanceDB provides both synchronous and asynchronous API clients.

## Installation

```shell
pip install lancedb
```

## Quick Start

The general flow of using the API is:

1. Use [lancedb.connect][] or [lancedb.connect_async][] to connect to a database.
2. Use the returned [lancedb.DBConnection][] or [lancedb.AsyncConnection][] to create or open tables.
3. Use the returned [lancedb.table.Table][] or [lancedb.AsyncTable][] to query or modify tables.

## API Reference

### Synchronous API
- [Connections](sync/connections.md)
- [Tables](sync/tables.md)
- [Querying](sync/querying.md)

### Asynchronous API
- [Connections](async/connections.md)
- [Tables](async/tables.md)
- [Querying](async/querying.md)

### Features
- [Embeddings](features/embeddings.md)
- [Context](features/context.md)
- [Full Text Search](features/fts.md)
- [Indices](features/indices.md)

### Integrations
- [Pydantic](integrations/pydantic.md)
- [Reranking](integrations/reranking.md)

### SaaS Integration
For information about using LanceDB with SaaS services, see the [SaaS Integration Guide](../saas/index.md).

## Common Issues

Multiprocessing with `fork` is not supported. You should use `spawn` instead.

15 changes: 15 additions & 0 deletions docs/src/python/integrations/embeddings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Embeddings

::: lancedb.embeddings.registry.EmbeddingFunctionRegistry

::: lancedb.embeddings.base.EmbeddingFunctionConfig

::: lancedb.embeddings.base.EmbeddingFunction

::: lancedb.embeddings.base.TextEmbeddingFunction

::: lancedb.embeddings.sentence_transformers.SentenceTransformerEmbeddings

::: lancedb.embeddings.openai.OpenAIEmbeddings

::: lancedb.embeddings.open_clip.OpenClipEmbeddings
7 changes: 7 additions & 0 deletions docs/src/python/integrations/pydantic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Pydantic Integration

::: lancedb.pydantic.pydantic_to_schema

::: lancedb.pydantic.vector

::: lancedb.pydantic.LanceModel
11 changes: 11 additions & 0 deletions docs/src/python/integrations/reranking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Reranking

::: lancedb.rerankers.linear_combination.LinearCombinationReranker

::: lancedb.rerankers.cohere.CohereReranker

::: lancedb.rerankers.colbert.ColbertReranker

::: lancedb.rerankers.cross_encoder.CrossEncoderReranker

::: lancedb.rerankers.openai.OpenaiReranker
Loading
Loading