Guides

Agentic

QnA Agent

Create QnA Agent

POST

{{baseUrl}}/orchestrator/api/agents/

creates an agent

click to see details

Request Body Parameters

Name

Type

Required

Description

name

string

Yes

The agent name.

description

string

No

A text description of the agent.

labels

array[string]

No

A list of labels to categorize the agent.

input_fields

array

No

Input field definitions.

output_fields

array

No

Output field definitions.

output_fields_schema

object

No

JSON Schema for output fields.

group

string

Yes

The group the agent belongs to.

type

string

Yes

The agent type. Set to qna for QnA agents.

Request Example

{
    "name": "hotel_faq_agent",
    "description": "",
    "labels": [],
    "input_fields": [],
    "output_fields": [],
    "output_fields_schema": {},
    "group": "preview_agentic",
    "type": "qna"
}

Response (Success)

HTTP/1.1 201 CREATED

Returns the created QnA agent.

Example

{
    "id": "5eff5fdf-89eb-4364-82c9-444cefd1c6cd",
    "input_fields": [],
    "output_fields": [],
    "output_fields_schema": {},
    "name": "hotel_faq_agent",
    "description": "",
    "group": "preview_agentic",
    "type": "qna",
    "labels": [],
    "welcome_prompt": null,
    "components": {}
}

Response (Failed)

HTTP/1.1 400 BAD_REQUEST

Update QnA Agent

PUT

{{baseUrl}}/orchestrator/api/agents/<agent_id>/

updates an agent

click to see details

URL Parameters

Name

Type

Description

Example

agent_id

uuid

The agent ID

"5eff5fdf-89eb-4364-82c9-444cefd1c6cd"

Request Body Parameters

The request body accepts all fields from the Create endpoint, along with the agent card configuration fields described in the Agent Card Schema section below.

Request Example (document mode)

{
    "name": "hotel_faq_agent",
    "description": "",
    "labels": [],
    "input_fields": [],
    "output_fields": [],
    "output_fields_schema": {},
    "group": "preview_agentic",
    "type": "qna"
}

Response (Success)

HTTP/1.1 200 OK

Returns the updated QnA agent.

Response (Failed)

HTTP/1.1 400 BAD_REQUEST
HTTP/1.1 404 NOT_FOUND

Agent Card Schema

When the QnA agent is configured and deployed, the system stores and sends a complete agent card to the Agentic Control Plane. The agent card contains all configuration needed at runtime.

Agent Card Fields

Name

Type

Required

Description

type

string (enum)

Yes

The agent type. Set to qna.

name

string

Yes

The agent name.

instructions

array[string]

Yes

Free-text agent instructions. In cag mode, this serves as the full embedded knowledge base.

welcome_prompt

string or null

No

An optional welcome prompt displayed at the start of a conversation.

tools

array

No

Tool references.

agents

array

No

Sub-agent references.

escalate_to_human

array

No

Escalation configuration.

mcp

array

No

MCP tool references.

outputs

object

No

Output schema definition.

kb_config

object

Yes (for document mode)

Knowledge base configuration. See the kb_config Object section.

outputs Object

The outputs object defines the output schema for the agent.

{
    "outputSchema": {
        "type": "object",
        "properties": {},
        "required": []
    }
}

kb_config Object

The kb_config object defines how the agent retrieves knowledge. Two modes are available.

Name

Type

Required

Description

type

string (enum)

Yes

The retrieval mode: document or cag.

project_id

uuid

Required for document

The Pathfinder project UUID. Retrieve this from GET /api/pathfinder/projects/.

inputSchema

object (JSON Schema)

Required for document

A JSON Schema describing the input parameters resolved from OCP session variables at runtime.

For cag mode, project_id and inputSchema are not required. The full knowledge context is provided in the instructions field.

inputSchema Structure

The inputSchema follows the JSON Schema format and defines input fields that the Control Plane resolves from OCP session variables at runtime.

{
    "type": "object",
    "properties": {
        "<field_name>": {
            "type": "string",
            "title": "<human-readable label>",
            "description": "<field description>"
        }
    },
    "required": ["<field_name>"]
}

Agent Card Example (document mode)

The following example shows a complete agent card for a QnA agent configured in document mode. This is stored in the database and sent as-is to the Agentic Control Plane on deployment.

