Skip to main content

Lite usages of lancedb.

Project description

lnclite

lnclite is a small async LanceDB document store for OpenAI-compatible embeddings. It gives you a compact API for creating a local vector database, adding documents, filtering by tags, and running semantic search.

Installation

pip install lnclite

For local development from this repository:

poetry install --all-groups

Quick Start

import asyncio

from openai import AsyncOpenAI
from openai_embeddings_model import ModelSettings

from lnclite import DocumentCreate, Lnclite, get_openai_embeddings_model


async def main():
    embeddings = get_openai_embeddings_model(
        openai_client=AsyncOpenAI(),
    )

    client = await Lnclite.new(
        lancedb_path="outputs/demo.lance",
        openai_embeddings_model=embeddings,
        model_settings=ModelSettings(dimensions=1536),
    )

    await client.documents.batch_create(
        [
            DocumentCreate(
                content="A note about async Python clients.",
                tags=["type:note", "topic:python"],
            ),
            DocumentCreate(
                content="A note about vector search and indexing.",
                tags=["type:note", "topic:search"],
            ),
        ]
    )

    await client.create_index()

    results = await client.search(
        "How should I design vector search?",
        tags_any=["topic:search"],
    )

    for result in results.results:
        print(result.document.content)
        print(result.document.tags)
        print(result.distance)


if __name__ == "__main__":
    asyncio.run(main())

Documentation

Full documentation is published with MkDocs Material from this repository's docs/ directory.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lnclite-0.1.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lnclite-0.1.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file lnclite-0.1.0.tar.gz.

File metadata

  • Download URL: lnclite-0.1.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.0 CPython/3.12.13 Darwin/25.3.0

File hashes

Hashes for lnclite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0fa9d11c35cd0ef797fc300c62d37c923d2e3cc690f1eaded1cff9b2640f62da
MD5 373b48aee94a1aceb17aef5e44af47d4
BLAKE2b-256 721c491600f05e66eed5cfa1eb08dc240f6d6788bcd81cf1e5b43d3d7dd1356b

See more details on using hashes here.

File details

Details for the file lnclite-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lnclite-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.0 CPython/3.12.13 Darwin/25.3.0

File hashes

Hashes for lnclite-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a3857b0a3507a28e5979a9284c2ba5f1b8aa95d132c9cb0b2a1611838d8cc69
MD5 d32a1f6dede170c9d4df8312aefd4686
BLAKE2b-256 1031e5d239c7ca0750595407bc4abc3b7d69e5ea945c2abb3541bc17fba2473e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page