# Agent Template

Manage Agent Templates

## Listing available agent templates

> Retrieves agent templates which can be later use as a base for custom agents.

```json
{"openapi":"3.0.0","info":{"title":"AI Service","version":"0.0.1"},"tags":[{"name":"Agent Template","description":"Manage Agent Templates"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["ai.agent_read"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"scopes":{"ai.text_manage":"Needed to execute actions related to the text generation.","ai.completion_manage":"Needed to execute actions related to the AI completions.","ai.agent_read":"Needed to read AI agents.","ai.agent_manage":"Needed to manage AI agents."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"schemas":{"AgentTemplateResponse":{"allOf":[{"$ref":"#/components/schemas/BaseForAgentAndTemplate"},{"type":"object","properties":{"templatePrompt":{"type":"string","description":"Immutable LLM base prompt which is concatenated with the `userPrompt`."},"id":{"type":"string","description":"Identifier of the agent."},"nativeTools":{"$ref":"#/components/schemas/NativeToolsResponse"},"mcpServers":{"$ref":"#/components/schemas/AgentMcpServersResponse"}}}]},"BaseForAgentAndTemplate":{"allOf":[{"$ref":"#/components/schemas/BaseForAgentAndTemplateAndHandOff"},{"type":"object","properties":{"userPrompt":{"type":"string","description":"LLM Prompt which describes how agent should work in a detailed way, which tools it could use to solve problems etc; it can contain examples and step by step guidance."},"icon":{"type":"string","description":"The fa class of react icon."},"tags":{"type":"array","items":{"type":"string","description":"Markers that allow you to categorize the agent."}},"enabled":{"type":"boolean","description":"Indicates whether the agent is enabled.","default":false}},"required":["name"]}]},"BaseForAgentAndTemplateAndHandOff":{"type":"object","properties":{"name":{"type":"object","description":"Localized name of the agent.","additionalProperties":{"type":"string"}},"description":{"type":"object","description":"Description of the agent.","additionalProperties":{"type":"string"}}}},"NativeToolsResponse":{"type":"array","description":"List of native tools which agents should have access to.","items":{"oneOf":[{"$ref":"#/components/schemas/SlackNativeToolResponse"},{"$ref":"#/components/schemas/RagCustomNativeToolResponse"},{"$ref":"#/components/schemas/RagEmporixNativeToolResponse"}]}},"SlackNativeToolResponse":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the tool."},"type":{"description":"For SlackNativeTool it has to be set to `slack`."},"config":{"$ref":"#/components/schemas/SlackNativeToolConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"BaseNativeTool":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/NativeToolType"},"name":{"type":"string","description":"Name of the tool."},"enabled":{"type":"boolean","description":"An indicator whether the tool is enabled.","default":false}},"required":["type","name"]},"NativeToolType":{"type":"string","enum":["slack","rag_custom","rag_emporix"],"description":"Type of the native tool."},"SlackNativeToolConfigResponse":{"type":"object","properties":{"teamId":{"type":"string","description":"Unique identifier of the Slack workspace (team) associated with the request. Used to distinguish the source Slack environment when handling events or API calls."}},"required":["teamId"]},"MetadataResponse":{"allOf":[{"$ref":"#/components/schemas/MetadataRequest"},{"type":"object","properties":{"createdAt":{"description":"Date and time when the object was created. The value is approved as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"},"modifiedAt":{"description":"Date and time when the object was last modified. The value is approved as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"}},"required":["version","createdAt","modifiedAt"]}]},"MetadataRequest":{"type":"object","properties":{"version":{"minimum":1,"type":"integer","description":"Version of the object. The version is required during the update operation because of the optimistic locking mechanism."}},"required":["version"]},"RagCustomNativeToolResponse":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the tool."},"type":{"description":"For `RagCustomNativeTool`, it has to be set to `rag_custom`."},"config":{"$ref":"#/components/schemas/RagCustomNativeToolConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"RagCustomNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagCustomNativeToolConfig"},{"type":"object","properties":{"databaseConfig":{"$ref":"#/components/schemas/RagCustomDatabaseNativeToolConfigResponse"},"embeddingConfig":{"$ref":"#/components/schemas/RagCustomEmbeddingNativeToolConfigResponse"}}}]},"RagCustomNativeToolConfig":{"type":"object","properties":{"prompt":{"type":"string","description":"The prompt for an agent. It should define when and why this tool is to be called."},"maxResults":{"type":"integer","default":5,"description":"The maximum number of results found in the Vector Database."}},"required":["prompt"]},"RagCustomDatabaseNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagCustomDatabaseNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"RagCustomDatabaseNativeToolConfig":{"type":"object","properties":{"url":{"type":"string","description":"URL of the database."},"type":{"allOf":[{"$ref":"#/components/schemas/RagCustomDatabaseType"}]},"entityType":{"allOf":[{"$ref":"#/components/schemas/RagEntityType"}]},"collectionName":{"type":"string","description":"Name of the database collection."}},"required":["url","type","entityType","collectionName"]},"RagCustomDatabaseType":{"type":"string","enum":["qdrant"],"description":"Type of the database."},"RagEntityType":{"type":"string","enum":["product"],"description":"Type of the entity which is stored in the given collection."},"ExpandableTokenResponse":{"oneOf":[{"$ref":"#/components/schemas/InnerTokenResponse"},{"$ref":"#/components/schemas/ExpandedTokenResponse"}],"description":"The full response representing token. If the `expand=token` is **not** used, then only `id` field is returned, otherwise all fields are returned."},"InnerTokenResponse":{"type":"object","properties":{"id":{"type":"string","description":"ID of the token."}}},"ExpandedTokenResponse":{"allOf":[{"$ref":"#/components/schemas/InnerTokenResponse"},{"type":"object","properties":{"name":{"type":"string","description":"Name of the token."},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"RagCustomEmbeddingNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagCustomEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"RagCustomEmbeddingNativeToolConfig":{"type":"object","properties":{"model":{"type":"string","description":"Name of the OpenAI LLM model which should be used to create embedding of user's input in order to perform search operation."}},"required":["model"]},"RagEmporixNativeToolResponse":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the tool."},"type":{"description":"For `RagEmporixNativeTool`, it has to be set to `rag_emporix`."},"config":{"$ref":"#/components/schemas/RagEmporixNativeToolConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"RagEmporixNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagEmporixNativeToolConfig"},{"type":"object","properties":{"embeddingConfig":{"oneOf":[{"$ref":"#/components/schemas/EmporixOpenAiRagEmporixEmbeddingNativeToolConfig"},{"$ref":"#/components/schemas/OpenAiRagEmporixEmbeddingNativeToolConfigResponse"},{"$ref":"#/components/schemas/SelfHostedOllamaRagEmporixEmbeddingNativeToolConfigResponse"}]}}}]},"RagEmporixNativeToolConfig":{"type":"object","properties":{"prompt":{"type":"string","description":"The prompt for an agent. It should define when and why this tool is to be called."},"entityType":{"allOf":[{"$ref":"#/components/schemas/RagEntityType"}]},"indexedFields":{"type":"array","description":"This field specifies the fields of the given entityType that are used for generating embeddings. The provided values are then concatenated and converted to embeddings.","items":{"type":"object","properties":{"name":{"type":"string","description":"It can act as an alias for the field key. For example, if the 'name.en' key is provided then its alias could be 'English Name' and that value is used in embedding input."},"key":{"type":"string","description":"Unique value representing the entityType key."}},"required":["key"]}}},"required":["prompt","entityType","indexedFields"]},"EmporixOpenAiRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'emporix_openai'."}},"required":["provider"]},"RagLlmProvider":{"type":"string","enum":["emporix_openai","openai","self_hosted_ollama"]},"OpenAiRagEmporixEmbeddingNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/OpenAiRagEmporixEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"OpenAiRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'emporix_openai'."},"model":{"type":"string","description":"OpenAI LLM model to be used for generating embeddings for indexed products and user's input query."},"dimensions":{"type":"integer","description":"Number of dimensions of embedding.","minimum":128,"maximum":4096}},"required":["provider","model","dimensions"]},"SelfHostedOllamaRagEmporixEmbeddingNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/SelfHostedOllamaRagEmporixEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"SelfHostedOllamaRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'self_hosted_ollama'."},"model":{"type":"string","description":"Ollama LLM model to be used for generating embeddings for indexed products and user's input query."},"dimensions":{"type":"integer","description":"Number of dimensions of embedding.","minimum":128,"maximum":4096},"url":{"type":"string","description":"Base URL where Ollama is hosted."}},"required":["provider","model","dimensions","url"]},"AgentMcpServersResponse":{"type":"array","description":"List of MCP servers which agents should have access to.","items":{"oneOf":[{"$ref":"#/components/schemas/CustomAgentMcpServerResponse"},{"$ref":"#/components/schemas/PredefinedAgentMcpServer"}]}},"CustomAgentMcpServerResponse":{"allOf":[{"$ref":"#/components/schemas/CustomAgentMcpServerRequest"},{"type":"object","properties":{"mcpServer":{"allOf":[{"$ref":"#/components/schemas/McpServerResponse"},{"description":"The full response representing MCP server. If the `expand=mcpServer` is **not** used, then only `id` field is returned, otherwise all fields are returned."}]}}}]},"CustomAgentMcpServerRequest":{"allOf":[{"$ref":"#/components/schemas/BaseAgentMcpServer"},{"type":"object","properties":{"type":{"description":"For `CustomMcpServer` it has to be set to `custom`."},"mcpServer":{"type":"object","properties":{"id":{"type":"string","description":"ID of the MCP server."}},"required":["id"]}},"required":["mcpServer"]}]},"BaseAgentMcpServer":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/McpServerType"}},"required":["type"]},"McpServerType":{"type":"string","enum":["custom","predefined"],"description":"Type of the MCP server. The `custom` type allows you to integrate with your own MCP server instance, while the `predefined` type allows you to integrate with one of the instances provided by Emporix."},"McpServerResponse":{"allOf":[{"$ref":"#/components/schemas/BaseMcpServer"},{"type":"object","properties":{"config":{"$ref":"#/components/schemas/McpServerConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"BaseMcpServer":{"type":"object","description":"An object representing customer's own implementation of the MCP server.","properties":{"name":{"type":"string","description":"Name of the MCP server."},"enabled":{"type":"boolean","description":"An indicator whether the MCP server is enabled.","default":false},"transport":{"$ref":"#/components/schemas/CustomMcpServerTransportType"}}},"CustomMcpServerTransportType":{"type":"string","enum":["streamable_http","sse"],"description":"Type of the communication between the agent and the MCP server. The `streamable_http` protocol is recommended, since the `sse` protocol is deprecated."},"McpServerConfigResponse":{"allOf":[{"$ref":"#/components/schemas/McpServerConfig"},{"type":"object","properties":{"authorizationHeaderToken":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"McpServerConfig":{"type":"object","properties":{"url":{"type":"string","description":"URL of the MCP server."},"authorizationHeaderName":{"type":"string","description":"Name of the header required for authorization, e.g. `Authorization`."}},"required":["url"]},"PredefinedAgentMcpServer":{"allOf":[{"$ref":"#/components/schemas/BaseAgentMcpServer"},{"type":"object","properties":{"type":{"description":"For the `PredefinedMcpServer` it has to be set to `predefined`."},"domain":{"enum":["customer","extensibility","order","product","frontend"]},"tools":{"type":"array","description":"List of the tools which should be used by the agent from this particular MCP server.","items":{"type":"string"}}}}]},"ErrorMessageFault":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}},"ErrorMessage":{"type":"object","properties":{"code":{"type":"integer"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"}}}}},"description":""}},"responses":{"401_resp_common":{"description":"The authorization token is invalid or has expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageFault"}}}},"403_resp_common":{"description":"Authorization scopes of the access token are not sufficient and do not match the scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}},"paths":{"/ai-service/{tenant}/agentic/templates":{"get":{"summary":"Listing available agent templates","operationId":"GET-ai-list-templates","responses":{"200":{"description":"List of available agent templates.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentTemplateResponse"}}}}},"400":{"$ref":"#/components/responses/401_resp_common"},"401":{"$ref":"#/components/responses/401_resp_common"},"403":{"$ref":"#/components/responses/403_resp_common"}},"description":"Retrieves agent templates which can be later use as a base for custom agents.","tags":["Agent Template"]}}}}
```

