Create
In order to create a collection, call thecreate() method on the client.collections() object:
Schema
Opt-in schema
TopK is schemaless-by-default. Fields without types can store any value. When types are specified, data is validated during upsert.Indexed fields require explicit types.
Field types
Nested objects are automatically treated as structs — no need to use
struct() explicitly.Required fields
Fields are optional by default. Addrequired() to make them mandatory—required fields must be present in every document during upsert. Documents missing a required field are rejected with a validation error.
Indexes
Only indexed fields can be searched. Non-indexed fields support exact-match filters only.Vector Index
Used for vector search. Supports dimensions up to 2^14. Enabled byvector_index().
Multi-Vector Index
Enables multi-vector search onmatrix() fields using the maxsim metric for late-interaction scoring. Enabled by multi_vector_index(). See multi-vector search for more information.
Keyword Index
Traditional text search with BM25 relevance scoring. Fast keyword matching with no embedding overhead. Enabled bykeyword_index().
Semantic Index
Convenience method for automatic embeddings. Enabled bysemantic_index().
List
You can list all collections in a project by callingclient.collections().list():
list() function returns a list of Collection objects:
Get
You can get a specific collection in a project by callingclient.collections().get(name):
get() function takes the name of a collection and returns a single Collection object.
Delete
Once you decide that you no longer need a collection or that you want to start over, you can delete it. Deleting a collection will remove all the documents and indexes associated with it. To delete a collection, call theclient.collections().delete(name) method: