Skip to main content

CAIP Agents API Reference

Overview

The CAIP Agents API provides a comprehensive REST API for managing AI agents, conversation threads, messages, and vector search capabilities. This API enables you to create, configure, and interact with AI agents powered by various language models, as well as manage embeddings and perform semantic/keyword search for RAG applications.

  • Base URL: https://agents.api.caip.bmw.cloud
  • Version: 1.1

Authentication

All endpoints require an API key via the Authorization header:

Authorization: Bearer <your-api-key>

Error Handling

The API uses standard HTTP status codes and returns errors in the following format:

{
"error": true,
"message": "Error message describing what went wrong",
"code": "ERROR_CODE"
}

Common HTTP Status Codes

Status CodeDescription
200OK - Request succeeded
201Created - Resource created successfully
204No Content - Request succeeded, no content returned
400Bad Request - Invalid input data
401Unauthorized - Authentication required or failed
403Forbidden - Insufficient permissions
404Not Found - Resource not found
422Unprocessable Entity - Validation error
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Server error occurred

Table of Contents

  1. Models
  2. Agents
  3. Threads
  4. Messages
  5. Vector Stores
  6. Embeddings
  7. Vector Search
  8. Keyword Search
  9. Hybrid Search
  10. Search Evaluation

Models

List Available Models

Retrieve a list of all available AI models that can be used with agents.

Endpoint: GET /v1/models

Authentication: Required

Response:

[
{
"modelId": "507f1f77bcf86cd799439011",
"name": "gpt-4",
"provider": "openai"
},
{
"modelId": "507f1f77bcf86cd799439012",
"name": "gpt-4-turbo",
"provider": "openai"
},
{
"modelId": "507f1f77bcf86cd799439013",
"name": "claude-3-opus",
"provider": "anthropic"
}
]

Example Request:

curl -X 'GET' \
'https://agents.api.caip.bmw.cloud/v1/models' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY'

Response Codes:

  • 200: Models retrieved successfully
  • 500: Failed to retrieve models

Agents

Agents are AI assistants configured with specific instructions, models, and parameters to perform tasks.

Create Agent

Create a new AI agent with specified configuration.

Endpoint: POST /v1/spaces/{spaceId}/agent

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space

Query Parameters:

ParameterTypeRequiredDescription
modelstringYesAI model to use (e.g., "gpt-4", "claude-3-opus")

Request Body:

{
"name": "Customer Support Agent",
"instructions": "You are a helpful customer support agent. Be concise and professional.",
"description": "AI assistant for customer support inquiries",
"outputFormat": "text",
"createdBy": {
"qxId": "QX11111",
"name": "John Doe"
},
"defaultParameters": {
"temperature": 0.7,
"max_tokens": 1024,
"top_p": 1.0,
"frequency_penalty": 0.0,
"presence_penalty": 0.0
},
"metadata": {
"type": "conversational",
"category": "support"
}
}

Response:

{
"agentId": "507f1f77bcf86cd799439011",
"spaceId": "space_12345"
}

Example Request:

curl -X 'POST' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent?model=gpt-4' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Customer Support Agent",
"instructions": "You are a helpful customer support agent.",
"description": "AI assistant for customer support",
"outputFormat": "text",
"createdBy": {
"qxId": "QX11111",
"name": "John Doe"
}
}'

Response Codes:

  • 201: Agent created successfully
  • 400: Invalid input data or model
  • 404: Space not found
  • 500: Failed to create agent

Fields:

FieldTypeRequiredDescription
namestringYesName of the agent
instructionsstringYesBehavioral instructions for the agent
descriptionstringYesDescription of the agent's purpose
outputFormatstringYesOutput format (e.g., "text")
createdByobjectYesUser who created the agent (qxId, name)
defaultParametersobjectNoDefault LLM parameters (temperature, max_tokens, top_p, frequency_penalty, presence_penalty)
metadataobjectNoAdditional metadata key-value pairs

Get Agent

Retrieve a specific agent by its ID.

Endpoint: GET /v1/spaces/{spaceId}/agent/{agentId}

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
agentIdstringYesUnique agent identifier

Response:

{
"agentId": "507f1f77bcf86cd799439011",
"name": "Customer Support Agent",
"spaceId": "space_12345",
"instructions": "You are a helpful customer support agent.",
"description": "AI assistant for customer support",
"model": "gpt-4",
"provider": "openai",
"outputFormat": "text",
"createdAt": "2025-10-09T08:30:00+00:00",
"updatedAt": "2025-10-09T12:30:00+00:00",
"createdBy": {
"qxId": "QX11111",
"name": "John Doe"
},
"defaultParameters": {
"temperature": 0.7,
"max_tokens": 1024
}
}

Example Request:

curl -X 'GET' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent/507f1f77bcf86cd799439011' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY'

Response Codes:

  • 200: Agent retrieved successfully
  • 404: Agent or space not found

List Agents

List all agents in a specific space. You can retrieve agents using GET (with optional pagination/search query parameters) or filter by metadata using the QUERY HTTP method with a JSON body.

MethodEndpoint
GET/v1/spaces/{spaceId}/agent
QUERY/v1/spaces/{spaceId}/agent
warning

The QUERY method is not visible in the Swagger API Docs UI since it does not fully support this newly standardized method natively yet. However, it can be used via API calling tools such as Postman or curl with -X QUERY.

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space

GET — List with optional pagination & search

Example Request:

curl -X 'GET' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY'

Response:

[
{
"agentId": "507f1f77bcf86cd799439011",
"name": "Customer Support Agent",
"spaceId": "space_12345",
"instructions": "You are a helpful customer support agent.",
"description": "AI assistant for customer support",
"model": "gpt-4",
"provider": "openai",
"outputFormat": "text",
"createdAt": "2025-10-09T08:30:00+00:00",
"updatedAt": "2025-10-09T12:30:00+00:00",
"createdBy": {
"qxId": "QX11111",
"name": "John Doe"
}
}
]

