Knowledge Base
Manage knowledge bases for semantic search. Note that "memory_store" in the endpoint paths refers to a knowledge base in the product. Add, update, delete, and search documents with optional metadata filtering.
Perform a semantic search on a memory store. Returns the most relevant documents based on your query, with optional filtering by metadata.
API requests are authenticated using Bearer tokens. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
You can find your API key in your workspace settings.
The Memory Store id
123The query to search for
The number of results to return
10Results found
Invalid Request
Authentication error
GET /public_api/vector_stores/{memory_store_id}/search?query=text HTTP/1.1
Host: api.airops.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"matches": [
{
"id": "text",
"score": 0.95,
"content": "text",
"document_name": "text",
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}
]
}Add a new document to a memory store. The document will be processed and made searchable. You can optionally include metadata for filtering.
API requests are authenticated using Bearer tokens. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
You can find your API key in your workspace settings.
The Memory Store id
123The content of the document
The name of the document
The metadata of the document
Document added
Invalid Request
Authentication error
POST /public_api/vector_stores/{memory_store_id}/vector_store_documents HTTP/1.1
Host: api.airops.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 43
{
"text": "text",
"name": "text",
"metadata": {}
}{
"id": 123,
"document_type": "text",
"name": "My Document",
"source": "api_upload",
"status": "completed",
"sync_progress_percentage": 100,
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-01-15T10:35:00.000Z",
"vector_store_id": 456
}Update an existing document in a memory store. You can modify the document's content, name, or metadata.
API requests are authenticated using Bearer tokens. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
You can find your API key in your workspace settings.
The Memory Store id
123The id of the document to update
456The content of the document
The name of the document
The metadata of the document
Document updated
Authentication error
PUT /public_api/vector_stores/{memory_store_id}/vector_store_documents/{memory_store_document_id} HTTP/1.1
Host: api.airops.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 43
{
"text": "text",
"name": "text",
"metadata": {}
}{
"id": 123,
"document_type": "text",
"name": "My Document",
"source": "api_upload",
"status": "completed",
"sync_progress_percentage": 100,
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-01-15T10:35:00.000Z",
"vector_store_id": 456
}Remove a document from a memory store. This action is permanent and cannot be undone.
API requests are authenticated using Bearer tokens. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
You can find your API key in your workspace settings.
The Memory Store id
123The id of the document to delete
456Document deleted
No content
Authentication error
DELETE /public_api/vector_stores/{memory_store_id}/vector_store_documents/{memory_store_document_id} HTTP/1.1
Host: api.airops.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Was this helpful?