{
    "name": "hotel_faq_agent",
    "type": "qna",
    "instructions": ["Answer questions about hotel services and policies."],
    "welcome_prompt": null,
    "tools": [],
    "agents": [],
    "escalate_to_human": [],
    "mcp": [],
    "outputs": {
        "outputSchema": {
            "type": "object",
            "properties": {},
            "required": []
        }
    },
    "kb_config": {
        "type": "document",
        "project_id": "43944424-23f4-46a0-aa87-a91d792e9439",
        "inputSchema": {
            "type": "object",
            "properties": {
                "hotel_id": {
                    "type": "string",
                    "title": "hotel identification",
                    "description": "This is the hotel id"
                }
            },
            "required": ["hotel_id"]
        }
    }
}

Agent Card Example (cag mode)

In cag mode, no external retrieval call is made. The instructions field contains the full knowledge base, and the LLM answers directly from that context.

{
    "name": "simple_faq_agent",
    "type": "qna",
    "instructions": [
        "You are a hotel concierge assistant.",
        "Check-in time is 3:00 PM. Check-out time is 11:00 AM.",
        "The pool is open from 7:00 AM to 10:00 PM.",
        "Room service is available 24 hours."
    ],
    "welcome_prompt": "Hello! How can I help you with your stay?",
    "tools": [],
    "agents": [],
    "escalate_to_human": [],
    "mcp": [],
    "outputs": {
        "outputSchema": {
            "type": "object",
            "properties": {},
            "required": []
        }
    },
    "kb_config": {
        "type": "cag"
    }
}

Validation Rules

The API validates the following when you create or update a QnA agent:

  • kb_config.type accepts only document or cag as values.

  • When kb_config.type is document, both kb_config.project_id and kb_config.inputSchema are required.

  • The instructions field is required for all QnA agents, regardless of the retrieval mode.

  • The type field accepts qna alongside the existing task and concierge values.

Pathfinder Projects List for QnA Agent

GET

{{baseUrl}}/orchestrator/api/pathfinder/projects/?group=<group_name>

returns the list of the Pathfinder projects for a group

click to see details

URL Parameters

Name

Type

Description

Example

group_name

string

the org group’s name

preview_agentic

Response Example

[{
    "id": "0bec802c-32a7-4eb1-a190-1868420f30b6",
    "name": "antonis_knowledge_base",
    "group": "ocp-qa-k8s-dev",
    "language": "en-US",
    "domain": "banking 2.0",
    "mode": "online",
    "kb_enabled": true,
    "vector_stores": [{
        "id": "a7ae3972-6b17-4f9e-9bd3-bd88749332e2",
        "tag": "Online-Draft",
        "embedding_model": "sentence-transformers/all-MiniLM-L6-v2",
        "deployed": true,
        "created_at": "2025-09-14T14:42:57.688679Z",
        "updated_at": "2025-10-24T13:17:03.291662Z"
    }],
    "kb_type": "document",
    "archived": false,
    "created_at": "2025-09-14T14:42:57.670960Z",
    "updated_at": "2026-03-31T06:29:31.858652Z"
}, {
    "id": "211b6022-f5ee-4027-9ad2-51c47300a0f2",
    "name": "AOK_Pathfinder1",
    "group": "ocp-qa-k8s-dev",
    "language": "en-US",
    "domain": "universal 2.0",
    "mode": "offline",
    "kb_enabled": false,
    "vector_stores": [{
        "id": "5fa17d06-4967-4ee9-8a0d-ac3347ae4962",
        "tag": "Main",
        "embedding_model": "sentence-transformers/all-MiniLM-L6-v2",
        "deployed": true,
        "created_at": "2026-03-05T13:20:03.825673Z",
        "updated_at": "2026-03-05T13:20:03.825673Z"
    }, {
        "id": "5e3a6a6b-f42f-41f9-9e89-7dac51635292",
        "tag": "Online-Draft",
        "embedding_model": "sentence-transformers/all-MiniLM-L6-v2",
        "deployed": true,
        "created_at": "2026-03-05T13:19:43.966733Z",
        "updated_at": "2026-03-05T13:19:43.966733Z"
    }, {
        "id": "2406a2d0-24e8-4fc1-b9a1-eb78285f43c5",
        "tag": "Offline-Draft",
        "embedding_model": "sentence-transformers/all-MiniLM-L6-v2",
        "deployed": true,
        "created_at": "2026-03-05T13:19:43.992586Z",
        "updated_at": "2026-03-05T13:19:43.992586Z"
    }]
    "kb_type": "chunk",
    "archived": false,
    "created_at": "2026-03-05T13:19:43.953228Z",
    "updated_at": "2026-03-05T13:19:43.953228Z"
    }]

MCP discover endpoint

POST

{{baseUrl}}/orchestrator/api/agents/mcp/discover/

discovers available MCP tools