QUERY — Filter by metadata

Send a JSON body with a metadata object to filter agents by metadata key-value pairs. A scalar value matches exactly, an array value matches any of the listed values. The body is optional: omitting it returns all agents.

Example Request:

curl -X 'QUERY' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"metadata": {
"type": "conversational",
"category": ["support", "billing"]
}
}'

Response:

{
"data": [
{
"agentId": "507f1f77bcf86cd799439011",
"name": "Customer Support Agent",
"spaceId": "space_12345",
"model": "gpt-4",
"provider": "openai",
"metadata": {
"type": "conversational",
"category": "support"
},
"createdAt": "2025-10-09T08:30:00+00:00",
"updatedAt": "2025-10-09T12:30:00+00:00"
}
],
"pagination": {
"totalRecords": 1,
"currentPage": 1,
"totalPages": 1,
"nextPage": null,
"prevPage": null
}
}

Request Body Fields (QUERY only):

FieldTypeRequiredDescription
metadataobjectNoKey-value pairs to filter by. A scalar value matches exactly, an array value matches any of the listed values

Response Codes:

  • 200: Agents retrieved successfully
  • 500: Failed to retrieve agents

Update Agent

Update an existing agent's configuration. All fields are optional — only include the fields you want to change.

Endpoint: PATCH /v1/spaces/{spaceId}/agent/{agentId}

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
agentIdstringYesUnique agent identifier

Request Body:

{
"name": "Updated Agent Name",
"instructions": "Updated instructions for the agent.",
"description": "Updated description",
"model": "gpt-4-turbo",
"outputFormat": "text",
"updatedBy": {
"qxId": "QX11111",
"name": "John Doe"
},
"defaultParameters": {
"temperature": 0.5,
"max_tokens": 2048
},
"metadata": {
"type": "conversational",
"category": "support"
}
}

Response:

{
"agentId": "507f1f77bcf86cd799439011",
"name": "Updated Agent Name",
"spaceId": "space_12345",
"instructions": "Updated instructions for the agent.",
"description": "Updated description",
"model": "gpt-4-turbo",
"provider": "openai",
"outputFormat": "text",
"createdAt": "2025-10-09T08:30:00+00:00",
"updatedAt": "2025-10-09T14:00:00+00:00"
}

Example Request:

curl -X 'PATCH' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent/507f1f77bcf86cd799439011' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Updated Agent Name",
"updatedBy": {
"qxId": "QX11111",
"name": "John Doe"
}
}'

Response Codes:

  • 200: Agent updated successfully
  • 404: Agent or space not found
  • 500: Failed to update agent

Delete Agent

Delete an agent permanently. This also deletes all associated threads and messages.

Endpoint: DELETE /v1/spaces/{spaceId}/agent/{agentId}

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
agentIdstringYesUnique agent identifier

Example Request:

curl -X 'DELETE' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent/507f1f77bcf86cd799439011' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY'

Response Codes:

  • 204: Agent deleted successfully
  • 404: Agent or space not found
  • 500: Failed to delete agent

Threads

Threads represent conversation sessions with an agent.

Create Thread

Create a new conversation thread for a specific agent.

Endpoint: POST /v1/spaces/{spaceId}/agent/{agentId}/thread

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
agentIdstringYesUnique agent identifier

Request Body:

{
"title": "Billing Issue",
"status": "open",
"metadata": {
"priority": "high",
"category": "support"
}
}

Response:

{
"threadId": "507f1f77bcf86cd799439033",
"title": "Billing Issue",
"spaceId": "space_12345",
"agentId": "507f1f77bcf86cd799439011",
"status": "open",
"metadata": {
"priority": "high",
"category": "support"
},
"createdAt": "2025-10-09T09:15:00+00:00",
"updatedAt": "2025-10-09T09:15:00+00:00",
"lastMessageAt": null
}

Example Request:

curl -X 'POST' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent/507f1f77bcf86cd799439011/thread' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"title": "Billing Issue",
"status": "open"
}'

Response Codes:

  • 201: Thread created successfully
  • 400: Invalid input data
  • 404: Agent or space not found
  • 500: Failed to create thread

Fields:

FieldTypeRequiredDescription
titlestringNoTitle of the thread
statusstringNoThread status: open (default), archived, completed
metadataobjectNoAdditional metadata key-value pairs

Get Thread

Retrieve a specific conversation thread by its ID.

Endpoint: GET /v1/spaces/{spaceId}/agent/{agentId}/thread/{threadId}

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
agentIdstringYesUnique agent identifier
threadIdstringYesUnique thread identifier

Response:

{
"threadId": "507f1f77bcf86cd799439033",
"title": "Billing Issue",
"spaceId": "space_12345",
"agentId": "507f1f77bcf86cd799439011",
"status": "open",
"metadata": {
"priority": "high",
"category": "support"
},
"createdAt": "2025-10-09T09:15:00+00:00",
"updatedAt": "2025-10-09T09:15:00+00:00",
"lastMessageAt": "2025-10-09T10:15:00+00:00"
}

Example Request:

curl -X 'GET' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent/507f1f77bcf86cd799439011/thread/507f1f77bcf86cd799439033' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY'

Response Codes:

  • 200: Thread retrieved successfully
  • 404: Thread, agent, or space not found

List Threads

List all conversation threads for an agent. You can optionally filter by status using GET query parameters, or filter by metadata using the QUERY HTTP method with a JSON body.

MethodEndpoint
GET/v1/spaces/{spaceId}/agent/{agentId}/thread
QUERY/v1/spaces/{spaceId}/agent/{agentId}/thread
warning

The QUERY method is not visible in the Swagger API Docs UI since it does not fully support this newly standardized method natively yet. However, it can be used via API calling tools such as Postman or curl with -X QUERY.

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
agentIdstringYesUnique agent identifier

