Metadata-Version: 2.4
Name: lnclite
Version: 0.1.0
Summary: Lite usages of lancedb.
License-Expression: MIT
License-File: LICENSE
Author: Allen Chou
Author-email: f1470891079@gmail.com
Requires-Python: >=3.11,<4
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: lancedb
Requires-Dist: openai
Requires-Dist: openai-embeddings-model
Requires-Dist: paginatic
Requires-Dist: pydantic (>=2)
Requires-Dist: xxhash
Project-URL: Homepage, https://github.com/allen2c/lnclite
Project-URL: PyPI, https://pypi.org/project/lnclite/
Project-URL: Repository, https://github.com/allen2c/lnclite
Description-Content-Type: text/markdown

# 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

```bash
pip install lnclite
```

For local development from this repository:

```bash
poetry install --all-groups
```

## Quick Start

```python
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