Example Request
{
  "url": "https://mcp.context7.com/mcp",
  "headers": {
    "Authorization": "Bearer {{mcpToken}}"
  }
}
Example Response
{
    "tools": [
        {
            "name": "resolve-library-id",
            "title": "Resolve Context7 Library ID",
            "description": "Resolves a package/product name to a Context7-compatible library ID and returns matching libraries.\n\nYou MUST call this function before 'Query Documentation' tool to obtain a valid Context7-compatible library ID UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query.\n\nEach result includes:\n- Library ID: Context7-compatible identifier (format: /org/project)\n- Name: Library or package name\n- Description: Short summary\n- Code Snippets: Number of available code examples\n- Source Reputation: Authority indicator (High, Medium, Low, or Unknown)\n- Benchmark Score: Quality indicator (100 is the highest score)\n- Versions: List of versions if available. Use one of those versions if the user provides a version in their query. The format of the version is /org/project/version.\n\nFor best results, select libraries based on name match, source reputation, snippet coverage, benchmark score, and relevance to your use case.\n\nSelection Process:\n1. Analyze the query to understand what library/package the user is looking for\n2. Return the most relevant match based on:\n- Name similarity to the query (exact matches prioritized)\n- Description relevance to the query's intent\n- Documentation coverage (prioritize libraries with higher Code Snippet counts)\n- Source reputation (consider libraries with High or Medium reputation more authoritative)\n- Benchmark Score: Quality indicator (100 is the highest score)\n\nResponse Format:\n- Return the selected library ID in a clearly marked section\n- Provide a brief explanation for why this library was chosen\n- If multiple good matches exist, acknowledge this but proceed with the most relevant one\n- If no good matches exist, clearly state this and suggest query refinements\n\nFor ambiguous queries, request clarification before proceeding with a best-guess match.\n\nIMPORTANT: Do not call this tool more than 3 times per question. If you cannot find what you need after 3 calls, use the best result you have.",
            "inputSchema": {
                "$schema": "http://json-schema.org/draft-07/schema#",
                "type": "object",
                "properties": {
                    "query": {
                        "type": "string",
                        "description": "The question or task you need help with. This is used to rank library results by relevance to what the user is trying to accomplish. The query is sent to the Context7 API for processing. Do not include any sensitive or confidential information such as API keys, passwords, credentials, personal data, or proprietary code in your query."
                    },
                    "libraryName": {
                        "type": "string",
                        "description": "Library name to search for and retrieve a Context7-compatible library ID."
                    }
                },
                "required": [
                    "query",
                    "libraryName"
                ]
            },
            "outputSchema": null,
            "icons": null,
            "annotations": {
                "title": null,
                "readOnlyHint": true,
                "destructiveHint": null,
                "idempotentHint": null,
                "openWorldHint": null
            },
            "meta": null,
            "execution": {
                "taskSupport": "forbidden"
            }
        },
        {
            "name": "query-docs",
            "title": "Query Documentation",
            "description": "Retrieves and queries up-to-date documentation and code examples from Context7 for any programming library or framework.\n\nYou must call 'Resolve Context7 Library ID' tool first to obtain the exact Context7-compatible library ID required to use this tool, UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query.\n\nIMPORTANT: Do not call this tool more than 3 times per question. If you cannot find what you need after 3 calls, use the best information you have.",
            "inputSchema": {
                "$schema": "http://json-schema.org/draft-07/schema#",
                "type": "object",
                "properties": {
                    "libraryId": {
                        "type": "string",
                        "description": "Exact Context7-compatible library ID (e.g., '/mongodb/docs', '/vercel/next.js', '/supabase/supabase', '/vercel/next.js/v14.3.0-canary.87') retrieved from 'resolve-library-id' or directly from user query in the format '/org/project' or '/org/project/version'."
                    },
                    "query": {
                        "type": "string",
                        "description": "The question or task you need help with. Be specific and include relevant details. Good: 'How to set up authentication with JWT in Express.js' or 'React useEffect cleanup function examples'. Bad: 'auth' or 'hooks'. The query is sent to the Context7 API for processing. Do not include any sensitive or confidential information such as API keys, passwords, credentials, personal data, or proprietary code in your query."
                    }
                },
                "required": [
                    "libraryId",
                    "query"
                ]
            },
            "outputSchema": null,
            "icons": null,
            "annotations": {
                "title": null,
                "readOnlyHint": true,
                "destructiveHint": null,
                "idempotentHint": null,
                "openWorldHint": null
            },
            "meta": null,
            "execution": {
                "taskSupport": "forbidden"
            }
        }
    ]
}