Skip to main content

Delete Key

Deletes entries from an AI store by their original input.

Click to expand source code
import { createAiClient } from "ahnlich-client-node";
import { DelKey } from "ahnlich-client-node/grpc/ai/query_pb";
import { StoreInput } from "ahnlich-client-node/grpc/keyval_pb";

async function deleteKey() {
const client = createAiClient("127.0.0.1:1370");

await client.delKey(
new DelKey({
store: "ai_store",
keys: [
new StoreInput({ value: { case: "rawString", value: "Jordan One" } }),
],
})
);

console.log("Entry deleted");
}

deleteKey();

Parameters​

ParameterTypeRequiredDescription
storestringYesThe name of the AI store
keysStoreInput[]YesArray of inputs to delete

Notes​

  • For AI stores, keys are the original inputs (text or binary), not vectors
  • Non-existent keys are silently ignored