GET — Filter by status

Query ParameterTypeRequiredDescription
statusstringNoFilter by status: open, archived, completed

Example Request:

curl -X 'GET' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent/507f1f77bcf86cd799439011/thread?status=open' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY'

Response:

[
{
"threadId": "507f1f77bcf86cd799439033",
"title": "Billing Issue",
"spaceId": "space_12345",
"agentId": "507f1f77bcf86cd799439011",
"status": "open",
"createdAt": "2025-10-09T09:15:00+00:00",
"updatedAt": "2025-10-09T09:15:00+00:00",
"lastMessageAt": "2025-10-09T10:15:00+00:00"
}
]

QUERY — Filter by metadata

Send a JSON body with a metadata object to filter threads by metadata key-value pairs. A scalar value matches exactly, an array value matches any of the listed values. The body is optional: omitting it returns all threads.

Example Request:

curl -X 'QUERY' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent/507f1f77bcf86cd799439011/thread' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"metadata": {
"priority": "high",
"category": ["support", "billing"]
}
}'

Response:

[
{
"threadId": "507f1f77bcf86cd799439033",
"title": "Billing Issue",
"spaceId": "space_12345",
"agentId": "507f1f77bcf86cd799439011",
"status": "open",
"metadata": {
"priority": "high",
"category": "support"
},
"createdAt": "2025-10-09T09:15:00+00:00",
"updatedAt": "2025-10-09T09:15:00+00:00",
"lastMessageAt": "2025-10-09T10:15:00+00:00"
}
]

Request Body Fields (QUERY only):

FieldTypeRequiredDescription
metadataobjectNoKey-value pairs to filter by. A scalar value matches exactly; an array value matches any of the listed values

Response Codes:

  • 200: Threads retrieved successfully
  • 404: Agent or space not found
  • 500: Failed to query threads

Update Thread

Update an existing conversation thread. All fields are optional.

Endpoint: PATCH /v1/spaces/{spaceId}/agent/{agentId}/thread/{threadId}

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
agentIdstringYesUnique agent identifier
threadIdstringYesUnique thread identifier

Request Body:

{
"title": "Billing Issue - Resolved",
"status": "completed",
"metadata": {
"priority": "low",
"category": "support"
}
}

Response:

{
"threadId": "507f1f77bcf86cd799439033",
"title": "Billing Issue - Resolved",
"spaceId": "space_12345",
"agentId": "507f1f77bcf86cd799439011",
"status": "completed",
"createdAt": "2025-10-09T09:15:00+00:00",
"updatedAt": "2025-10-09T15:00:00+00:00",
"lastMessageAt": "2025-10-09T10:15:00+00:00"
}

Example Request:

curl -X 'PATCH' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent/507f1f77bcf86cd799439011/thread/507f1f77bcf86cd799439033' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"title": "Billing Issue - Resolved",
"status": "completed"
}'

Response Codes:

  • 200: Thread updated successfully
  • 404: Thread, agent, or space not found
  • 500: Failed to update thread

Delete Thread

Delete a conversation thread permanently.

Endpoint: DELETE /v1/spaces/{spaceId}/agent/{agentId}/thread/{threadId}

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
agentIdstringYesUnique agent identifier
threadIdstringYesUnique thread identifier

Example Request:

curl -X 'DELETE' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent/507f1f77bcf86cd799439011/thread/507f1f77bcf86cd799439033' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY'

Response Codes:

  • 204: Thread deleted successfully
  • 404: Thread, agent, or space not found
  • 500: Failed to delete thread

Messages

Messages are individual communications within a thread.

Create Message

Create a new message in a thread.

Endpoint: POST /v1/spaces/{spaceId}/agent/{agentId}/thread/{threadId}/message

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
agentIdstringYesUnique agent identifier
threadIdstringYesUnique thread identifier

Request Body:

{
"role": "user",
"content": [
{
"type": "text",
"text": "Hello, I need help with my billing issue."
}
],
"metadata": {
"source": "chat"
},
"model": "gpt-4",
"usage": {
"prompt_tokens": 10,
"completion_tokens": 25,
"total_tokens": 35
}
}

Response:

{
"messageId": "507f1f77bcf86cd799439044",
"spaceId": "space_12345",
"threadId": "507f1f77bcf86cd799439033",
"role": "user",
"content": [
{
"type": "text",
"text": "Hello, I need help with my billing issue."
}
],
"metadata": {
"source": "chat"
},
"model": "gpt-4",
"usage": {
"prompt_tokens": 10,
"completion_tokens": 25,
"total_tokens": 35
},
"createdAt": "2025-10-09T10:15:00+00:00"
}

Example Request:

curl -X 'POST' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent/507f1f77bcf86cd799439011/thread/507f1f77bcf86cd799439033/message' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"role": "user",
"content": [
{
"type": "text",
"text": "Hello, I need help with my billing issue."
}
]
}'

Response Codes:

  • 201: Message created successfully
  • 400: Invalid input data
  • 404: Thread, agent, or space not found
  • 500: Failed to create message

Fields:

FieldTypeRequiredDescription
rolestringYesMessage role: user, assistant, system, tool
contentarrayYesList of content objects, each with type (e.g., "text") and text
metadataobjectNoAdditional metadata key-value pairs
modelstringNoModel used to generate the message
usageobjectNoToken usage: prompt_tokens, completion_tokens, total_tokens

Get Message

Get a specific message by ID.

Endpoint: GET /v1/spaces/{spaceId}/agent/{agentId}/thread/{threadId}/message/{messageId}

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
agentIdstringYesUnique agent identifier
threadIdstringYesUnique thread identifier
messageIdstringYesUnique message identifier

Response:

