{
  "openapi": "3.1.0",
  "info": {
    "title": "APIs for NVIDIA RAG Server (v1)",
    "description": "This API schema describes all the retriever endpoints exposed for NVIDIA RAG server Blueprint",
    "version": "1.0.0"
  },
  "paths": {
    "/v1/health": {
      "get": {
        "tags": [
          "Health APIs"
        ],
        "summary": "Health Check",
        "description": "Perform a health check on the RAG server.",
        "operationId": "health_check_v1_health_get",
        "parameters": [
          {
            "name": "check_dependencies",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Check Dependencies"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RAGHealthResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/metrics": {
      "get": {
        "summary": "Metrics Endpoint",
        "description": "Exposes aggregated metrics for Multi-worker setup across all workers.",
        "operationId": "metrics_endpoint_v1_metrics_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/configuration": {
      "get": {
        "tags": [
          "Health APIs"
        ],
        "summary": "Get Configuration",
        "description": "Get Server Default Configuration\n\nReturns the default configuration values used by the RAG server.\nThese values are derived from the server's environment variables and configuration.\n\nUse this endpoint to:\n- Display actual default values in the UI\n- Understand what values will be used when parameters are not explicitly set\n- Ensure frontend and backend defaults are synchronized",
        "operationId": "get_configuration_v1_configuration_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigurationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/generate": {
      "post": {
        "tags": [
          "RAG APIs"
        ],
        "summary": "Generate Answer",
        "description": "Generate and stream the response to the provided prompt.",
        "operationId": "generate_answer_v1_generate_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Prompt"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChainResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat/completions": {
      "post": {
        "tags": [
          "RAG APIs"
        ],
        "summary": "V1 Chat Completions",
        "description": "Just an alias function to /generate endpoint which is openai compatible",
        "operationId": "v1_chat_completions_v1_chat_completions_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Prompt"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChainResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/search": {
      "post": {
        "tags": [
          "Retrieval APIs"
        ],
        "summary": "Document Search",
        "description": "Search for the most relevant documents for the given search parameters.",
        "operationId": "document_search_v1_search_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentSearch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Citations"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/summary": {
      "get": {
        "tags": [
          "Retrieval APIs"
        ],
        "summary": "Get Summary",
        "description": "Retrieve document summary from the collection. Fetches pre-generated summaries with support for both blocking and non-blocking modes.",
        "operationId": "get_summary_v1_summary_get",
        "parameters": [
          {
            "name": "collection_name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Collection Name"
            }
          },
          {
            "name": "file_name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "File Name"
            }
          },
          {
            "name": "blocking",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Blocking"
            }
          },
          {
            "name": "timeout",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "default": 300,
              "title": "Timeout"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SummaryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ChainResponse": {
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 100000,
            "pattern": "[\\s\\S]*",
            "title": "Id",
            "default": ""
          },
          "choices": {
            "items": {
              "$ref": "#/components/schemas/ChainResponseChoices"
            },
            "type": "array",
            "maxItems": 256,
            "title": "Choices",
            "default": []
          },
          "model": {
            "type": "string",
            "maxLength": 4096,
            "pattern": "[\\s\\S]*",
            "title": "Model",
            "default": ""
          },
          "object": {
            "type": "string",
            "maxLength": 4096,
            "pattern": "[\\s\\S]*",
            "title": "Object",
            "default": ""
          },
          "created": {
            "type": "integer",
            "maximum": 9999999999,
            "minimum": 0,
            "format": "int64",
            "title": "Created",
            "default": 0
          },
          "usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Usage"
              },
              {
                "type": "null"
              }
            ],
            "description": "Token usage statistics",
            "default": {
              "total_tokens": 0,
              "prompt_tokens": 0,
              "completion_tokens": 0
            }
          },
          "citations": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Citations"
              },
              {
                "type": "null"
              }
            ],
            "description": "Sources or citations supporting the response",
            "default": {
              "total_results": 0,
              "results": []
            }
          },
          "metrics": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Metrics"
              },
              {
                "type": "null"
              }
            ],
            "description": "Latency metrics associated with the request",
            "default": {}
          },
          "event_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Type",
            "description": "Type of streaming chunk. None for non-streaming and for the regular (non-agentic) path's content chunks. Set for agentic-RAG streaming chunks; see ``nvidia_rag.rag_server.agentic_rag.streaming.EventType`` for the enumerated values (e.g. ``stage_start``, ``stage_end``, ``intermediate_reasoning``, ``intermediate_output``, ``final_reasoning``, ``final_answer``, ``agent_event``, ``error``)."
          },
          "stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stage",
            "description": "Name of the agentic-RAG graph node that produced this chunk (e.g. ``initial_retrieval``, ``plan``, ``execute``, ``synthesize``, ``verify``, ``verify_execute``). Pairs with ``event_type`` so clients can group reasoning by pipeline stage without parsing event_type. None for non-agentic responses."
          }
        },
        "type": "object",
        "title": "ChainResponse",
        "description": "Definition of Chain APIs resopnse data type"
      },
      "ChainResponseChoices": {
        "properties": {
          "index": {
            "type": "integer",
            "maximum": 256,
            "minimum": 0,
            "format": "int64",
            "title": "Index",
            "default": 0
          },
          "message": {
            "$ref": "#/components/schemas/Message-Output",
            "default": {
              "role": "assistant",
              "content": ""
            }
          },
          "delta": {
            "$ref": "#/components/schemas/Message-Output",
            "default": {
              "content": ""
            }
          },
          "finish_reason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4096,
                "pattern": "[\\s\\S]*"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finish Reason"
          }
        },
        "type": "object",
        "title": "ChainResponseChoices",
        "description": "Definition of Chain response choices"
      },
      "Citations": {
        "properties": {
          "total_results": {
            "type": "integer",
            "maximum": 1000000,
            "minimum": 0,
            "format": "int64",
            "title": "Total Results",
            "description": "Total number of source documents found",
            "default": 0
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/SourceResult"
            },
            "type": "array",
            "title": "Results",
            "description": "List of document results",
            "default": []
          }
        },
        "type": "object",
        "title": "Citations",
        "description": "Represents the sources section of the API response."
      },
      "ConfigurationResponse": {
        "properties": {
          "rag_configuration": {
            "$ref": "#/components/schemas/RagConfigurationDefaults",
            "description": "Default RAG configuration parameters"
          },
          "feature_toggles": {
            "$ref": "#/components/schemas/FeatureTogglesDefaults",
            "description": "Default feature toggle states"
          },
          "models": {
            "$ref": "#/components/schemas/ModelsDefaults",
            "description": "Default model names"
          },
          "endpoints": {
            "$ref": "#/components/schemas/EndpointsDefaults",
            "description": "Default endpoint URLs"
          }
        },
        "type": "object",
        "required": [
          "rag_configuration",
          "feature_toggles",
          "models",
          "endpoints"
        ],
        "title": "ConfigurationResponse",
        "description": "Response containing all server default configuration values."
      },
      "DatabaseHealthInfo": {
        "properties": {
          "service": {
            "type": "string",
            "title": "Service"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/ServiceStatus"
              }
            ],
            "title": "Status"
          },
          "latency_ms": {
            "type": "number",
            "title": "Latency Ms",
            "default": 0
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "collections": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Collections"
          }
        },
        "type": "object",
        "required": [
          "service",
          "url",
          "status"
        ],
        "title": "DatabaseHealthInfo",
        "description": "Health info specific to database services"
      },
      "DocumentSearch": {
        "properties": {
          "query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/TextContent"
                    },
                    {
                      "$ref": "#/components/schemas/ImageContent"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Query",
            "description": "The content or keywords to search for within documents. Can be a string for text-only queries, or an array of content objects for multimodal queries containing text and/or images.",
            "default": "Tell me something interesting"
          },
          "reranker_top_k": {
            "type": "integer",
            "maximum": 25,
            "minimum": 0,
            "format": "int64",
            "title": "Reranker Top K",
            "description": "Number of document chunks to retrieve.",
            "default": 10
          },
          "vdb_top_k": {
            "type": "integer",
            "maximum": 400,
            "minimum": 0,
            "format": "int64",
            "title": "Vdb Top K",
            "description": "Number of top results to retrieve from the vector database.",
            "default": 100
          },
          "vdb_endpoint": {
            "type": "string",
            "title": "Vdb Endpoint",
            "description": "Endpoint url of the vector database server.",
            "default": "http://elasticsearch:9200"
          },
          "collection_names": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Collection Names",
            "description": "Name of the collections in the vector database.",
            "default": [
              "multimodal_data"
            ]
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/Message-Input"
            },
            "type": "array",
            "maxItems": 50000,
            "title": "Messages",
            "description": "A list of messages comprising the conversation so far. The roles of the messages must be alternating between user and assistant. The last input message should have role user. A message with the the system role is optional, and must be the very first message if it is present.",
            "default": []
          },
          "enable_query_rewriting": {
            "type": "boolean",
            "title": "Enable Query Rewriting",
            "description": "Enable or disable query rewriting.",
            "default": false
          },
          "enable_reranker": {
            "type": "boolean",
            "title": "Enable Reranker",
            "description": "Enable or disable reranking by the ranker model.",
            "default": true
          },
          "enable_filter_generator": {
            "type": "boolean",
            "title": "Enable Filter Generator",
            "description": "Enable or disable automatic filter expression generation from natural language.",
            "default": false
          },
          "embedding_model": {
            "type": "string",
            "maxLength": 256,
            "title": "Embedding Model",
            "description": "Name of the embedding model used for vectorization.",
            "default": "nvidia/llama-nemotron-embed-vl-1b-v2"
          },
          "embedding_endpoint": {
            "type": "string",
            "maxLength": 2048,
            "title": "Embedding Endpoint",
            "description": "Endpoint URL for the embedding model server.",
            "default": "https://integrate.api.nvidia.com/v1"
          },
          "reranker_model": {
            "type": "string",
            "maxLength": 256,
            "title": "Reranker Model",
            "description": "Name of the reranker model used for ranking results.",
            "default": "nvidia/llama-nemotron-rerank-1b-v2"
          },
          "reranker_endpoint": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Reranker Endpoint",
            "description": "Endpoint URL for the reranker model server.",
            "default": ""
          },
          "filter_expr": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              }
            ],
            "title": "Filter Expr",
            "description": "Filter expression to filter the retrieved documents from vector database collection.",
            "default": ""
          },
          "confidence_threshold": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence Threshold",
            "description": "Minimum confidence score threshold for filtering chunks. Only chunks with relevance scores >= this threshold will be included. Range: 0.0 to 1.0. Default: 0.0 (no filtering). Note: Requires enable_reranker=True to generate relevance scores.",
            "default": 0
          },
          "enable_citations": {
            "type": "boolean",
            "title": "Enable Citations",
            "description": "Enable or disable image/table/chart citations as part of response.",
            "default": true
          }
        },
        "type": "object",
        "title": "DocumentSearch",
        "description": "Definition of the DocumentSearch API data type."
      },
      "EndpointsDefaults": {
        "properties": {
          "llm_endpoint": {
            "type": "string",
            "title": "Llm Endpoint",
            "description": "Default LLM endpoint URL"
          },
          "embedding_endpoint": {
            "type": "string",
            "title": "Embedding Endpoint",
            "description": "Default embedding endpoint URL"
          },
          "reranker_endpoint": {
            "type": "string",
            "title": "Reranker Endpoint",
            "description": "Default reranker endpoint URL"
          },
          "vlm_endpoint": {
            "type": "string",
            "title": "Vlm Endpoint",
            "description": "Default VLM endpoint URL"
          },
          "vdb_endpoint": {
            "type": "string",
            "title": "Vdb Endpoint",
            "description": "Default vector database endpoint URL"
          }
        },
        "type": "object",
        "required": [
          "llm_endpoint",
          "embedding_endpoint",
          "reranker_endpoint",
          "vlm_endpoint",
          "vdb_endpoint"
        ],
        "title": "EndpointsDefaults",
        "description": "Default endpoint URLs."
      },
      "FeatureTogglesDefaults": {
        "properties": {
          "enable_reranker": {
            "type": "boolean",
            "title": "Enable Reranker",
            "description": "Whether reranker is enabled by default"
          },
          "enable_citations": {
            "type": "boolean",
            "title": "Enable Citations",
            "description": "Whether citations are enabled by default"
          },
          "enable_guardrails": {
            "type": "boolean",
            "title": "Enable Guardrails",
            "description": "Whether guardrails are enabled by default"
          },
          "enable_query_rewriting": {
            "type": "boolean",
            "title": "Enable Query Rewriting",
            "description": "Whether query rewriting is enabled by default"
          },
          "enable_vlm_inference": {
            "type": "boolean",
            "title": "Enable Vlm Inference",
            "description": "Whether VLM inference is enabled by default"
          },
          "enable_filter_generator": {
            "type": "boolean",
            "title": "Enable Filter Generator",
            "description": "Whether filter generator is enabled by default"
          }
        },
        "type": "object",
        "required": [
          "enable_reranker",
          "enable_citations",
          "enable_guardrails",
          "enable_query_rewriting",
          "enable_vlm_inference",
          "enable_filter_generator"
        ],
        "title": "FeatureTogglesDefaults",
        "description": "Default values for feature toggles."
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ImageContent": {
        "properties": {
          "type": {
            "type": "string",
            "const": "image_url",
            "title": "Type",
            "description": "The type of content",
            "default": "image_url"
          },
          "image_url": {
            "$ref": "#/components/schemas/ImageUrl",
            "description": "The image URL object"
          }
        },
        "type": "object",
        "required": [
          "image_url"
        ],
        "title": "ImageContent",
        "description": "Image content for message."
      },
      "ImageUrl": {
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 20971520,
            "title": "Url",
            "description": "Either a URL of the image or the base64 encoded image data. Supports data URIs in the format data:image/jpeg;base64,<base64-data>"
          },
          "detail": {
            "type": "string",
            "enum": [
              "low",
              "high",
              "auto"
            ],
            "title": "Detail",
            "description": "Specifies the detail level for image processing. This field maintains OpenAI API compatibility but may not affect processing in NVIDIA RAG's internal VLM pipeline. Future integrations may utilize this field.",
            "default": "auto"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "ImageUrl",
        "description": "Image URL content for message."
      },
      "Message-Input": {
        "properties": {
          "role": {
            "enum": [
              "user",
              "assistant",
              "system",
              null
            ],
            "title": "Role",
            "description": "Role for a message: either 'user' or 'assistant' or 'system",
            "default": "user"
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/TextContent"
                    },
                    {
                      "$ref": "#/components/schemas/ImageContent"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Content",
            "description": "The input query/prompt to the pipeline. Can be a string for text-only messages, or an array of content objects for multimodal messages containing text and/or images.",
            "default": "Hello! What can you help me with?"
          },
          "reasoning_content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reasoning Content",
            "description": "Reasoning trace or intermediate output from the agentic RAG pipeline. Populated for streamed chunks whose ``event_type`` indicates a reasoning/intermediate event (stage announcements, intermediate-stage reasoning or output tokens, final-stage reasoning tokens). The user-facing answer is always streamed via ``content`` — this field is purely supplementary."
          }
        },
        "type": "object",
        "title": "Message",
        "description": "Definition of the Chat Message type."
      },
      "Message-Output": {
        "properties": {
          "role": {
            "enum": [
              "user",
              "assistant",
              "system",
              null
            ],
            "title": "Role",
            "description": "Role for a message: either 'user' or 'assistant' or 'system",
            "default": "user"
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/TextContent"
                    },
                    {
                      "$ref": "#/components/schemas/ImageContent"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Content",
            "description": "The input query/prompt to the pipeline. Can be a string for text-only messages, or an array of content objects for multimodal messages containing text and/or images.",
            "default": "Hello! What can you help me with?"
          },
          "reasoning_content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reasoning Content",
            "description": "Reasoning trace or intermediate output from the agentic RAG pipeline. Populated for streamed chunks whose ``event_type`` indicates a reasoning/intermediate event (stage announcements, intermediate-stage reasoning or output tokens, final-stage reasoning tokens). The user-facing answer is always streamed via ``content`` — this field is purely supplementary."
          }
        },
        "type": "object",
        "title": "Message",
        "description": "Definition of the Chat Message type."
      },
      "Metrics": {
        "properties": {
          "rag_ttft_ms": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Rag Ttft Ms",
            "description": "RAG time-to-first-token in milliseconds (populated in server wrapper)"
          },
          "llm_ttft_ms": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Llm Ttft Ms",
            "description": "LLM time-to-first-token in milliseconds"
          },
          "context_reranker_time_ms": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Reranker Time Ms",
            "description": "Latency of the context reranker in milliseconds"
          },
          "retrieval_time_ms": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Retrieval Time Ms",
            "description": "Latency to retrieve documents from VDB in milliseconds"
          },
          "llm_generation_time_ms": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Llm Generation Time Ms",
            "description": "Total time for LLM response generation in milliseconds"
          }
        },
        "type": "object",
        "title": "Metrics",
        "description": "Latency metrics associated with a single request."
      },
      "ModelsDefaults": {
        "properties": {
          "llm_model": {
            "type": "string",
            "title": "Llm Model",
            "description": "Default LLM model name"
          },
          "embedding_model": {
            "type": "string",
            "title": "Embedding Model",
            "description": "Default embedding model name"
          },
          "reranker_model": {
            "type": "string",
            "title": "Reranker Model",
            "description": "Default reranker model name"
          },
          "vlm_model": {
            "type": "string",
            "title": "Vlm Model",
            "description": "Default VLM model name"
          }
        },
        "type": "object",
        "required": [
          "llm_model",
          "embedding_model",
          "reranker_model",
          "vlm_model"
        ],
        "title": "ModelsDefaults",
        "description": "Default model names."
      },
      "NIMServiceHealthInfo": {
        "properties": {
          "service": {
            "type": "string",
            "title": "Service"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/ServiceStatus"
              }
            ],
            "title": "Status"
          },
          "latency_ms": {
            "type": "number",
            "title": "Latency Ms",
            "default": 0
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "http_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Http Status"
          }
        },
        "type": "object",
        "required": [
          "service",
          "url",
          "status"
        ],
        "title": "NIMServiceHealthInfo",
        "description": "Health info specific to NIM services (LLM, embeddings, etc.)"
      },
      "Prompt": {
        "properties": {
          "messages": {
            "items": {
              "$ref": "#/components/schemas/Message-Input"
            },
            "type": "array",
            "maxItems": 50000,
            "title": "Messages",
            "description": "A list of messages comprising the conversation so far. The roles of the messages must be alternating between user and assistant. The last input message should have role user. A message with the the system role is optional, and must be the very first message if it is present."
          },
          "use_knowledge_base": {
            "type": "boolean",
            "title": "Use Knowledge Base",
            "description": "Whether to use a knowledge base",
            "default": true
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 1,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature",
            "description": "The sampling temperature to use for text generation. The higher the temperature value is, the less deterministic the output text will be. If unset, the model/provider default is used. It is not recommended to modify both temperature and top_p in the same call.",
            "default": 0
          },
          "top_p": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 1,
                "minimum": 0.1
              },
              {
                "type": "null"
              }
            ],
            "title": "Top P",
            "description": "The top-p sampling mass used for text generation. The top-p value determines the probability mass that is sampled at sampling time. For example, if top_p = 0.2, only the most likely tokens (summing to 0.2 cumulative probability) will be sampled. If unset, the model/provider default is used. It is not recommended to modify both temperature and top_p in the same call.",
            "default": 1
          },
          "min_tokens": {
            "type": "integer",
            "title": "Min Tokens",
            "description": "The minimum number of tokens to generate in any given call",
            "default": 0
          },
          "ignore_eos": {
            "type": "boolean",
            "title": "Ignore Eos",
            "description": "Whether to ignore the EOS token and continue generating tokens after the EOS token is generated",
            "default": false
          },
          "max_tokens": {
            "type": "integer",
            "maximum": 128000,
            "minimum": 0,
            "format": "int64",
            "title": "Max Tokens",
            "description": "The maximum number of tokens to generate in any given call. Note that the model is not aware of this value,  and generation will simply stop at the number of tokens specified.",
            "default": 16256
          },
          "min_thinking_tokens": {
            "type": "integer",
            "format": "int64",
            "title": "Min Thinking Tokens",
            "description": "Minimum number of thinking tokens to allocate for reasoning models. Enable thinking mode if either min_thinking_tokens or max_thinking_tokens is provided."
          },
          "max_thinking_tokens": {
            "type": "integer",
            "format": "int64",
            "title": "Max Thinking Tokens",
            "description": "Maximum number of thinking tokens to allocate for reasoning models. Enable thinking mode if either min_thinking_tokens or max_thinking_tokens is provided."
          },
          "reranker_top_k": {
            "type": "integer",
            "maximum": 25,
            "minimum": 0,
            "format": "int64",
            "title": "Reranker Top K",
            "description": "The maximum number of documents to return in the response.",
            "default": 10
          },
          "vdb_top_k": {
            "type": "integer",
            "maximum": 400,
            "minimum": 0,
            "format": "int64",
            "title": "Vdb Top K",
            "description": "Number of top results to retrieve from the vector database.",
            "default": 100
          },
          "vdb_endpoint": {
            "type": "string",
            "title": "Vdb Endpoint",
            "description": "Endpoint url of the vector database server.",
            "default": "http://elasticsearch:9200"
          },
          "collection_names": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Collection Names",
            "description": "Name of the collections in the vector database.",
            "default": [
              "multimodal_data"
            ]
          },
          "enable_query_rewriting": {
            "type": "boolean",
            "title": "Enable Query Rewriting",
            "description": "Enable or disable query rewriting.",
            "default": false
          },
          "enable_reranker": {
            "type": "boolean",
            "title": "Enable Reranker",
            "description": "Enable or disable reranking by the ranker model.",
            "default": true
          },
          "enable_guardrails": {
            "type": "boolean",
            "title": "Enable Guardrails",
            "description": "Enable or disable guardrailing of queries/responses.",
            "default": false
          },
          "enable_citations": {
            "type": "boolean",
            "title": "Enable Citations",
            "description": "Enable or disable citations as part of response.",
            "default": true
          },
          "enable_vlm_inference": {
            "type": "boolean",
            "title": "Enable Vlm Inference",
            "description": "Enable or disable VLM inference.",
            "default": false
          },
          "enable_filter_generator": {
            "type": "boolean",
            "title": "Enable Filter Generator",
            "description": "Enable or disable automatic filter expression generation from natural language.",
            "default": false
          },
          "model": {
            "type": "string",
            "maxLength": 4096,
            "pattern": "[\\s\\S]*",
            "title": "Model",
            "description": "Name of NIM LLM model to be used for inference.",
            "default": "nvidia/nemotron-3-super-120b-a12b"
          },
          "llm_endpoint": {
            "type": "string",
            "maxLength": 2048,
            "title": "Llm Endpoint",
            "description": "Endpoint URL for the llm model server.",
            "default": ""
          },
          "embedding_model": {
            "type": "string",
            "maxLength": 256,
            "title": "Embedding Model",
            "description": "Name of the embedding model used for vectorization.",
            "default": "nvidia/llama-nemotron-embed-vl-1b-v2"
          },
          "embedding_endpoint": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Endpoint",
            "description": "Endpoint URL for the embedding model server.",
            "default": "https://integrate.api.nvidia.com/v1"
          },
          "reranker_model": {
            "type": "string",
            "maxLength": 256,
            "title": "Reranker Model",
            "description": "Name of the reranker model used for ranking results.",
            "default": "nvidia/llama-nemotron-rerank-1b-v2"
          },
          "reranker_endpoint": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Reranker Endpoint",
            "description": "Endpoint URL for the reranker model server.",
            "default": ""
          },
          "vlm_model": {
            "type": "string",
            "maxLength": 256,
            "title": "Vlm Model",
            "description": "Name of the VLM model used for inference.",
            "default": "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning"
          },
          "vlm_endpoint": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Vlm Endpoint",
            "description": "Endpoint URL for the VLM model server.",
            "default": "https://integrate.api.nvidia.com/v1"
          },
          "vlm_temperature": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Vlm Temperature",
            "description": "The sampling temperature to use for VLM text generation.",
            "default": 0.1
          },
          "vlm_top_p": {
            "type": "number",
            "maximum": 1,
            "minimum": 0.1,
            "title": "Vlm Top P",
            "description": "The top-p sampling mass used for VLM text generation.",
            "default": 1
          },
          "vlm_max_tokens": {
            "type": "integer",
            "maximum": 128000,
            "minimum": 0,
            "format": "int64",
            "title": "Vlm Max Tokens",
            "description": "The maximum number of tokens to generate by the VLM.",
            "default": 8192
          },
          "vlm_max_total_images": {
            "type": "integer",
            "maximum": 64,
            "minimum": 0,
            "format": "int64",
            "title": "Vlm Max Total Images",
            "description": "Maximum total images sent to VLM per request (query + context).",
            "default": 5
          },
          "stop": {
            "items": {
              "type": "string",
              "maxLength": 256
            },
            "type": "array",
            "maxItems": 256,
            "title": "Stop",
            "description": "A string or a list of strings where the API will stop generating further tokens.The returned text will not contain the stop sequence.",
            "default": []
          },
          "filter_expr": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              }
            ],
            "title": "Filter Expr",
            "description": "Filter expression to filter documents from vector database. Can be a string or a list of dictionaries with filter conditions.",
            "default": ""
          },
          "confidence_threshold": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence Threshold",
            "description": "Minimum confidence score threshold for filtering chunks. Only chunks with relevance scores >= this threshold will be included. Range: 0.0 to 1.0. Default: 0.0 (no filtering). Note: Requires enable_reranker=True to generate relevance scores.",
            "default": 0
          },
          "agentic": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agentic",
            "description": "Route this request through the agentic RAG pipeline (LangGraph plan-and-execute). When None (default), the server-level CONFIG.enable_agentic_rag config value is used. Explicitly passing True or False overrides the server default for this request.",
            "default": false
          },
          "enable_streaming": {
            "type": "boolean",
            "title": "Enable Streaming",
            "description": "Stream intermediate reasoning, stage announcements, and final-answer tokens as they are produced. Currently honored by the agentic RAG pipeline; the regular (non-agentic) pipeline always streams. When False on the agentic path, the graph runs to completion and the full answer is returned as a single SSE chunk (legacy behavior).",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "messages"
        ],
        "title": "Prompt",
        "description": "Definition of the Prompt API data type."
      },
      "RAGHealthResponse": {
        "properties": {
          "message": {
            "type": "string",
            "maxLength": 4096,
            "pattern": "[\\s\\S]*",
            "title": "Message",
            "default": "Service is up."
          },
          "databases": {
            "items": {
              "$ref": "#/components/schemas/DatabaseHealthInfo"
            },
            "type": "array",
            "title": "Databases"
          },
          "object_storage": {
            "items": {
              "$ref": "#/components/schemas/StorageHealthInfo"
            },
            "type": "array",
            "title": "Object Storage"
          },
          "nim": {
            "items": {
              "$ref": "#/components/schemas/NIMServiceHealthInfo"
            },
            "type": "array",
            "title": "Nim"
          }
        },
        "type": "object",
        "title": "RAGHealthResponse",
        "description": "Health response for RAG server with database, storage, and NIM services"
      },
      "RagConfigurationDefaults": {
        "properties": {
          "temperature": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature",
            "description": "Default sampling temperature for generation"
          },
          "top_p": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Top P",
            "description": "Default top-p sampling mass"
          },
          "max_tokens": {
            "type": "integer",
            "title": "Max Tokens",
            "description": "Default maximum tokens to generate"
          },
          "vdb_top_k": {
            "type": "integer",
            "title": "Vdb Top K",
            "description": "Default number of documents to retrieve from vector DB"
          },
          "reranker_top_k": {
            "type": "integer",
            "title": "Reranker Top K",
            "description": "Default number of documents after reranking"
          },
          "confidence_threshold": {
            "type": "number",
            "title": "Confidence Threshold",
            "description": "Default confidence score threshold"
          }
        },
        "type": "object",
        "required": [
          "temperature",
          "top_p",
          "max_tokens",
          "vdb_top_k",
          "reranker_top_k",
          "confidence_threshold"
        ],
        "title": "RagConfigurationDefaults",
        "description": "Default values for RAG configuration parameters."
      },
      "ServiceStatus": {
        "type": "string",
        "enum": [
          "healthy",
          "unhealthy",
          "skipped",
          "timeout",
          "error",
          "unknown"
        ],
        "title": "ServiceStatus",
        "description": "Enum for service health status values."
      },
      "SourceMetadata": {
        "properties": {
          "language": {
            "type": "string",
            "maxLength": 100000,
            "pattern": "[\\s\\S]*",
            "title": "Language",
            "description": "Language of the document",
            "default": ""
          },
          "date_created": {
            "type": "string",
            "maxLength": 100000,
            "pattern": "[\\s\\S]*",
            "title": "Date Created",
            "description": "Creation date of the document",
            "default": ""
          },
          "last_modified": {
            "type": "string",
            "maxLength": 100000,
            "pattern": "[\\s\\S]*",
            "title": "Last Modified",
            "description": "Last modification date",
            "default": ""
          },
          "page_number": {
            "type": "integer",
            "maximum": 1000000,
            "minimum": -1,
            "format": "int64",
            "title": "Page Number",
            "description": "Page number in the document",
            "default": 0
          },
          "description": {
            "type": "string",
            "maxLength": 100000,
            "pattern": "[\\s\\S]*",
            "title": "Description",
            "description": "Description of the document content",
            "default": ""
          },
          "height": {
            "type": "integer",
            "maximum": 100000,
            "minimum": 0,
            "format": "int64",
            "title": "Height",
            "description": "Height of the document in pixels",
            "default": 0
          },
          "width": {
            "type": "integer",
            "maximum": 100000,
            "minimum": 0,
            "format": "int64",
            "title": "Width",
            "description": "Width of the document in pixels",
            "default": 0
          },
          "location": {
            "items": {
              "type": "number"
            },
            "type": "array",
            "title": "Location",
            "description": "Bounding box location of the content",
            "default": []
          },
          "location_max_dimensions": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Location Max Dimensions",
            "description": "Maximum dimensions of the document",
            "default": []
          },
          "content_metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Content Metadata",
            "description": "Metadata about the content",
            "default": {}
          }
        },
        "type": "object",
        "title": "SourceMetadata",
        "description": "Metadata associated with a document source."
      },
      "SourceResult": {
        "properties": {
          "document_id": {
            "type": "string",
            "maxLength": 100000,
            "pattern": "[\\s\\S]*",
            "title": "Document Id",
            "description": "Unique identifier of the document",
            "default": ""
          },
          "content": {
            "type": "string",
            "pattern": "[\\s\\S]*",
            "title": "Content",
            "description": "Extracted content from the document",
            "default": ""
          },
          "document_name": {
            "type": "string",
            "maxLength": 100000,
            "pattern": "[\\s\\S]*",
            "title": "Document Name",
            "description": "Name of the document",
            "default": ""
          },
          "document_type": {
            "type": "string",
            "enum": [
              "image",
              "text",
              "table",
              "chart",
              "audio"
            ],
            "title": "Document Type",
            "description": "Type of document content",
            "default": "text"
          },
          "score": {
            "type": "number",
            "title": "Score",
            "description": "Relevance score of the document",
            "default": 0
          },
          "stage": {
            "type": "string",
            "maxLength": 100,
            "pattern": "[\\s\\S]*",
            "title": "Stage",
            "description": "Pipeline stage that produced this result (e.g. 'rag', 'initial_retrieval', 'execute', 'verify_execute')",
            "default": "rag"
          },
          "metadata": {
            "$ref": "#/components/schemas/SourceMetadata"
          }
        },
        "type": "object",
        "required": [
          "metadata"
        ],
        "title": "SourceResult",
        "description": "Represents a single source document result."
      },
      "StorageHealthInfo": {
        "properties": {
          "service": {
            "type": "string",
            "title": "Service"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/ServiceStatus"
              }
            ],
            "title": "Status"
          },
          "latency_ms": {
            "type": "number",
            "title": "Latency Ms",
            "default": 0
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "buckets": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buckets"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "service",
          "url",
          "status"
        ],
        "title": "StorageHealthInfo",
        "description": "Health info specific to object storage services"
      },
      "SummaryResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Message describing the summary status",
            "default": ""
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "Status of the summary: SUCCESS (completed), PENDING (queued), IN_PROGRESS (generating), FAILED (error occurred), or NOT_FOUND (never requested)",
            "default": ""
          },
          "summary": {
            "type": "string",
            "title": "Summary",
            "description": "Summary content (only present if status is SUCCESS)",
            "default": ""
          },
          "file_name": {
            "type": "string",
            "title": "File Name",
            "description": "Name of the document",
            "default": ""
          },
          "collection_name": {
            "type": "string",
            "title": "Collection Name",
            "description": "Name of the collection",
            "default": ""
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error",
            "description": "Error details if status is FAILED"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At",
            "description": "ISO format timestamp when generation started"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At",
            "description": "ISO format timestamp when generation completed"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At",
            "description": "ISO format timestamp of last status update"
          },
          "progress": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Progress",
            "description": "Progress information if status is IN_PROGRESS"
          }
        },
        "type": "object",
        "title": "SummaryResponse",
        "description": "Represents a summary of a document with status tracking."
      },
      "TextContent": {
        "properties": {
          "type": {
            "type": "string",
            "const": "text",
            "title": "Type",
            "description": "The type of content",
            "default": "text"
          },
          "text": {
            "type": "string",
            "maxLength": 128000,
            "pattern": "[\\s\\S]*",
            "title": "Text",
            "description": "The text content"
          }
        },
        "type": "object",
        "required": [
          "text"
        ],
        "title": "TextContent",
        "description": "Text content for message."
      },
      "Usage": {
        "properties": {
          "total_tokens": {
            "type": "integer",
            "maximum": 1000000000,
            "minimum": 0,
            "format": "int64",
            "title": "Total Tokens",
            "description": "Total tokens used in the request",
            "default": 0
          },
          "prompt_tokens": {
            "type": "integer",
            "maximum": 1000000000,
            "minimum": 0,
            "format": "int64",
            "title": "Prompt Tokens",
            "description": "Tokens used for the prompt",
            "default": 0
          },
          "completion_tokens": {
            "type": "integer",
            "maximum": 1000000000,
            "minimum": 0,
            "format": "int64",
            "title": "Completion Tokens",
            "description": "Tokens used for the completion",
            "default": 0
          }
        },
        "type": "object",
        "title": "Usage",
        "description": "Token usage information."
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  },
  "tags": [
    {
      "name": "Health APIs",
      "description": "APIs for checking and monitoring server liveliness and readiness."
    },
    {
      "name": "Retrieval APIs",
      "description": "APIs for retrieving document chunks for a query."
    },
    {
      "name": "RAG APIs",
      "description": "APIs for retrieval followed by generation."
    }
  ]
}
