embed_text
Generate numerical vector embeddings for text inputs, enabling semantic search, clustering, deduplication, or retrieval-augmented generation. Returns one embedding array per text in input order.
Instructions
Generate numerical vector embeddings for one or more text inputs using Cloudflare Workers AI. Use this tool when you need semantic vector representations of text — for example similarity search, clustering, deduplication, or retrieval-augmented generation. Returns one embedding array (384-dimensional for BGE small, 768 for BGE base) per input text, in the same order as the inputs. Embeddings are generated by the native Workers AI endpoint and are deterministic for identical inputs. Requires CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN environment variables.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Embedding model id. Available: @cf/baai/bge-small-en-v1.5 (384 dimensions, faster), @cf/baai/bge-base-en-v1.5 (768 dimensions, higher quality). | |
| texts | Yes | One or more texts to embed (up to 10 per call). Each text becomes one embedding vector returned in the same order. |