Get started ​
sh
pnpm add @anvia/core @anvia/lancedb @lancedb/lancedbts
import { retrieveDocuments } from "@anvia/core/vector-store";
import { LanceDBVectorClient } from '@anvia/lancedb';
const storeClient = new LanceDBVectorClient({
uri: 'data/lancedb'
});
const store = storeClient.vectorStore({
tableName: 'support_docs',
dimensions: 1536
});
await store.ensure();
await store.upsert({
documents: documents
});
const results = await retrieveDocuments({
store: store,
model: embeddings,
query: 'reset a password',
topK: 5
});Documents must already contain embeddings. The default URI is ~/.anvia/lancedb; use an explicit durable URI or injected connection in deployed services.
Despite the method name, ingestion ends in a LanceDB table.add() call. Re-upserting a document ID deletes its previous rows first, so stable IDs update in place; remove documents that leave the corpus with an explicit delete.