create_vector_table

Use the create vector table operation to create a new vector table for storing vectors and metadata.

The operation creates a vector table with a fixed schema optimized for vector search. The table includes columns for ID, vector data, and JSON metadata. You can configure automatic ID generation, embedding integration, and index parameters during creation.

Note: Integrated embedding simplifies application development, but embedding is performed using database compute and adds processing time to operations that provide text instead of vectors.

Parameters

Parameter Type Value Range Required Default Description Notes
name str Valid vector table identifier Yes No default Name of the vector table to create. The table must not already exist in the database schema.
comment str Valid string No None Human-readable description of the vector table. Returned as comment in table metadata.
annotations dict Object or NULL No None Table-level annotation metadata. Use a Python dict for logical or descriptive metadata. Must be valid JSON-serializable metadata.
table_params dict Object or NULL No None Table-level creation parameters. Use this object for creation controls such as auto_generate_id. Currently supports auto_generate_id.
embed_params dict Object or NULL No None Automatic embedding configuration for integrated embedding tables. Omit for bring-your-own-vector tables.
index_params dict Object or NULL No None Vector and metadata index configuration. Defaults are applied when omitted.
debug_flags dict Object or NULL No None Debug or tracing flags for detailed logging. Optional; omit unless diagnostics are needed.

table_params fields

Field Type Value Range Required Description Notes
auto_generate_id bool true, false No Allows VecDB to generate IDs when an inserted or loaded row omits id. Defaults to false; set to true only when input rows can omit id.

Raises Exception – InvalidTableNameFormatError may be raised when the table name is invalid. The operation can also fail if the table already exists, the caller is unauthorized, or the request is invalid.

Create table for pre-computed vectors

table = client.create_vector_table(
    name="product_vectors",
    comment="Product embeddings",
    table_params={"auto_generate_id": True},
    index_params={
        "vector_index_params": {
            "auto_index": True,
            "organization": "PARTITIONS",
            "distance_metric": "COSINE",
        }
    },
)
print(table)

Create integrated embedding vector table

Performance consideration: With integrated embedding, text is embedded inline by the embedding model loaded in Oracle AI Database. Embedding therefore uses database CPU resources and adds embedding time to upsert, load, and query operations. For embedding-intensive or latency-sensitive workloads, consider generating embeddings separately, for example, with OCI Generative AI and supplying precomputed vectors.

table = client.create_vector_table(
    name="documents",
    table_params={"auto_generate_id": True},
    embed_params={
        "model": "all_MiniLM_L12_v2",
        "embed_metadata_jsonpath": "content",
    },
)
print(table)

Create table for bring-your-own vectors with manual indexing

table = client.create_vector_table(
    name="customer_vectors",
    comment="Manually managed vector table",
    index_params={
        "vector_index_params": {
            "auto_index": False,
        }
    },
)
print(table)

Return type VectorTableResponse

Returns JSON response containing the created table details and status. Example response:

{
    "table_name": "DEMO_PRODUCTS",
    "owner": "VECTOR3",
    "status": "Empty",
    "vector_type": "dense",
    "vector_table_type": "BYOV",
    "index_params": {
        "vector_index_params": {
            "auto_index": true,
            "organization": "PARTITIONS",
            "advanced_params": {
                "partitions": 10
            }
        },
        "parallel_creation": 4
    },
    "annotations": {
        "metric": "cosine",
        "dimension": "5"
    },
    "created": "2026-03-12T11:21:30Z"
}