Whatever message this page gives is out now! Go check it out!
Topic | You will |
Ids and embeddings | Supply stable id values when you need them; pass vector when you embed outside the client or override the model for one row. |
Metadata filters | Restrict search (and deleteAll) with MongoDB-style operators and equality on plain fields. |
Delete | Remove one id, many ids, or every row that matches a filter. |
Saved configuration | Register a struct in the Administrator and open the client with vectorStore("alias"). |
<cfscript>
try{
vs = VectorStore({
provider: "inmemory",
embeddingModel: {
"provider": "openai",
"modelName": "text-embedding-3-small",
"apiKey": "#application.apiKey#"
}
});
vs.add({
"id": "kb-article-10042",
"text": "Return policy: items within 30 days with receipt.",
"metadata": { "docType": "policy", "locale": "en-US" }
});
doc=vs.add({
"text": "Shipping is free over $50.",
"metadata": { "docType": "marketing", "locale": "en-US" }
});
writeDump(doc)
}
catch (any e) {
writeOutput("Error initializing VectorStore client:<br><br> ");
writedump(e.detail);
}
</cfscript><cfscript>
try{
vs = VectorStore({
provider: "inmemory",
embeddingModel: {
"provider": "openai",
"modelName": "text-embedding-3-small",
"apiKey": "#application.apiKey#"
}
});
vs.addAll([
{
"text": "ColdFusion is a rapid application development platform.",
"metadata": { "category": "tech", "audience": "developer", "year": 2023 }
},
{
"text": "Python is popular for data science.",
"metadata": { "category": "data", "audience": "analyst", "year": 2025 }
}
])
hits = vs.search({
"text": "How do I build web apps?",
"topK": 5,
"minScore": 0.25,
"filter": {
"category": "tech",
"year": { "$gte": 2023 }
}
});
writeDump(hits);
}
catch (any e) {
writeOutput("Search error:<br><br>");
writeDump(e.detail);
}
</cfscript><cfscript>
try{
vs = VectorStore({
provider: "inmemory",
embeddingModel: {
"provider": "openai",
"modelName": "text-embedding-3-small",
"apiKey": "#application.apiKey#"
}
});
id1 = vs.add({
"text": "Temporary row",
"metadata": { "batch": "test-2026-03", "status": "draft" }
});
vs.delete(id1);
vs.addAll([
{
"text": "Keep me",
"metadata": { "env": "prod", "retain": true }
},
{
"text": "Remove me",
"metadata": { "env": "prod", "retain": false }
}
]);
vs.deleteAll({ "retain": false, "env": "prod" });
// vs.deleteAll(); // removes everything in this store — uncomment only when intended
}
catch(any e){
writeOutput("Error initializing VectorStore client:<br><br> ");
writedump(e.detail);
}
</cfscript><cfscript>
try {
vectorStoreAPI = createObject("component", "CFIDE.adminapi.vectorstore");
configStruct = {
"provider": "milvus",
"url": "http://your-milvus-host:19530",
"dimension": 384,
"collectionName": "app_vectors"
// add apiKey, embeddingModel, connectionSettings, etc. per your deployment
};
vectorStoreAPI.addVectorStoreConfig("myMilvus", configStruct);
retrieved = vectorStoreAPI.getVectorStoreConfig("myMilvus");
writeDump(retrieved);
vectorstoreclient = vectorStore("myMilvus");
writeDump(vectorstoreclient.add({
"text": "Document added through aliased client.",
"metadata": { "via": "alias" }
}));
}
catch (any e) {
writeDump(e);
}
</cfscript><cfscript>
try{
vs = VectorStore({
provider: "inmemory",
embeddingModel: {
"provider": "openai",
"modelName": "text-embedding-3-small",
"apiKey": "#application.apiKey#"
}
});
vs.addAll([
{
"text": "Reset your password from the login screen.",
"metadata": { "department": "accounts", "source": "faq" }
},
{
"text": "Download invoices under Billing.",
"metadata": { "department": "billing", "source": "faq" }
},
{
"text": "API keys are listed under Developer settings.",
"metadata": { "department": "developer", "source": "faq" }
}
]);
hits = vs.search({
"text": "Where is my invoice?",
"topK": 5,
"minScore": 0.3,
"filter": {
"source": "faq",
"$or": [
{ "department": "accounts" },
{ "department": "billing" }
]
}
});
writeDump(hits);
}
catch(any e){
writeOutput("Error initializing VectorStore client:<br><br> ");
writedump(e.detail);
}
</cfscript><cfscript>
try{
vs = VectorStore({
provider: "inmemory",
embeddingModel: {
"provider": "openai",
"modelName": "text-embedding-3-small",
"apiKey": "#application.apiKey#"
}
});
vs.addAll([
{
"id": "sku-501",
"text": "Trail runner shoes waterproof breathable size 7–12 black",
"metadata": { "sku": "sku-501", "category": "footwear", "inStock": true }
},
{
"id": "sku-502",
"text": "Lightweight hiking boots leather ankle support waterproof",
"metadata": { "sku": "sku-502", "category": "footwear", "inStock": true }
}
]);
currentSku = "sku-501";
similar = vs.search({
"text": "Trail runner shoes waterproof breathable",
"topK": 5,
"minScore": 0.35,
"filter": {
"category": "footwear",
"inStock": true,
"sku": { "$ne": currentSku }
}
});
writeDump(similar);
} catch(any e){
writeOutput("Error initializing VectorStore client:<br><br> ");
writedump(e.detail);
}
</cfscript><cfscript>
try{
vs = VectorStore({
provider: "inmemory",
embeddingModel: {
"provider": "openai",
"modelName": "text-embedding-3-small",
"apiKey": "#application.apiKey#"
}
});
vs.addAll([
{
"text": "Active announcement.",
"metadata": { "articleId": "a1", "status": "published" }
},
{
"text": "Old announcement.",
"metadata": { "articleId": "a2", "status": "archived" }
}
]);
vs.deleteAll({ "status": "archived" });
remaining = vs.search({
"text": "announcement",
"topK": 5,
"minScore": 0.2
});
writeDump(remaining);
} catch(any e){
writeOutput("Error initializing VectorStore client:<br><br> ");
writedump(e.detail);
}
</cfscript>