Docs

Python: Vectors and embeddings

Embed text, store vectors with metadata and run similarity search with the Python SDK.

Updated Nov 12, 2026
await sovaria.vector_upsert("articles", [
    {"id": "a1", "text": "How to reset your password", "metadata": {"lang": "en"}},
    {"id": "a2", "text": "Exporting invoices as PDF", "metadata": {"lang": "en"}},
])
hits = await sovaria.vector_search("articles", "forgot my login", top_k=3, metadata_filter={"lang": "en"})

#Methods

sovaria.vector_delete_collection

Delete an entire vector collection.

await sovaria.vector_delete_collection(
    collection: str,
) -> dict[str, Any]

Parameters

collectionstrrequired

Returns

dict[str, Any]

sovaria.vector_delete_record

Delete a record from a vector collection.

await sovaria.vector_delete_record(
    collection: str,
    record_id: str,
) -> dict[str, Any]

Parameters

collectionstrrequired
record_idstrrequired

Returns

dict[str, Any]

sovaria.vector_embed

Generate embeddings for one or more texts.

await sovaria.vector_embed(texts: list[str]) -> dict[str, Any]

Parameters

textslist[str]required

Returns

dict[str, Any]

{
  "vectors": [
    [
      0.012,
      -0.044,
      "…"
    ],
    [
      0.031,
      0.007,
      "…"
    ]
  ],
  "dim": 1536,
  "count": 2,
  "model": "openai/text-embedding-3-small@1536"
}

sovaria.vector_list_collections

List vector collections in the current project scope.

await sovaria.vector_list_collections() -> dict[str, Any]

Returns

dict[str, Any]

{
  "collections": [
    {
      "name": "help-articles",
      "dim": 1536,
      "size": 2,
      "model": "openai/text-embedding-3-small@1536",
      "app_search": false
    }
  ],
  "model": "openai/text-embedding-3-small@1536",
  "semantic": true
}

sovaria.vector_list_records

List records stored in a vector collection.

await sovaria.vector_list_records(
    collection: str,
    *, limit: int | None = None,
    offset: int | None = None,
) -> dict[str, Any]

Parameters

collectionstrrequired
limitint | Noneoptionaldefault None
offsetint | Noneoptionaldefault None

Returns

dict[str, Any]

{
  "collection": "help-articles",
  "dim": 1536,
  "total": 2,
  "records": [
    {
      "id": "a1",
      "text": "How to reset your password",
      "metadata": {
        "lang": "en"
      }
    }
  ]
}

sovaria.vector_upsert

Embed and upsert documents into a vector collection.

await sovaria.vector_upsert(
    collection: str,
    docs: list[dict[str, Any]],
) -> dict[str, Any]

Parameters

collectionstrrequired
docslist[dict[str, Any]]required

Returns

dict[str, Any]

{
  "inserted": 2,
  "updated": 0,
  "dim": 1536,
  "size": 2
}