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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fa9d11c35cd0ef797fc300c62d37c923d2e3cc690f1eaded1cff9b2640f62da
|
|
| MD5 |
373b48aee94a1aceb17aef5e44af47d4
|
|
| BLAKE2b-256 |
721c491600f05e66eed5cfa1eb08dc240f6d6788bcd81cf1e5b43d3d7dd1356b
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a3857b0a3507a28e5979a9284c2ba5f1b8aa95d132c9cb0b2a1611838d8cc69
|
|
| MD5 |
d32a1f6dede170c9d4df8312aefd4686
|
|
| BLAKE2b-256 |
1031e5d239c7ca0750595407bc4abc3b7d69e5ea945c2abb3541bc17fba2473e
|