Skip to Content
We are live but in Staging 🎉

A collection is where you store vectors (embeddings) and any metadata you want to filter or return in results. In DODIL, collections live in VBase (Milvus-backed) and are created using the DODIL Python SDK.

Create a collection (quick start)

Most vector apps start with:

  • A primary key field (defaults to id)
  • A vector field (defaults to vector)
  • A known vector dimension (e.g., 768, 1024, 1536… depending on your embedding model)
  • A metric (commonly COSINE)

Here’s a minimal create call:

from dodil import Client from dodil.vbase import VBaseConfig c = Client(service_account_id="...", service_account_secret="...") vbase = c.vbase.connect( VBaseConfig( host="vbase-db-<id>.infra.dodil.cloud", port=443, scheme="https", db_name="db_<id>", ) ) collection_name = "docs_embeddings" vbase.create_collection( collection_name=collection_name, dimension=1536, # match your embedding model output metric_type="COSINE", # COSINE, L2, IP auto_id=False, # you control the id values ) print("Created:", collection_name) print("All collections:", vbase.list_collections())

What these parameters mean

  • collection_name: A stable name for your app (e.g., docs_embeddings, support_tickets, product_catalog).
  • dimension: The length of each embedding vector.
  • metric_type:
    • COSINE → semantic similarity (most common for text embeddings)
    • L2 → Euclidean distance
    • IP → inner product
  • auto_id:
    • False → you provide your own ids (recommended when you want deterministic control)
    • True → the database generates ids for you

Verify the collection

You can check whether a collection exists and inspect its settings.

exists = vbase.has_collection("docs_embeddings") print("Exists?", exists) if exists: info = vbase.describe_collection("docs_embeddings") print(info)

Next steps

Now that you have a collection, you can:

  • Insert vectors (your embeddings + metadata)
  • Build indexes for faster search
  • Search using a query vector

Continue with:

  • Insert vectors → /vbase/insert
  • Search → /vbase/search
  • Collections reference → /sdk/python/vbase
Last updated on