{
"messageId": "507f1f77bcf86cd799439044",
"spaceId": "space_12345",
"threadId": "507f1f77bcf86cd799439033",
"role": "user",
"content": [
{
"type": "text",
"text": "Hello, I need help with my billing issue."
}
],
"createdAt": "2025-10-09T10:15:00+00:00"
}

Example Request:

curl -X 'GET' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent/507f1f77bcf86cd799439011/thread/507f1f77bcf86cd799439033/message/507f1f77bcf86cd799439044' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY'

Response Codes:

  • 200: Message retrieved successfully
  • 404: Message, thread, agent, or space not found

List Messages

List all messages in a thread. You can optionally filter by role using GET query parameters, or filter by metadata using the QUERY HTTP method with a JSON body.

MethodEndpoint
GET/v1/spaces/{spaceId}/agent/{agentId}/thread/{threadId}/message
QUERY/v1/spaces/{spaceId}/agent/{agentId}/thread/{threadId}/message
warning

The QUERY method is not visible in the Swagger API Docs UI since it does not fully support this newly standardized method natively yet. However, it can be used via API calling tools such as Postman or curl with -X QUERY.

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
agentIdstringYesUnique agent identifier
threadIdstringYesUnique thread identifier

GET — Filter by role

Query ParameterTypeRequiredDescription
rolestringNoFilter by role: user, assistant, system, tool

Example Request:

curl -X 'GET' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent/507f1f77bcf86cd799439011/thread/507f1f77bcf86cd799439033/message?role=user' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY'

Response:

[
{
"messageId": "507f1f77bcf86cd799439044",
"spaceId": "space_12345",
"threadId": "507f1f77bcf86cd799439033",
"role": "user",
"content": [
{
"type": "text",
"text": "Hello, I need help with my billing issue."
}
],
"createdAt": "2025-10-09T10:15:00+00:00"
}
]

QUERY — Filter by metadata

Send a JSON body with a metadata object to filter messages by metadata key-value pairs. A scalar value matches exactly, an array value matches any of the listed values. The body is optional: omitting it returns all messages.

Example Request:

curl -X 'QUERY' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent/507f1f77bcf86cd799439011/thread/507f1f77bcf86cd799439033/message' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"metadata": {
"source": "chat",
"category": ["production", "support"]
}
}'

Response:

[
{
"messageId": "507f1f77bcf86cd799439044",
"spaceId": "space_12345",
"threadId": "507f1f77bcf86cd799439033",
"role": "user",
"content": [
{
"type": "text",
"text": "Hello, I need help with my billing issue."
}
],
"metadata": {
"source": "chat",
"category": "production"
},
"createdAt": "2025-10-09T10:15:00+00:00"
}
]

Request Body Fields (QUERY only):

FieldTypeRequiredDescription
metadataobjectNoKey-value pairs to filter by. A scalar value matches exactly; an array value matches any of the listed values

Response Codes:

  • 200: Messages retrieved successfully
  • 404: Thread, agent, or space not found
  • 500: Failed to query messages

Update Message

Update a specific message by ID. All fields are optional.

Endpoint: PATCH /v1/spaces/{spaceId}/agent/{agentId}/thread/{threadId}/message/{messageId}

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
agentIdstringYesUnique agent identifier
threadIdstringYesUnique thread identifier
messageIdstringYesUnique message identifier

Request Body:

{
"content": [
{
"type": "text",
"text": "Updated message content."
}
],
"metadata": {
"priority": "high"
}
}

Response:

{
"messageId": "507f1f77bcf86cd799439044",
"spaceId": "space_12345",
"threadId": "507f1f77bcf86cd799439033",
"role": "user",
"content": [
{
"type": "text",
"text": "Updated message content."
}
],
"metadata": {
"priority": "high"
},
"createdAt": "2025-10-09T10:15:00+00:00"
}

Example Request:

curl -X 'PATCH' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent/507f1f77bcf86cd799439011/thread/507f1f77bcf86cd799439033/message/507f1f77bcf86cd799439044' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"content": [
{
"type": "text",
"text": "Updated message content."
}
]
}'

Response Codes:

  • 200: Message updated successfully
  • 404: Message, thread, agent, or space not found
  • 500: Failed to update message

Delete Message

Delete a specific message by ID.

Endpoint: DELETE /v1/spaces/{spaceId}/agent/{agentId}/thread/{threadId}/message/{messageId}

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
agentIdstringYesUnique agent identifier
threadIdstringYesUnique thread identifier
messageIdstringYesUnique message identifier

Example Request:

curl -X 'DELETE' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/agent/507f1f77bcf86cd799439011/thread/507f1f77bcf86cd799439033/message/507f1f77bcf86cd799439044' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY'

Response Codes:

  • 204: Message deleted successfully
  • 404: Message, thread, agent, or space not found
  • 500: Failed to delete message

Vector Stores

Vector stores are collections of embeddings used for semantic search and RAG applications.

Create Vector Store

Create a new vector store for storing embeddings.

Endpoint: POST /v1/spaces/{spaceId}/vector-stores

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space

Request Body:

{
"name": "Product Documentation",
"description": "Embeddings for product documentation and FAQs",
"embeddingModel": "text-embedding-3-small",
"embeddingDimension": 1536,
"chunkSize": 1000,
"chunkOverlap": 200,
"createdBy": {
"qxId": "QX11111",
"name": "John Doe"
},
"metadata": {
"category": "documentation",
"version": "1.0"
}
}

Response:

{
"vectorStoreId": "699eb4fb78db14c7c97a9a1e",
"spaceId": "space_12345",
"name": "Product Documentation",
"description": "Embeddings for product documentation and FAQs",
"embeddingModel": "text-embedding-3-small",
"embeddingDimension": 1536,
"chunkSize": 1000,
"chunkOverlap": 200,
"fileCounts": {
"total": 0,
"in_progress": 0,
"completed": 0,
"failed": 0
},
"embeddingCount": 0,
"createdAt": "2025-10-09T10:00:00+00:00",
"updatedAt": "2025-10-09T10:00:00+00:00",
"createdBy": {
"qxId": "QX11111",
"name": "John Doe"
}
}

