import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.create({
createVectorStoreRequest: {
name: "Product Documentation",
description: "Vector store for product manuals and documentation",
fileIds: [
"file-abc123",
],
expiresAfter: {
anchor: "last_active_at",
days: 30,
},
},
});
console.log(result);
}
run();{
"id": "vs_abc123",
"object": "vector_store",
"created_at": 1704067200,
"name": "Product Documentation",
"usage_bytes": 1024000,
"embedding_model": "openai:text-embedding-3-small",
"embedding_dimensions": 1536,
"file_counts": {
"in_progress": 0,
"completed": 5,
"failed": 0,
"cancelled": 0,
"total": 5
},
"status": "completed",
"last_active_at": 1704153600,
"last_used_at": 1704153600,
"metadata": {
"department": "engineering"
},
"description": "Vector store for product manuals and docs",
"expires_at": null
}Creates a new vector store for storing and searching through document embeddings.
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.create({
createVectorStoreRequest: {
name: "Product Documentation",
description: "Vector store for product manuals and documentation",
fileIds: [
"file-abc123",
],
expiresAfter: {
anchor: "last_active_at",
days: 30,
},
},
});
console.log(result);
}
run();{
"id": "vs_abc123",
"object": "vector_store",
"created_at": 1704067200,
"name": "Product Documentation",
"usage_bytes": 1024000,
"embedding_model": "openai:text-embedding-3-small",
"embedding_dimensions": 1536,
"file_counts": {
"in_progress": 0,
"completed": 5,
"failed": 0,
"cancelled": 0,
"total": 5
},
"status": "completed",
"last_active_at": 1704153600,
"last_used_at": 1704153600,
"metadata": {
"department": "engineering"
},
"description": "Vector store for product manuals and docs",
"expires_at": null
}Authenticate with your MKA1 API key at the API gateway: Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, also send X-On-Behalf-Of to identify the end user making the request.
Optional external user identifier for multi-user server-side integrations. Use this when acting on behalf of one of your end users.
Request body for creating a vector store.
The name of the vector store.
A description for the vector store. Can be used to describe the vector store's purpose.
A list of File IDs that the vector store should use. Useful for tools like file_search that can access files.
The expiration policy for a vector store.
Show child attributes
The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. Only applicable if file_ids is non-empty.
Show child attributes
Set of 16 key-value pairs that can be attached to an object. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
Show child attributes
The embedding model to use. Defaults to the auto-configured model if not specified.
The number of dimensions for the embedding vectors. Only supported for models with flexible dimensions (e.g. text-embedding-3-small, text-embedding-3-large). If not specified, uses the model's default dimensions.
-9007199254740991 < x <= 9007199254740991OK
A vector store is a collection of processed files that can be used by the file_search tool.
The identifier, which can be referenced in API endpoints.
The object type, which is always 'vector_store'.
The Unix timestamp (in seconds) for when the vector store was created.
-9007199254740991 <= x <= 9007199254740991The name of the vector store.
The total number of bytes used by the files in the vector store.
-9007199254740991 <= x <= 9007199254740991The embedding model used for this vector store. Resolved at creation time from the requested or auto model. Null for legacy vector stores.
The number of dimensions for the embedding vectors in this vector store. Null for legacy vector stores.
0 < x <= 9007199254740991File processing status counts.
Show child attributes
The status of the vector store. 'expired' means the store has expired, 'in_progress' means files are still being processed, 'completed' indicates that the vector store is ready for use.
expired, in_progress, completed The Unix timestamp (in seconds) for when the vector store was last active.
-9007199254740991 <= x <= 9007199254740991Set of 16 key-value pairs that can be attached to an object. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
Show child attributes
The Unix timestamp (in seconds) for when the vector store was last used.
-9007199254740991 <= x <= 9007199254740991The expiration policy for a vector store.
Show child attributes
The Unix timestamp (in seconds) for when the vector store will expire.
-9007199254740991 <= x <= 9007199254740991A description for the vector store. Can be used to describe the vector store's purpose.
Was this page helpful?