## Searching agent templates

> Searches for agent templates based on the provided query.

```json
{"openapi":"3.0.0","info":{"title":"AI Service","version":"0.0.1"},"tags":[{"name":"Agent Template","description":"Manage Agent Templates"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["ai.agent_read"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"scopes":{"ai.text_manage":"Needed to execute actions related to the text generation.","ai.completion_manage":"Needed to execute actions related to the AI completions.","ai.agent_read":"Needed to read AI agents.","ai.agent_manage":"Needed to manage AI agents."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"schemas":{"AgentTemplateResponse":{"allOf":[{"$ref":"#/components/schemas/BaseForAgentAndTemplate"},{"type":"object","properties":{"templatePrompt":{"type":"string","description":"Immutable LLM base prompt which is concatenated with the `userPrompt`."},"id":{"type":"string","description":"Identifier of the agent."},"nativeTools":{"$ref":"#/components/schemas/NativeToolsResponse"},"mcpServers":{"$ref":"#/components/schemas/AgentMcpServersResponse"}}}]},"BaseForAgentAndTemplate":{"allOf":[{"$ref":"#/components/schemas/BaseForAgentAndTemplateAndHandOff"},{"type":"object","properties":{"userPrompt":{"type":"string","description":"LLM Prompt which describes how agent should work in a detailed way, which tools it could use to solve problems etc; it can contain examples and step by step guidance."},"icon":{"type":"string","description":"The fa class of react icon."},"tags":{"type":"array","items":{"type":"string","description":"Markers that allow you to categorize the agent."}},"enabled":{"type":"boolean","description":"Indicates whether the agent is enabled.","default":false}},"required":["name"]}]},"BaseForAgentAndTemplateAndHandOff":{"type":"object","properties":{"name":{"type":"object","description":"Localized name of the agent.","additionalProperties":{"type":"string"}},"description":{"type":"object","description":"Description of the agent.","additionalProperties":{"type":"string"}}}},"NativeToolsResponse":{"type":"array","description":"List of native tools which agents should have access to.","items":{"oneOf":[{"$ref":"#/components/schemas/SlackNativeToolResponse"},{"$ref":"#/components/schemas/RagCustomNativeToolResponse"},{"$ref":"#/components/schemas/RagEmporixNativeToolResponse"}]}},"SlackNativeToolResponse":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the tool."},"type":{"description":"For SlackNativeTool it has to be set to `slack`."},"config":{"$ref":"#/components/schemas/SlackNativeToolConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"BaseNativeTool":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/NativeToolType"},"name":{"type":"string","description":"Name of the tool."},"enabled":{"type":"boolean","description":"An indicator whether the tool is enabled.","default":false}},"required":["type","name"]},"NativeToolType":{"type":"string","enum":["slack","rag_custom","rag_emporix"],"description":"Type of the native tool."},"SlackNativeToolConfigResponse":{"type":"object","properties":{"teamId":{"type":"string","description":"Unique identifier of the Slack workspace (team) associated with the request. Used to distinguish the source Slack environment when handling events or API calls."}},"required":["teamId"]},"MetadataResponse":{"allOf":[{"$ref":"#/components/schemas/MetadataRequest"},{"type":"object","properties":{"createdAt":{"description":"Date and time when the object was created. The value is approved as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"},"modifiedAt":{"description":"Date and time when the object was last modified. The value is approved as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"}},"required":["version","createdAt","modifiedAt"]}]},"MetadataRequest":{"type":"object","properties":{"version":{"minimum":1,"type":"integer","description":"Version of the object. The version is required during the update operation because of the optimistic locking mechanism."}},"required":["version"]},"RagCustomNativeToolResponse":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the tool."},"type":{"description":"For `RagCustomNativeTool`, it has to be set to `rag_custom`."},"config":{"$ref":"#/components/schemas/RagCustomNativeToolConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"RagCustomNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagCustomNativeToolConfig"},{"type":"object","properties":{"databaseConfig":{"$ref":"#/components/schemas/RagCustomDatabaseNativeToolConfigResponse"},"embeddingConfig":{"$ref":"#/components/schemas/RagCustomEmbeddingNativeToolConfigResponse"}}}]},"RagCustomNativeToolConfig":{"type":"object","properties":{"prompt":{"type":"string","description":"The prompt for an agent. It should define when and why this tool is to be called."},"maxResults":{"type":"integer","default":5,"description":"The maximum number of results found in the Vector Database."}},"required":["prompt"]},"RagCustomDatabaseNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagCustomDatabaseNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"RagCustomDatabaseNativeToolConfig":{"type":"object","properties":{"url":{"type":"string","description":"URL of the database."},"type":{"allOf":[{"$ref":"#/components/schemas/RagCustomDatabaseType"}]},"entityType":{"allOf":[{"$ref":"#/components/schemas/RagEntityType"}]},"collectionName":{"type":"string","description":"Name of the database collection."}},"required":["url","type","entityType","collectionName"]},"RagCustomDatabaseType":{"type":"string","enum":["qdrant"],"description":"Type of the database."},"RagEntityType":{"type":"string","enum":["product"],"description":"Type of the entity which is stored in the given collection."},"ExpandableTokenResponse":{"oneOf":[{"$ref":"#/components/schemas/InnerTokenResponse"},{"$ref":"#/components/schemas/ExpandedTokenResponse"}],"description":"The full response representing token. If the `expand=token` is **not** used, then only `id` field is returned, otherwise all fields are returned."},"InnerTokenResponse":{"type":"object","properties":{"id":{"type":"string","description":"ID of the token."}}},"ExpandedTokenResponse":{"allOf":[{"$ref":"#/components/schemas/InnerTokenResponse"},{"type":"object","properties":{"name":{"type":"string","description":"Name of the token."},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"RagCustomEmbeddingNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagCustomEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"RagCustomEmbeddingNativeToolConfig":{"type":"object","properties":{"model":{"type":"string","description":"Name of the OpenAI LLM model which should be used to create embedding of user's input in order to perform search operation."}},"required":["model"]},"RagEmporixNativeToolResponse":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the tool."},"type":{"description":"For `RagEmporixNativeTool`, it has to be set to `rag_emporix`."},"config":{"$ref":"#/components/schemas/RagEmporixNativeToolConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"RagEmporixNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagEmporixNativeToolConfig"},{"type":"object","properties":{"embeddingConfig":{"oneOf":[{"$ref":"#/components/schemas/EmporixOpenAiRagEmporixEmbeddingNativeToolConfig"},{"$ref":"#/components/schemas/OpenAiRagEmporixEmbeddingNativeToolConfigResponse"},{"$ref":"#/components/schemas/SelfHostedOllamaRagEmporixEmbeddingNativeToolConfigResponse"}]}}}]},"RagEmporixNativeToolConfig":{"type":"object","properties":{"prompt":{"type":"string","description":"The prompt for an agent. It should define when and why this tool is to be called."},"entityType":{"allOf":[{"$ref":"#/components/schemas/RagEntityType"}]},"indexedFields":{"type":"array","description":"This field specifies the fields of the given entityType that are used for generating embeddings. The provided values are then concatenated and converted to embeddings.","items":{"type":"object","properties":{"name":{"type":"string","description":"It can act as an alias for the field key. For example, if the 'name.en' key is provided then its alias could be 'English Name' and that value is used in embedding input."},"key":{"type":"string","description":"Unique value representing the entityType key."}},"required":["key"]}}},"required":["prompt","entityType","indexedFields"]},"EmporixOpenAiRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'emporix_openai'."}},"required":["provider"]},"RagLlmProvider":{"type":"string","enum":["emporix_openai","openai","self_hosted_ollama"]},"OpenAiRagEmporixEmbeddingNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/OpenAiRagEmporixEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"OpenAiRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'emporix_openai'."},"model":{"type":"string","description":"OpenAI LLM model to be used for generating embeddings for indexed products and user's input query."},"dimensions":{"type":"integer","description":"Number of dimensions of embedding.","minimum":128,"maximum":4096}},"required":["provider","model","dimensions"]},"SelfHostedOllamaRagEmporixEmbeddingNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/SelfHostedOllamaRagEmporixEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"SelfHostedOllamaRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'self_hosted_ollama'."},"model":{"type":"string","description":"Ollama LLM model to be used for generating embeddings for indexed products and user's input query."},"dimensions":{"type":"integer","description":"Number of dimensions of embedding.","minimum":128,"maximum":4096},"url":{"type":"string","description":"Base URL where Ollama is hosted."}},"required":["provider","model","dimensions","url"]},"AgentMcpServersResponse":{"type":"array","description":"List of MCP servers which agents should have access to.","items":{"oneOf":[{"$ref":"#/components/schemas/CustomAgentMcpServerResponse"},{"$ref":"#/components/schemas/PredefinedAgentMcpServer"}]}},"CustomAgentMcpServerResponse":{"allOf":[{"$ref":"#/components/schemas/CustomAgentMcpServerRequest"},{"type":"object","properties":{"mcpServer":{"allOf":[{"$ref":"#/components/schemas/McpServerResponse"},{"description":"The full response representing MCP server. If the `expand=mcpServer` is **not** used, then only `id` field is returned, otherwise all fields are returned."}]}}}]},"CustomAgentMcpServerRequest":{"allOf":[{"$ref":"#/components/schemas/BaseAgentMcpServer"},{"type":"object","properties":{"type":{"description":"For `CustomMcpServer` it has to be set to `custom`."},"mcpServer":{"type":"object","properties":{"id":{"type":"string","description":"ID of the MCP server."}},"required":["id"]}},"required":["mcpServer"]}]},"BaseAgentMcpServer":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/McpServerType"}},"required":["type"]},"McpServerType":{"type":"string","enum":["custom","predefined"],"description":"Type of the MCP server. The `custom` type allows you to integrate with your own MCP server instance, while the `predefined` type allows you to integrate with one of the instances provided by Emporix."},"McpServerResponse":{"allOf":[{"$ref":"#/components/schemas/BaseMcpServer"},{"type":"object","properties":{"config":{"$ref":"#/components/schemas/McpServerConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"BaseMcpServer":{"type":"object","description":"An object representing customer's own implementation of the MCP server.","properties":{"name":{"type":"string","description":"Name of the MCP server."},"enabled":{"type":"boolean","description":"An indicator whether the MCP server is enabled.","default":false},"transport":{"$ref":"#/components/schemas/CustomMcpServerTransportType"}}},"CustomMcpServerTransportType":{"type":"string","enum":["streamable_http","sse"],"description":"Type of the communication between the agent and the MCP server. The `streamable_http` protocol is recommended, since the `sse` protocol is deprecated."},"McpServerConfigResponse":{"allOf":[{"$ref":"#/components/schemas/McpServerConfig"},{"type":"object","properties":{"authorizationHeaderToken":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"McpServerConfig":{"type":"object","properties":{"url":{"type":"string","description":"URL of the MCP server."},"authorizationHeaderName":{"type":"string","description":"Name of the header required for authorization, e.g. `Authorization`."}},"required":["url"]},"PredefinedAgentMcpServer":{"allOf":[{"$ref":"#/components/schemas/BaseAgentMcpServer"},{"type":"object","properties":{"type":{"description":"For the `PredefinedMcpServer` it has to be set to `predefined`."},"domain":{"enum":["customer","extensibility","order","product","frontend"]},"tools":{"type":"array","description":"List of the tools which should be used by the agent from this particular MCP server.","items":{"type":"string"}}}}]},"ErrorMessage":{"type":"object","properties":{"code":{"type":"integer"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"}}}}},"description":""},"ErrorMessageFault":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}},"QParamSearchBody":{"type":"object","properties":{"q":{"type":"string","description":"A standard query parameter is used to search for specific values. \n\nSee: [Standard Practices - Query parameter](https://developer.emporix.io/api-references/standard-practices/q-param)\n"}}}},"responses":{"400_resp_common":{"description":"The request was syntactically incorrect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_resp_common":{"description":"The authorization token is invalid or has expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageFault"}}}},"403_resp_common":{"description":"Authorization scopes of the access token are not sufficient and do not match the scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"requestBodies":{"QParamSearchBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QParamSearchBody"}}}}}},"paths":{"/ai-service/{tenant}/agentic/templates/search":{"post":{"summary":"Searching agent templates","operationId":"POST-ai-search-templates","responses":{"200":{"description":"List of available agent templates.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentTemplateResponse"}}}}},"400":{"$ref":"#/components/responses/400_resp_common"},"401":{"$ref":"#/components/responses/401_resp_common"},"403":{"$ref":"#/components/responses/403_resp_common"}},"description":"Searches for agent templates based on the provided query.","requestBody":{"$ref":"#/components/requestBodies/QParamSearchBody"},"tags":["Agent Template"]}}}}
```