Example Request:

curl -X 'POST' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/vector-stores' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Product Documentation",
"description": "Embeddings for product documentation",
"embeddingModel": "text-embedding-3-small",
"embeddingDimension": 1536,
"chunkSize": 1000,
"chunkOverlap": 200
}'

Response Codes:

  • 201: Vector store created successfully
  • 400: Invalid input data
  • 404: Space not found
  • 500: Failed to create vector store

Fields:

FieldTypeRequiredDescription
namestringYesName of the vector store (1-256 characters)
descriptionstringNoDescription of the vector store's purpose (max 1024 characters)
embeddingModelstringNoEmbedding model name (default: text-embedding-3-small)
embeddingDimensionintegerNoEmbedding vector dimensions (default: 1536)
chunkSizeintegerNoSize of text chunks in characters, 100-4096 (default: 1000)
chunkOverlapintegerNoOverlap between chunks in characters, 0-1000 (default: 200)
createdByobjectNoUser creating the store (qxId, name)
metadataobjectNoAdditional metadata key-value pairs

Supported Embedding Models:

  • text-embedding-3-small (OpenAI - supports variable dimensions: 1536 by default)
  • text-embedding-3-large (OpenAI - supports variable dimensions: 3072 by default)
  • titan-text-embeddings-v2 (AWS Bedrock - 1024 dimensions)

Supported Embedding Dimensions:

  • 1024 - Compatible with titan-text-embeddings-v2
  • 1536 - Compatible with text-embedding-3-small (default)
  • 3072 - Compatible with text-embedding-3-large

Important Notes:

  • The embeddingModel and embeddingDimension fields are validated against the supported values above
  • Ensure that the chosen dimension is compatible with your embedding model
  • chunkSize and chunkOverlap only affect future embeddings; existing embeddings are not re-chunked
  • Attempting to create a vector store with unsupported models or dimensions will result in a 400 Bad Request error

Get Vector Store

Retrieve a specific vector store by its ID.

Endpoint: GET /v1/spaces/{spaceId}/vector-stores/{vectorStoreId}

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
vectorStoreIdstringYesUnique vector store identifier

Response:

{
"vectorStoreId": "699eb4fb78db14c7c97a9a1e",
"spaceId": "space_12345",
"name": "Product Documentation",
"description": "Embeddings for product documentation and FAQs",
"embeddingModel": "text-embedding-3-small",
"embeddingDimension": 1536,
"chunkSize": 1000,
"chunkOverlap": 200,
"fileCounts": {
"total": 5,
"in_progress": 0,
"completed": 5,
"failed": 0
},
"embeddingCount": 150,
"createdAt": "2025-10-09T10:00:00+00:00",
"updatedAt": "2025-10-09T14:30:00+00:00",
"metadata": {
"category": "documentation",
"version": "1.0"
}
}

Example Request:

curl -X 'GET' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/vector-stores/699eb4fb78db14c7c97a9a1e' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY'

Response Codes:

  • 200: Vector store retrieved successfully
  • 404: Vector store or space not found

List Vector Stores

List all vector stores in a specific space.

Endpoint: GET /v1/spaces/{spaceId}/vector-stores

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space

Response:

[
{
"vectorStoreId": "699eb4fb78db14c7c97a9a1e",
"spaceId": "space_12345",
"name": "Product Documentation",
"description": "Embeddings for product documentation and FAQs",
"embeddingModel": "text-embedding-3-small",
"embeddingDimension": 1536,
"chunkSize": 1000,
"chunkOverlap": 200,
"embeddingCount": 150,
"createdAt": "2025-10-09T10:00:00+00:00",
"updatedAt": "2025-10-09T14:30:00+00:00"
}
]

Example Request:

curl -X 'GET' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/vector-stores' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY'

Response Codes:

  • 200: Vector stores retrieved successfully
  • 404: Space not found
  • 500: Failed to retrieve vector stores

Update Vector Store

Update an existing vector store. All fields are optional. Note: changing chunkSize or chunkOverlap only affects future embeddings.

Endpoint: PUT /v1/spaces/{spaceId}/vector-stores/{vectorStoreId}

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
vectorStoreIdstringYesUnique vector store identifier

Request Body:

{
"name": "Updated Documentation Store",
"description": "Updated description for the vector store",
"chunkSize": 1500,
"chunkOverlap": 300,
"updatedBy": {
"qxId": "QX11111",
"name": "John Doe"
},
"metadata": {
"category": "documentation",
"version": "2.0"
}
}

Response:

{
"vectorStoreId": "699eb4fb78db14c7c97a9a1e",
"spaceId": "space_12345",
"name": "Updated Documentation Store",
"description": "Updated description for the vector store",
"embeddingModel": "text-embedding-3-small",
"embeddingDimension": 1536,
"chunkSize": 1500,
"chunkOverlap": 300,
"embeddingCount": 150,
"createdAt": "2025-10-09T10:00:00+00:00",
"updatedAt": "2025-10-09T16:00:00+00:00"
}

Example Request:

curl -X 'PUT' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/vector-stores/699eb4fb78db14c7c97a9a1e' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Updated Documentation Store",
"updatedBy": {
"qxId": "QX11111",
"name": "John Doe"
}
}'

Response Codes:

  • 200: Vector store updated successfully
  • 400: Invalid input data
  • 404: Vector store or space not found
  • 500: Failed to update vector store

Delete Vector Store

Delete a vector store permanently. Warning: This action is irreversible and will delete all associated embeddings.

Endpoint: DELETE /v1/spaces/{spaceId}/vector-stores/{vectorStoreId}

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
vectorStoreIdstringYesUnique vector store identifier

