Docs

Vector search and embeddings

Store text as embeddings in collections and find the most similar items — semantic search and retrieval-augmented generation (RAG) for your app.

Updated Oct 16, 2026

A vector collection holds items (text plus your own metadata) as embeddings. Searching it with a question returns the items closest in meaning, not just matching words — the core of semantic search, recommendations and RAG.

upsertsearchYour textarticles, tickets,docsA question"forgot my login"Embeddingtext → vectorCollectionvectors + metadataNearest itemstop K bysimilarity

Index and search

await sovaria.vector.upsert('help-articles', [
  { id: 'a1', text: 'How to reset your password', metadata: { lang: 'en' } },
  { id: 'a2', text: 'Exporting invoices as PDF', metadata: { lang: 'en' } },
])

const hits = await sovaria.vector.search('help-articles', 'I forgot my login', {
  topK: 3,
  metadataFilter: { lang: 'en' },
})

Retrieval-augmented generation

  1. Index your content

    Upsert each document (or each paragraph of long ones) with an id and metadata such as lang, product or tenant.

  2. Search with the user's question

    Take the top 3–5 hits, filtered by metadata the user may see.

  3. Answer with context

    Send the hits to your model as context. Doing this in an edge function keeps your model key on the server — see Functions.

Manage collections

vector.listCollections(), listRecords(collection), deleteRecord(collection, id) and deleteCollection(collection) (Python: vector_list_collections, vector_list_records, vector_delete_record, vector_delete_collection). Full signatures: JavaScript: Vectors and embeddings and Python: Vectors and embeddings.

Something unclear or missing on this page?Tell us