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.

get

Perform a semantic search on a memory store. Returns the most relevant documents based on your query, with optional filtering by metadata.

Authorizations
AuthorizationstringRequired

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.

Path parameters
memory_store_idstringRequired

The Memory Store id

Example: 123
Query parameters
querystringRequired

The query to search for

topkinteger · min: 1 · max: 1000Optional

The number of results to return

Example: 10
Responses
200

Results found

application/json
get
/public_api/vector_stores/{memory_store_id}/search
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 document

post

Add a new document to a memory store. The document will be processed and made searchable. You can optionally include metadata for filtering.

Authorizations
AuthorizationstringRequired

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.

Path parameters
memory_store_idstringRequired

The Memory Store id

Example: 123
Body
textstringRequired

The content of the document

namestringRequired

The name of the document

metadataobjectOptional

The metadata of the document

Responses
200

Document added

application/json
post
/public_api/vector_stores/{memory_store_id}/vector_store_documents
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 a document

put

Update an existing document in a memory store. You can modify the document's content, name, or metadata.

Authorizations
AuthorizationstringRequired

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.

Path parameters
memory_store_idstringRequired

The Memory Store id

Example: 123
memory_store_document_idstringRequired

The id of the document to update

Example: 456
Body
textstringRequired

The content of the document

namestringRequired

The name of the document

metadataobjectOptional

The metadata of the document

Responses
200

Document updated

application/json
put
/public_api/vector_stores/{memory_store_id}/vector_store_documents/{memory_store_document_id}
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
}

Delete a document

delete

Remove a document from a memory store. This action is permanent and cannot be undone.

Authorizations
AuthorizationstringRequired

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.

Path parameters
memory_store_idstringRequired

The Memory Store id

Example: 123
memory_store_document_idstringRequired

The id of the document to delete

Example: 456
Responses
200

Document deleted

No content

delete
/public_api/vector_stores/{memory_store_id}/vector_store_documents/{memory_store_document_id}
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?