Quickstart
Get up and running with VecLite in minutes.
Step 1: Install
Step 2: Define Your Schema
Create a schema by defining table classes:
from veclite.schema import Table, Integer, Text
class Document(Table):
id = Integer(primary_key=True)
title = Text()
content = Text(vector=True, fts=True) # vectors + BM25
Step 3: Create Database
from veclite import Client, Schema
schema = Schema()
schema.add_table(Document)
# Nested folder with sqlite.db and vectors/
client = Client.create(schema, "rag_db")
Step 4: Insert Data
client.table("documents").insert([
{"title": "Python Guide", "content": "Learn Python programming"},
{"title": "ML Tutorial", "content": "Neural networks and deep learning"},
{"title": "Database Tips", "content": "Optimize SQL queries"},
]).execute()
Step 5: Query Data
Vector Search (semantic)
Keyword Search (BM25)
Hybrid Search (best of both)
hits = client.table("documents").hybrid_search(
query="neural network tutorial",
alpha=0.7,
topk=5
).execute()
Atomic Batch Embeddings (async)
from veclite import AsyncClient
aclient = AsyncClient.create(schema, "rag_db")
async with aclient.batch_embeddings():
await aclient.table("documents").insert([...]).execute()
What's Next?
- Search basics (overview): ../search/overview.md
- SEC filings recipe: ../recipes/sec-filings.md