Response:

{
"vectorStoreId": "699eb4fb78db14c7c97a9a1e",
"deleted": true
}

Example Request:

curl -X 'DELETE' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/vector-stores/699eb4fb78db14c7c97a9a1e' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY'

Response Codes:

  • 200: Vector store deleted successfully
  • 404: Vector store or space not found
  • 500: Failed to delete vector store

Embeddings

Embeddings are vector representations of text chunks stored in vector stores for semantic search.

Create Embeddings (Batch)

Create multiple embeddings in a vector store.

Endpoint: POST /v1/spaces/{spaceId}/vector-stores/{vectorStoreId}/embeddings

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
vectorStoreIdstringYesUnique vector store identifier

Request Body:

{
"embeddings": [
[0.0123, -0.0456, 0.0789],
[0.0234, -0.0567, 0.0891]
],
"chunks": [
"To reset your password, navigate to Settings > Account > Security.",
"Password requirements: minimum 12 characters with uppercase, lowercase, and numbers."
],
"documentIds": [
"user_guide_2024",
"user_guide_2024"
],
"sequences": [1, 2],
"metadata": [
{
"page": 5,
"category": "security",
"section": "account_management"
},
{
"page": 5,
"category": "security",
"section": "password_policy"
}
]
}

Response:

[
{
"embeddingId": "678901abc234def5678901",
"vectorStoreId": "699eb4fb78db14c7c97a9a1e",
"chunk": "To reset your password, navigate to Settings > Account > Security.",
"documentId": "user_guide_2024",
"sequence": 1,
"metadata": {
"page": 5,
"category": "security"
},
"createdAt": "2025-10-09T11:00:00+00:00"
},
{
"embeddingId": "678901abc234def5678902",
"vectorStoreId": "699eb4fb78db14c7c97a9a1e",
"chunk": "Password requirements: minimum 12 characters with uppercase, lowercase, and numbers.",
"documentId": "user_guide_2024",
"sequence": 2,
"metadata": {
"page": 5,
"category": "security"
},
"createdAt": "2025-10-09T11:00:00+00:00"
}
]

Example Request:

curl -X 'POST' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/vector-stores/699eb4fb78db14c7c97a9a1e/embeddings' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"embeddings": [[0.0123, -0.0456, 0.0789]],
"chunks": ["Password reset instructions..."],
"documentIds": ["user_guide_2024"],
"sequences": [1],
"metadata": [{"page": 5, "category": "security"}]
}'

Response Codes:

  • 201: Embeddings created successfully
  • 400: Invalid input data or dimension mismatch
  • 404: Vector store or space not found
  • 500: Failed to create embeddings

Fields:

FieldTypeRequiredDescription
embeddingsarray[array[float]]YesList of embedding vectors. Each must match the vector store's embeddingDimension (1024, 1536, or 3072). All vectors in one batch must have the same dimension.
chunksarray[string]NoCorresponding source text for each embedding
documentIdsarray[string]NoDocument identifier for each embedding (groups chunks from the same source)
sequencesarray[integer]NoSequential position of each chunk within its document (0-indexed)
metadataarray[object]NoPer-embedding metadata objects for filtering and context

Important Notes:

  • Each embedding vector length must exactly match the vector store's embeddingDimension
  • All arrays (embeddings, chunks, documentIds, sequences, metadata) must have the same length
  • Supported dimensions: 1024, 1536, and 3072
  • Mismatched dimensions will result in a 400 Bad Request error
  • Generate embeddings using your embedding model before calling this API

List Embeddings

List all embeddings in a vector store.

Endpoint: GET /v1/spaces/{spaceId}/vector-stores/{vectorStoreId}/embeddings

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
vectorStoreIdstringYesUnique vector store identifier

Response:

[
{
"embeddingId": "678901abc234def5678901",
"vectorStoreId": "699eb4fb78db14c7c97a9a1e",
"chunk": "To reset your password...",
"documentId": "user_guide_2024",
"sequence": 1,
"metadata": {
"page": 5,
"category": "security"
},
"createdAt": "2025-10-09T11:00:00+00:00"
}
]

Example Request:

curl -X 'GET' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/vector-stores/699eb4fb78db14c7c97a9a1e/embeddings' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY'

Response Codes:

  • 200: Embeddings retrieved successfully
  • 404: Vector store or space not found
  • 500: Failed to retrieve embeddings

Delete Embeddings

Delete embeddings by IDs or delete all embeddings in a vector store. Warning: Deletion is permanent and cannot be undone.

Endpoint: DELETE /v1/spaces/{spaceId}/vector-stores/{vectorStoreId}/embeddings

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
vectorStoreIdstringYesUnique vector store identifier

Request Body:

{
"embeddingIds": ["678901abc234def5678901", "678901abc234def5678902"],
"deleteAll": false
}

Response:

{
"deleted": 2,
"vectorStoreId": "699eb4fb78db14c7c97a9a1e"
}

Example Request:

curl -X 'DELETE' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/vector-stores/699eb4fb78db14c7c97a9a1e/embeddings' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"embeddingIds": ["678901abc234def5678901", "678901abc234def5678902"],
"deleteAll": false
}'

Response Codes:

  • 200: Embeddings deleted successfully
  • 400: Invalid request (must provide embeddingIds or deleteAll: true)
  • 404: Vector store or space not found
  • 500: Failed to delete embeddings

Perform semantic similarity search using vector embeddings. Essential for RAG applications.

Search by Vector

Find the most similar embeddings using cosine similarity.

Endpoint: POST /v1/spaces/{spaceId}/vector-stores/{vectorStoreId}/search

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
vectorStoreIdstringYesUnique vector store identifier

Request Body:

{
"queryEmbedding": [0.0123, -0.0456, 0.0789, ...],
"limit": 10,
"metadataFilter": {
"category": "security",
"page": {"$gte": 1}
},
"scoreThreshold": 0.75,
"includeEmbeddings": false
}

