import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.search({
vectorStoreId: "vs_abc123",
searchVectorStoreRequest: {
query: "How do I reset my password?",
maxNumResults: 5,
},
});
console.log(result);
}
run();{
"object": "vector_store.search_results.page",
"search_query": "How do I reset my password?",
"data": [
{
"file_id": "file-abc123",
"filename": "user-guide.pdf",
"score": 0.92,
"content": [
{
"type": "text",
"text": "To reset your password, navigate to Settings > Security > Reset Password..."
}
]
}
],
"has_more": false,
"next_page": null
}Performs semantic search within a vector store to find the most relevant document chunks for a query.
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.search({
vectorStoreId: "vs_abc123",
searchVectorStoreRequest: {
query: "How do I reset my password?",
maxNumResults: 5,
},
});
console.log(result);
}
run();{
"object": "vector_store.search_results.page",
"search_query": "How do I reset my password?",
"data": [
{
"file_id": "file-abc123",
"filename": "user-guide.pdf",
"score": 0.92,
"content": [
{
"type": "text",
"text": "To reset your password, navigate to Settings > Security > Reset Password..."
}
]
}
],
"has_more": false,
"next_page": 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.
The ID of the vector store to search.
Request body for searching a vector store.
A query string for a search, or an array of query strings.
A filter to apply based on file attributes.
Show child attributes
The maximum number of results to return. This number should be between 1 and 50 inclusive.
1 <= x <= 50Ranking options for search.
Show child attributes
Whether to rewrite the natural language query for vector search.
OK
A page of search results from the vector store.
The object type, which is always 'vector_store.search_results.page'.
The query that was used for the search.
Array of search results.
Show child attributes
Whether there are more results available.
Cursor for the next page of results, or null if no more results.
Was this page helpful?