Skip to main content

Vector Tables

Vector tables link a source database table to its vector representation, defining which columns to embed and how to store the results.

Create Vector Table

POST /v1/vector-tables

Request Body:

FieldTypeRequiredDescription
namestringYesVector table name (1-100 chars)
connection_idstringYesSource database connection
embedding_provider_idstringConditionalRequired for managed mode and PostgreSQL platform mode
source_tablestringYesSource table name in the database
primary_key_columnstringYesPrimary key column in source table
columnsarrayYesColumn configuration (at least one embedding column)
embedding_modelstringYesEmbedding model name
embedding_dimensionsintegerYesVector dimensions
modestringNomanaged (default) or platform
sync_modestringNobatch (default) or cdc

Column Configuration

FieldTypeRequiredDescription
namestringYesColumn name in source table
rolestringYesembedding or metadata
ordinalintegerNoOrder for multi-column embedding concatenation
name_prefixstringNoPrefix for embedding text (e.g., "title: ")
filter_typestringConditionalRequired for metadata columns: keyword, integer, float, boolean

Example:

curl -X POST https://api.embedd.to/v1/vector-tables \
-H "Authorization: Bearer sk_your_key" \
-H "X-Environment-Id: env_abc123" \
-H "Content-Type: application/json" \
-d '{
"name": "product-search",
"connection_id": "conn_abc123",
"embedding_provider_id": "ep_abc123",
"source_table": "PRODUCTS",
"primary_key_column": "ID",
"columns": [
{"name": "TITLE", "role": "embedding", "ordinal": 1, "name_prefix": "title: "},
{"name": "DESCRIPTION", "role": "embedding", "ordinal": 2},
{"name": "CATEGORY", "role": "metadata", "filter_type": "keyword"},
{"name": "PRICE", "role": "metadata", "filter_type": "float"},
{"name": "IN_STOCK", "role": "metadata", "filter_type": "boolean"}
],
"embedding_model": "text-embedding-3-small",
"embedding_dimensions": 1536,
"mode": "managed",
"sync_mode": "cdc"
}'

Response (201):

{
"id": "vt_abc123",
"org_id": "org_xyz",
"environment_id": "env_abc123",
"connection_id": "conn_abc123",
"embedding_provider_id": "ep_abc123",
"name": "product-search",
"source_table": "PRODUCTS",
"primary_key_column": "ID",
"columns": [...],
"embedding_model": "text-embedding-3-small",
"embedding_dimensions": 1536,
"mode": "managed",
"sync_mode": "cdc",
"sync_status": "pending",
"qdrant_collection": "vt_abc12345_product-search",
"platform_vector_ref": null,
"total_rows": 0,
"synced_rows": 0,
"created_at": "2025-01-15T10:00:00Z",
"updated_at": "2025-01-15T10:00:00Z"
}

List Vector Tables

GET /v1/vector-tables

Get Vector Table

GET /v1/vector-tables/{vector_table_id}

Update Vector Table

PUT /v1/vector-tables/{vector_table_id}

Request Body:

FieldTypeDescription
namestringUpdated name
columnsarrayUpdated column configuration
embedding_modelstringNew embedding model (triggers re-backfill)
embedding_dimensionsintegerNew dimensions (triggers re-backfill)

Changing columns, embedding_model, or embedding_dimensions sets sync_status to pending_rebackfill. The next backfill performs an atomic swap to replace vectors with zero downtime.

Delete Vector Table

DELETE /v1/vector-tables/{vector_table_id}

Deletes the vector table record and cleans up vector storage (Qdrant collection or platform table).

Response: 204 No Content

Trigger Backfill

POST /v1/vector-tables/{vector_table_id}/backfill

Starts an asynchronous backfill that reads all rows from the source table, generates embeddings, and stores vectors.

Returns 409 Conflict if a backfill is already running.

Response (200):

{
"vector_table_id": "vt_abc123",
"status": "backfilling",
"total_rows": 10000,
"synced_rows": 0
}

Get Source Schema

GET /v1/vector-tables/{vector_table_id}/schema

Returns the column schema of the source table.

Response (200):

{
"columns": [
{"name": "ID", "type": "NUMBER", "nullable": false},
{"name": "TITLE", "type": "VARCHAR", "nullable": false},
{"name": "DESCRIPTION", "type": "VARCHAR", "nullable": true}
]
}