Response:

{
"vectorStoreId": "699eb4fb78db14c7c97a9a1e",
"results": [
{
"embeddingId": "678901abc234def5678902",
"score": 0.92,
"chunk": "To reset your password, navigate to Settings > Account > Security.",
"documentId": "user_guide_2024",
"sequence": 42,
"metadata": {
"page": 5,
"category": "security"
}
},
{
"embeddingId": "678901abc234def5678903",
"score": 0.87,
"chunk": "Password requirements: minimum 12 characters...",
"documentId": "user_guide_2024",
"sequence": 43,
"metadata": {
"page": 5,
"category": "security"
}
}
]
}

Example Request:

curl -X 'POST' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/vector-stores/699eb4fb78db14c7c97a9a1e/search' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"queryEmbedding": [0.0123, -0.0456, 0.0789],
"limit": 5,
"scoreThreshold": 0.7
}'

Response Codes:

  • 200: Search completed successfully
  • 400: Invalid query embedding or parameters
  • 404: Vector store or space not found
  • 500: Search failed

Fields:

FieldTypeRequiredDescription
queryEmbeddingarray[float]YesQuery vector (must match vector store dimensions exactly)
limitintegerNoMax results (1-100, default: 10)
metadataFilterobjectNoMongoDB-style metadata filters
scoreThresholdfloatNoMinimum similarity score (0-1, recommended: 0.7-0.8)
includeEmbeddingsbooleanNoInclude full embedding vectors in response (default: false)

Important Notes:

  • The queryEmbedding must have the exact same number of dimensions as the vector store's configured embeddingDimension
  • Supported dimensions: 1024, 1536, 3072
  • Dimension mismatches will result in a 400 Bad Request error
  • The API automatically uses the correct vector search index based on the vector store's dimension configuration

Score Interpretation:

  • 0.9-1.0: Very similar, highly relevant
  • 0.8-0.9: Highly relevant
  • 0.7-0.8: Relevant
  • <0.7: Less relevant

Perform full-text keyword search using MongoDB Atlas Search with BM25 ranking. Supports fuzzy matching and metadata filtering.

Search by Keywords

Find embeddings matching specific keywords in the chunk text.

Endpoint: POST /v1/spaces/{spaceId}/vector-stores/{vectorStoreId}/keyword-search

Authentication: Required

Path Parameters:

ParameterTypeRequiredDescription
spaceIdstringYesUnique identifier for the space
vectorStoreIdstringYesUnique vector store identifier

Request Body:

{
"queryText": "SDK configuration",
"limit": 10,
"metadataFilter": {
"category": "documentation",
"page": 1
},
"fuzzy": true
}

Response:

{
"vectorStoreId": "699eb4fb78db14c7c97a9a1e",
"results": [
{
"embeddingId": "678901abc234def5678905",
"score": 0.92,
"chunk": "To configure the SDK, create a config.json file in your project root...",
"documentId": "sdk_guide_2024",
"sequence": 15,
"metadata": {
"category": "documentation",
"page": 1
}
}
]
}

Example Request:

curl -X 'POST' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/vector-stores/699eb4fb78db14c7c97a9a1e/keyword-search' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"queryText": "password reset",
"limit": 5,
"fuzzy": true
}'

Response Codes:

  • 200: Search completed successfully
  • 400: Invalid query text or metadata filter
  • 404: Vector store or space not found
  • 500: Search failed

Fields:

FieldTypeRequiredDescription
queryTextstringYesText query to search for (1-10,000 characters)
limitintegerNoMax results (1-100, default: 10)
metadataFilterobjectNoOptional metadata filters (string fields use 'text' operator, numbers/booleans use 'equals' operator)
fuzzybooleanNoEnable fuzzy matching for typo tolerance (default: true, maxEdits: 2)

Search with multiple keywords and strict metadata filtering. Supports AND/OR logic for keywords.

Endpoint: POST /v1/spaces/{spaceId}/vector-stores/{vectorStoreId}/keyword-filter-search

Authentication: Required

Request Body:

{
"keywords": ["SDK", "configuration"],
"filters": {
"category": "documentation",
"contentType": "api_reference",
"page": 1
},
"limit": 10,
"requireAllKeywords": false
}

Response:

{
"vectorStoreId": "699eb4fb78db14c7c97a9a1e",
"results": [
{
"embeddingId": "678901abc234def5678906",
"score": 0.95,
"chunk": "The SDK provides a comprehensive API for configuration...",
"documentId": "sdk_guide_2024",
"sequence": 42,
"metadata": {
"category": "documentation",
"contentType": "api_reference",
"page": 1
}
}
]
}

Example Request:

curl -X 'POST' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/vector-stores/699eb4fb78db14c7c97a9a1e/keyword-filter-search' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"keywords": ["password", "reset"],
"filters": {"category": "security"},
"requireAllKeywords": false
}'

Response Codes:

  • 200: Search completed successfully
  • 400: Invalid keywords or filters
  • 404: Vector store or space not found
  • 500: Search failed

Fields:

FieldTypeRequiredDescription
keywordsarray[string]YesList of keywords to search (1-10 keywords)
filtersobjectYesRequired metadata filters (all must match - AND logic)
limitintegerNoMax results (1-100, default: 10)
requireAllKeywordsbooleanNoKeyword logic: false = OR (at least one must match), true = AND (all must match). Default: false

Backend Query Logic:

  • requireAllKeywords: false → Keywords in 'should' clause (OR logic, at least one keyword must match)
  • requireAllKeywords: true → Keywords in 'must' clause (AND logic, all keywords must match)
  • Filters always in 'must' clause (all required filters must match)

Combine vector similarity and keyword search for optimal results. Recommended for production RAG applications.

Hybrid Search

Perform combined vector and keyword search with configurable weighting.