## Creating agent instance based on a template

> Creates an instance of the agent based of the given agent template.\
> \
> \*\*Info:\*\* Only active templates can be cloned.

```json
{"openapi":"3.0.0","info":{"title":"AI Service","version":"0.0.1"},"tags":[{"name":"Agent Template","description":"Manage Agent Templates"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["ai.agent_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"scopes":{"ai.text_manage":"Needed to execute actions related to the text generation.","ai.completion_manage":"Needed to execute actions related to the AI completions.","ai.agent_read":"Needed to read AI agents.","ai.agent_manage":"Needed to manage AI agents."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"requestBodies":{"AgentFromTemplateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentFromTemplateRequest"}}}}},"schemas":{"AgentFromTemplateRequest":{"allOf":[{"$ref":"#/components/schemas/BaseForAgentAndTemplateAndHandOff"},{"type":"object","properties":{"userPrompt":{"type":"string","description":"LLM Prompt which describes how agent should work in a detailed way, which tools it could use to solve problems etc; it can contain examples and step by step guidance."}}}],"required":["name","description","userPrompt"]},"BaseForAgentAndTemplateAndHandOff":{"type":"object","properties":{"name":{"type":"object","description":"Localized name of the agent.","additionalProperties":{"type":"string"}},"description":{"type":"object","description":"Description of the agent.","additionalProperties":{"type":"string"}}}},"IdResponse":{"type":"object","properties":{"id":{"type":"string","description":"Identifier of the resource."}}},"ErrorMessageFault":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}},"ErrorMessage":{"type":"object","properties":{"code":{"type":"integer"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"}}}}},"description":""}},"responses":{"401_resp_common":{"description":"The authorization token is invalid or has expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageFault"}}}},"403_resp_common":{"description":"Authorization scopes of the access token are not sufficient and do not match the scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}},"paths":{"/ai-service/{tenant}/agentic/templates/{templateId}/agent":{"post":{"summary":"Creating agent instance based on a template","operationId":"POST-ai-clone-template","requestBody":{"$ref":"#/components/requestBodies/AgentFromTemplateRequest"},"responses":{"201":{"description":"ID of the created agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdResponse"}}}},"400":{"$ref":"#/components/responses/401_resp_common"},"401":{"$ref":"#/components/responses/401_resp_common"},"403":{"$ref":"#/components/responses/403_resp_common"},"404":{"$ref":"#/components/responses/403_resp_common"}},"description":"Creates an instance of the agent based of the given agent template.\n\n**Info:** Only active templates can be cloned.","tags":["Agent Template"]}}}}
```
