Whatever message this page gives is out now! Go check it out!

Understand vector stores and embeddings in ColdFusion

Last update:
May 18, 2026
Build semantic search and RAG in ColdFusion using vector embeddings and the VectorStore API. Learn the core concepts and how provider-backed vector stores fit together.
ColdFusion 2025.0.08 introduces native embedding support so you can build semantic search and retrieval-augmented generation (RAG) workflows without leaving CFML. This article explains what embeddings and vector stores are, how they work together, and how the unified VectorStore API maps to provider backends.

Embeddings

An embedding is a fixed-length list of numbers (a vector) that represents the meaning of a piece of text, image, or other content in a high-dimensional space. Models trained on language or multimodal data map similar ideas to points that are close in that space, so "distance" between vectors approximates semantic similarity.
When you index content, you typically pass text and let ColdFusion call a configured embedding model, or you pass a vector you computed elsewhere. The dimension (length of the array) is determined by the model and must stay consistent for a given collection.

Vector stores

A vector store is a database or service optimized to persist vectors plus optional text and metadata, and to run similarity search (nearest neighbors) using metrics such as cosine, dot product, or Euclidean distance. Unlike keyword search alone, similarity search retrieves items whose meaning is close to the query vector.
ColdFusion supports multiple providers (for example Milvus, Pinecone, Qdrant, Chroma, and an in-memory option for development) behind one API, so you can change providers with configuration rather than rewriting business logic.

How embeddings and stores work together

  1. Indexing (write path): Split or select content, produce an embedding for each item, and add rows that include at least text (and optionally id, vector, metadata).
  2. Query (read path): Turn a user question into a query vector (or pass text so the client embeds it), then search for the top K matches above a minimum score, optionally scoped with metadata filters.
This pattern powers RAG: retrieve relevant passages, then pass them as context to an LLM. The same primitives also support recommendations, deduplication, and scoped semantic search.

ColdFusion integration at a glance

Topic
Beginners
Experienced developers
Client creation
VectorStore() with no arguments uses an in-memory store for local tests.
VectorStore({ ... }) plus server aliases (Administrator, CFSetup) for production credentials.
Items
Each row has text (required in the usual path); embedding is optional if an embedding model is configured.
If embedding is supplied, it overrides model output; align dimension, metricType, and indexType with your provider and model.
Search
Pass text to search; tune topK and minScore.
Pass vector directly when you already have embeddings; use filter with MongoDB-style operators ($eq, $in, $gte, $or, and so on).
Operations
add, addAll, search, delete, deleteAll; collections can be listed or removed.
Large payloads may require batching. Use addAll() and control the batch size by passing an array with the required number of items. Be mindful of provider message size limits. Note: The VectorStore API does not expose a batchSize configuration. Developers control batching by chunking items and passing them to addAll() in appropriately sized arrays.
Embeddings
Supported providers include all_minlm(in memory onnx), Ollama, OpenAI, Azure OpenAI, Mistral, and Gemini per product documentation.
Configure timeouts, retries, batchSize, and logging on the embedding side to match SLAs.

Important notes

  • Provider-agnostic API: Connection settings (URL, API keys, timeouts, retries) are separated from collection settings (names, dimensions, metrics, index types). Collections are often created automatically when missing.
  • Filtering: Centralized filter syntax reduces per-vendor query differences; invalid filters raise VectorStoreInvalidFilterException (see product docs for exact exception names).
  • Hybrid search: Dense + sparse hybrid indexes are not integrated in the initial scope; plan for vector-only similarity unless you combine with external lexical systems.
  • Async: Asynchronous client APIs may arrive later; today, you manage concurrency in application code for heavy batch jobs.

Limitations

In-memory storage is not durable; use a hosted provider for production.

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page