Endpoint: POST /v1/spaces/{spaceId}/vector-stores/{vectorStoreId}/hybrid-search

Authentication: Required

Request Body:

{
"queryText": "How to reset password?",
"queryEmbedding": [0.0123, -0.0456, 0.0789, ...],
"limit": 10,
"vectorWeight": 0.7,
"metadataFilter": {
"category": "security"
},
"scoreThreshold": 0.7,
"includeEmbeddings": false
}

Response:

{
"vectorStoreId": "699eb4fb78db14c7c97a9a1e",
"results": [
{
"embeddingId": "678901abc234def5678902",
"score": 0.89,
"chunk": "To reset your password, navigate to Settings...",
"documentId": "user_guide_2024",
"sequence": 42,
"metadata": {
"category": "security"
}
}
]
}

Example Request:

curl -X 'POST' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/vector-stores/699eb4fb78db14c7c97a9a1e/hybrid-search' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"queryText": "password reset",
"queryEmbedding": [0.0123, -0.0456, 0.0789],
"vectorWeight": 0.7
}'

Response Codes:

  • 200: Search completed successfully
  • 400: Invalid parameters
  • 404: Vector store or space not found
  • 500: Search failed

Fields:

FieldTypeRequiredDescription
queryTextstringYesText query for keyword matching
queryEmbeddingarray[float]YesQuery vector for semantic search
limitintegerNoMax results (1-100, default: 10)
vectorWeightfloatNoWeight for vector search (0-1, default: 0.7). Remaining weight goes to keyword search
metadataFilterobjectNoOptional metadata filters
scoreThresholdfloatNoMinimum combined score threshold (0-1)
includeEmbeddingsbooleanNoInclude full embedding vectors (default: false)

Weighting Guide:

  • 0.7 (default): 70% vector, 30% keyword - Balanced, recommended for most use cases
  • 0.8-0.9: Favor semantic similarity - Better for concept matching
  • 0.5-0.6: More keyword emphasis - Better for exact term matching
  • 1.0: Vector only
  • 0.0: Keyword only

Search Evaluation

Evaluate search quality using RAG metrics. Useful for optimizing search strategies and parameters.

Evaluate Search Quality

Compare different search strategies and get performance metrics.

Endpoint: POST /v1/spaces/{spaceId}/vector-stores/{vectorStoreId}/evaluate

Authentication: Required

Request Body:

{
"queryText": "How to reset password?",
"queryEmbedding": [0.0123, -0.0456, ...],
"relevantIds": ["emb_123", "emb_456"],
"k": 10,
"compareStrategies": true
}

Response:

{
"metrics": {
"precisionAtK": 0.9,
"recallAtK": 0.85,
"mrr": 0.95,
"ndcg": 0.92,
"averageScore": 0.91,
"totalResults": 10,
"relevantResults": 9
},
"comparison": {
"Vector Only": {
"precisionAtK": 0.8,
"recallAtK": 0.7,
"mrr": 0.9,
"ndcg": 0.85,
"averageScore": 0.88,
"totalResults": 10,
"relevantResults": 8
},
"Keyword Only": {
"precisionAtK": 0.7,
"recallAtK": 0.6,
"mrr": 0.8,
"ndcg": 0.75,
"averageScore": 0.78,
"totalResults": 10,
"relevantResults": 7
},
"Hybrid": {
"precisionAtK": 0.9,
"recallAtK": 0.85,
"mrr": 0.95,
"ndcg": 0.92,
"averageScore": 0.91,
"totalResults": 10,
"relevantResults": 9
}
},
"recommendations": [
"High precision - search is working well",
"Best performing strategy: Hybrid"
]
}

Example Request:

curl -X 'POST' \
'https://agents.api.caip.bmw.cloud/v1/spaces/space_12345/vector-stores/699eb4fb78db14c7c97a9a1e/evaluate' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"queryText": "How to reset password?",
"queryEmbedding": [0.0123, -0.0456, 0.0789],
"relevantIds": ["678901abc234def5678901", "678901abc234def5678902"],
"k": 10,
"compareStrategies": true
}'

Response Codes:

  • 200: Evaluation completed successfully
  • 400: Invalid parameters
  • 404: Vector store or space not found

Fields:

FieldTypeRequiredDescription
queryTextstringYesThe search query text
queryEmbeddingarray[float]YesQuery embedding vector
relevantIdsarray[string]YesKnown relevant embedding IDs for evaluation (1+ IDs)
kintegerNoNumber of top results to evaluate (1-100, default: 10)
compareStrategiesbooleanNoCompare all search strategies (vector, keyword, hybrid). Default: true

Metrics Explained:

  • Precision@K: Proportion of retrieved results that are relevant (0-1, higher is better)
  • Recall@K: Proportion of relevant results that were retrieved (0-1, higher is better)
  • MRR (Mean Reciprocal Rank): 1 / rank of first relevant result (0-1, higher is better)
  • NDCG (Normalized Discounted Cumulative Gain): Quality of ranking (0-1, higher is better)

Version 1.0.0 (2025-01-09)

Initial Release

  • Agent management (CRUD operations)
  • Thread management for conversations
  • Message handling within threads
  • Model listing and selection
  • API key authentication (Authorization: Bearer <your-api-key> header)
  • MongoDB backend integration
  • Comprehensive error handling
  • Rate limiting support
  • CORS configuration for browser access
  • Vector Search & RAG Functionality

Version 1.1 (2026-08-04)

Minor Enhancements

  • Authentication examples updated to use the Authorization: Bearer <your-api-key> header consistently across all endpoints
  • Telemetry endpoint references removed from this API reference to reflect the current Agents API surface
  • Search documentation clarified to cover vector, keyword, keyword-filter, hybrid, and evaluation endpoints

Support

For questions, issues, or feature requests:


External Documentation

Contact

For support, contact: ConnectedAI@bmw.de