from mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.vector_stores.search(vector_store_id="vs_abc123", query="How do I reset my password?", max_num_results=5, rewrite_query=False)
# Handle response
print(res){
"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.
from mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.vector_stores.search(vector_store_id="vs_abc123", query="How do I reset my password?", max_num_results=5, rewrite_query=False)
# Handle response
print(res){
"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
}Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.
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?