create_and_open_collection
Initialize a new vector collection at a specified path, define its vector and scalar fields with optional indexes, and open it for use.
Instructions
Create a new Zvec collection and open it for use.
This tool creates a new vector database collection at the specified path with the given schema definition. The collection is automatically opened and cached for subsequent operations. Use this when you need to initialize a new vector database.
Args:
params (CreateCollectionInput): Validated input parameters containing:
- path (str): Filesystem path where collection will be created (e.g., './my_vectors')
- collection_name (str): Name of the collection (also used as unique session key)
- vector_fields (List[VectorFieldInput]): Vector field definitions (required, min 1);
each field may include an optional index_param to auto-create its index
- scalar_fields (Optional[List[ScalarFieldInput]]): Scalar field definitions;
each field may also include an optional index_param
Returns: str: Success message with collection details or error message
Examples: - Use when: "Create a new collection for storing document embeddings" - Use when: "Initialize a vector database at ./embeddings with 768-dim vectors" - Don't use when: Collection already exists (use open_collection instead)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |