Files
railseek6/openapi_paths.json

1707 lines
145 KiB
JSON

{
"/documents/scan": {
"post": {
"tags": [
"documents"
],
"summary": "Scan For New Documents",
"description": "Trigger the scanning process for new documents.\n\nThis endpoint initiates a background task that scans the input directory for new documents\nand processes them. If a scanning process is already running, it returns a status indicating\nthat fact.\n\nReturns:\n ScanResponse: A response object containing the scanning status and track_id",
"operationId": "scan_for_new_documents_documents_scan_post",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ScanResponse"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/documents/upload": {
"post": {
"tags": [
"documents"
],
"summary": "Upload To Input Dir",
"description": "Upload a file to the input directory and index it.\n\nThis API endpoint accepts a file through an HTTP POST request, checks if the\nuploaded file is of a supported type, saves it in the specified input directory,\nindexes it for retrieval, and returns a success status with relevant details.\n\nArgs:\n background_tasks: FastAPI BackgroundTasks for async processing\n file (UploadFile): The file to be uploaded. It must have an allowed extension.\n\nReturns:\n InsertResponse: A response object containing the upload status and a message.\n status can be \"success\", \"duplicated\", or error is thrown.\n\nRaises:\n HTTPException: If the file type is not supported (400) or other errors occur (500).",
"operationId": "upload_to_input_dir_documents_upload_post",
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/Body_upload_to_input_dir_documents_upload_post"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InsertResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/documents/text": {
"post": {
"tags": [
"documents"
],
"summary": "Insert Text",
"description": "Insert text into the RAG system.\n\nThis endpoint allows you to insert text data into the RAG system for later retrieval\nand use in generating responses.\n\nArgs:\n request (InsertTextRequest): The request body containing the text to be inserted.\n background_tasks: FastAPI BackgroundTasks for async processing\n\nReturns:\n InsertResponse: A response object containing the status of the operation.\n\nRaises:\n HTTPException: If an error occurs during text processing (500).",
"operationId": "insert_text_documents_text_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InsertTextRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InsertResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/documents/texts": {
"post": {
"tags": [
"documents"
],
"summary": "Insert Texts",
"description": "Insert multiple texts into the RAG system.\n\nThis endpoint allows you to insert multiple text entries into the RAG system\nin a single request.\n\nArgs:\n request (InsertTextsRequest): The request body containing the list of texts.\n background_tasks: FastAPI BackgroundTasks for async processing\n\nReturns:\n InsertResponse: A response object containing the status of the operation.\n\nRaises:\n HTTPException: If an error occurs during text processing (500).",
"operationId": "insert_texts_documents_texts_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InsertTextsRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InsertResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/documents": {
"get": {
"tags": [
"documents"
],
"summary": "Documents",
"description": "Get the status of all documents in the system.\n\nThis endpoint retrieves the current status of all documents, grouped by their\nprocessing status (PENDING, PROCESSING, PROCESSED, FAILED).\n\nReturns:\n DocsStatusesResponse: A response object containing a dictionary where keys are\n DocStatus values and values are lists of DocStatusResponse\n objects representing documents in each status category.\n\nRaises:\n HTTPException: If an error occurs while retrieving document statuses (500).",
"operationId": "documents_documents_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DocsStatusesResponse"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
},
"delete": {
"tags": [
"documents"
],
"summary": "Clear Documents",
"description": "Clear all documents from the RAG system.\n\nThis endpoint deletes all documents, entities, relationships, and files from the system.\nIt uses the storage drop methods to properly clean up all data and removes all files\nfrom the input directory.\n\nReturns:\n ClearDocumentsResponse: A response object containing the status and message.\n - status=\"success\": All documents and files were successfully cleared.\n - status=\"partial_success\": Document clear job exit with some errors.\n - status=\"busy\": Operation could not be completed because the pipeline is busy.\n - status=\"fail\": All storage drop operations failed, with message\n - message: Detailed information about the operation results, including counts\n of deleted files and any errors encountered.\n\nRaises:\n HTTPException: Raised when a serious error occurs during the clearing process,\n with status code 500 and error details in the detail field.",
"operationId": "clear_documents_documents_delete",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClearDocumentsResponse"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/documents/pipeline_status": {
"get": {
"tags": [
"documents"
],
"summary": "Get Pipeline Status",
"description": "Get the current status of the document indexing pipeline.\n\nThis endpoint returns information about the current state of the document processing pipeline,\nincluding the processing status, progress information, and history messages.\n\nReturns:\n PipelineStatusResponse: A response object containing:\n - autoscanned (bool): Whether auto-scan has started\n - busy (bool): Whether the pipeline is currently busy\n - job_name (str): Current job name (e.g., indexing files/indexing texts)\n - job_start (str, optional): Job start time as ISO format string\n - docs (int): Total number of documents to be indexed\n - batchs (int): Number of batches for processing documents\n - cur_batch (int): Current processing batch\n - request_pending (bool): Flag for pending request for processing\n - latest_message (str): Latest message from pipeline processing\n - history_messages (List[str], optional): List of history messages (limited to latest 1000 entries,\n with truncation message if more than 1000 messages exist)\n\nRaises:\n HTTPException: If an error occurs while retrieving pipeline status (500)",
"operationId": "get_pipeline_status_documents_pipeline_status_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PipelineStatusResponse"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/documents/delete_document": {
"delete": {
"tags": [
"documents"
],
"summary": "Delete a document and all its associated data by its ID.",
"description": "Delete documents and all their associated data by their IDs using background processing.\n\nDeletes specific documents and all their associated data, including their status,\ntext chunks, vector embeddings, and any related graph data.\nThe deletion process runs in the background to avoid blocking the client connection.\nIt is disabled when llm cache for entity extraction is disabled.\n\nThis operation is irreversible and will interact with the pipeline status.\n\nArgs:\n delete_request (DeleteDocRequest): The request containing the document IDs and delete_file options.\n background_tasks: FastAPI BackgroundTasks for async processing\n\nReturns:\n DeleteDocByIdResponse: The result of the deletion operation.\n - status=\"deletion_started\": The document deletion has been initiated in the background.\n - status=\"busy\": The pipeline is busy with another operation.\n - status=\"not_allowed\": Operation not allowed when LLM cache for entity extraction is disabled.\n\nRaises:\n HTTPException:\n - 500: If an unexpected internal error occurs during initialization.",
"operationId": "delete_document_documents_delete_document_delete",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteDocRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteDocByIdResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/documents/clear_cache": {
"post": {
"tags": [
"documents"
],
"summary": "Clear Cache",
"description": "Clear all cache data from the LLM response cache storage.\n\nThis endpoint clears all cached LLM responses regardless of mode.\nThe request body is accepted for API compatibility but is ignored.\n\nArgs:\n request (ClearCacheRequest): The request body (ignored for compatibility).\n\nReturns:\n ClearCacheResponse: A response object containing the status and message.\n\nRaises:\n HTTPException: If an error occurs during cache clearing (500).",
"operationId": "clear_cache_documents_clear_cache_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClearCacheRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ClearCacheResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/documents/delete_entity": {
"delete": {
"tags": [
"documents"
],
"summary": "Delete Entity",
"description": "Delete an entity and all its relationships from the knowledge graph.\n\nArgs:\n request (DeleteEntityRequest): The request body containing the entity name.\n\nReturns:\n DeletionResult: An object containing the outcome of the deletion process.\n\nRaises:\n HTTPException: If the entity is not found (404) or an error occurs (500).",
"operationId": "delete_entity_documents_delete_entity_delete",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteEntityRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeletionResult"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/documents/delete_relation": {
"delete": {
"tags": [
"documents"
],
"summary": "Delete Relation",
"description": "Delete a relationship between two entities from the knowledge graph.\n\nArgs:\n request (DeleteRelationRequest): The request body containing the source and target entity names.\n\nReturns:\n DeletionResult: An object containing the outcome of the deletion process.\n\nRaises:\n HTTPException: If the relation is not found (404) or an error occurs (500).",
"operationId": "delete_relation_documents_delete_relation_delete",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteRelationRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeletionResult"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/documents/track_status/{track_id}": {
"get": {
"tags": [
"documents"
],
"summary": "Get Track Status",
"description": "Get the processing status of documents by tracking ID.\n\nThis endpoint retrieves all documents associated with a specific tracking ID,\nallowing users to monitor the processing progress of their uploaded files or inserted texts.\n\nArgs:\n track_id (str): The tracking ID returned from upload, text, or texts endpoints\n\nReturns:\n TrackStatusResponse: A response object containing:\n - track_id: The tracking ID\n - documents: List of documents associated with this track_id\n - total_count: Total number of documents for this track_id\n\nRaises:\n HTTPException: If track_id is invalid (400) or an error occurs (500).",
"operationId": "get_track_status_documents_track_status__track_id__get",
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
],
"parameters": [
{
"name": "track_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Track Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TrackStatusResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/documents/paginated": {
"post": {
"tags": [
"documents"
],
"summary": "Get Documents Paginated",
"description": "Get documents with pagination support.\n\nThis endpoint retrieves documents with pagination, filtering, and sorting capabilities.\nIt provides better performance for large document collections by loading only the\nrequested page of data.\n\nArgs:\n request (DocumentsRequest): The request body containing pagination parameters\n\nReturns:\n PaginatedDocsResponse: A response object containing:\n - documents: List of documents for the current page\n - pagination: Pagination information (page, total_count, etc.)\n - status_counts: Count of documents by status for all documents\n\nRaises:\n HTTPException: If an error occurs while retrieving documents (500).",
"operationId": "get_documents_paginated_documents_paginated_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DocumentsRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaginatedDocsResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/documents/status_counts": {
"get": {
"tags": [
"documents"
],
"summary": "Get Document Status Counts",
"description": "Get counts of documents by status.\n\nThis endpoint retrieves the count of documents in each processing status\n(PENDING, PROCESSING, PROCESSED, FAILED) for all documents in the system.\n\nReturns:\n StatusCountsResponse: A response object containing status counts\n\nRaises:\n HTTPException: If an error occurs while retrieving status counts (500).",
"operationId": "get_document_status_counts_documents_status_counts_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StatusCountsResponse"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/documents/download/{filename}": {
"get": {
"tags": [
"documents"
],
"summary": "Download Document",
"description": "Download a document file by filename.\n\nThis endpoint allows users to download original document files that have been\nuploaded to the system. Files are served from the __enqueued__ directory.\n\nArgs:\n filename (str): The name of the file to download\n\nReturns:\n FileResponse: The file content with appropriate headers for download\n\nRaises:\n HTTPException: If file is not found (404) or an error occurs (500).",
"operationId": "download_document_documents_download__filename__get",
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
],
"parameters": [
{
"name": "filename",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Filename"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/query": {
"post": {
"tags": [
"query"
],
"summary": "Query Text",
"description": "Handle a POST request at the /query endpoint to process user queries using RAG capabilities.\n\nParameters:\n request (QueryRequest): The request object containing the query parameters.\nReturns:\n QueryResponse: A Pydantic model containing the result of the query processing.\n If a string is returned (e.g., cache hit), it\u0027s directly returned.\n Otherwise, an async generator may be used to build the response.\n\nRaises:\n HTTPException: Raised when an error occurs during the request handling process,\n with status code 500 and detail containing the exception message.",
"operationId": "query_text_query_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/QueryRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/QueryResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/query/stream": {
"post": {
"tags": [
"query"
],
"summary": "Query Text Stream",
"description": "This endpoint performs a retrieval-augmented generation (RAG) query and streams the response.\n\nArgs:\n request (QueryRequest): The request object containing the query parameters.\n optional_api_key (Optional[str], optional): An optional API key for authentication. Defaults to None.\n\nReturns:\n StreamingResponse: A streaming response containing the RAG query results.",
"operationId": "query_text_stream_query_stream_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/QueryRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/query/data": {
"post": {
"tags": [
"query"
],
"summary": "Query Data",
"description": "Retrieve structured data without LLM generation.\n\nThis endpoint returns raw retrieval results including entities, relationships,\nand text chunks that would be used for RAG, but without generating a final response.\nAll parameters are compatible with the regular /query endpoint.\n\nParameters:\n request (QueryRequest): The request object containing the query parameters.\n\nReturns:\n QueryDataResponse: A Pydantic model containing structured data with entities,\n relationships, chunks, and metadata.\n\nRaises:\n HTTPException: Raised when an error occurs during the request handling process,\n with status code 500 and detail containing the exception message.",
"operationId": "query_data_query_data_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/QueryRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/QueryDataResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/graph/label/list": {
"get": {
"tags": [
"graph"
],
"summary": "Get Graph Labels",
"description": "Get all graph labels\n\nReturns:\n List[str]: List of graph labels",
"operationId": "get_graph_labels_graph_label_list_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/graphs": {
"get": {
"tags": [
"graph"
],
"summary": "Get Knowledge Graph",
"description": "Retrieve a connected subgraph of nodes where the label includes the specified label.\nWhen reducing the number of nodes, the prioritization criteria are as follows:\n 1. Hops(path) to the staring node take precedence\n 2. Followed by the degree of the nodes\n\nArgs:\n label (str): Label of the starting node\n max_depth (int, optional): Maximum depth of the subgraph,Defaults to 3\n max_nodes: Maxiumu nodes to return\n\nReturns:\n Dict[str, List[str]]: Knowledge graph for label",
"operationId": "get_knowledge_graph_graphs_get",
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
],
"parameters": [
{
"name": "label",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Label to get knowledge graph for",
"title": "Label"
},
"description": "Label to get knowledge graph for"
},
{
"name": "max_depth",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"description": "Maximum depth of graph",
"default": 3,
"title": "Max Depth"
},
"description": "Maximum depth of graph"
},
{
"name": "max_nodes",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"description": "Maximum nodes to return",
"default": 1000,
"title": "Max Nodes"
},
"description": "Maximum nodes to return"
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/graph/entity/exists": {
"get": {
"tags": [
"graph"
],
"summary": "Check Entity Exists",
"description": "Check if an entity with the given name exists in the knowledge graph\n\nArgs:\n name (str): Name of the entity to check\n\nReturns:\n Dict[str, bool]: Dictionary with \u0027exists\u0027 key indicating if entity exists",
"operationId": "check_entity_exists_graph_entity_exists_get",
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
],
"parameters": [
{
"name": "name",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Entity name to check",
"title": "Name"
},
"description": "Entity name to check"
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/graph/entity/edit": {
"post": {
"tags": [
"graph"
],
"summary": "Update Entity",
"description": "Update an entity\u0027s properties in the knowledge graph\n\nArgs:\n request (EntityUpdateRequest): Request containing entity name, updated data, and rename flag\n\nReturns:\n Dict: Updated entity information",
"operationId": "update_entity_graph_entity_edit_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EntityUpdateRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/graph/relation/edit": {
"post": {
"tags": [
"graph"
],
"summary": "Update Relation",
"description": "Update a relation\u0027s properties in the knowledge graph\n\nArgs:\n request (RelationUpdateRequest): Request containing source ID, target ID and updated data\n\nReturns:\n Dict: Updated relation information",
"operationId": "update_relation_graph_relation_edit_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RelationUpdateRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/search": {
"post": {
"tags": [
"search"
],
"summary": "Search Documents",
"description": "Handle a POST request at the /search endpoint to search documents using RAG capabilities.\nThis is an alias for the /query endpoint with simplified response format.",
"operationId": "search_documents_search_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/api/search": {
"post": {
"tags": [
"search"
],
"summary": "Search Data",
"description": "API search endpoint that returns structured data without LLM generation.\nThis is an alias for the /query/data endpoint.",
"operationId": "search_data_api_search_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SearchDataResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/api/version": {
"get": {
"tags": [
"ollama"
],
"summary": "Get Version",
"description": "Get Ollama version information",
"operationId": "get_version_api_version_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/api/tags": {
"get": {
"tags": [
"ollama"
],
"summary": "Get Tags",
"description": "Return available models acting as an Ollama server",
"operationId": "get_tags_api_tags_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/api/ps": {
"get": {
"tags": [
"ollama"
],
"summary": "Get Running Models",
"description": "List Running Models - returns currently running models",
"operationId": "get_running_models_api_ps_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/api/generate": {
"post": {
"tags": [
"ollama"
],
"summary": "Generate",
"description": "Handle generate completion requests acting as an Ollama model\nFor compatibility purpose, the request is not processed by LightRAG,\nand will be handled by underlying LLM model.\nSupports both application/json and application/octet-stream Content-Types.",
"operationId": "generate_api_generate_post",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/api/chat": {
"post": {
"tags": [
"ollama"
],
"summary": "Chat",
"description": "Process chat completion requests by acting as an Ollama model.\nRoutes user queries through LightRAG by selecting query mode based on query prefix.\nDetects and forwards OpenWebUI session-related requests (for meta data generation task) directly to LLM.\nSupports both application/json and application/octet-stream Content-Types.",
"operationId": "chat_api_chat_post",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
},
"/workspaces/": {
"get": {
"tags": [
"workspaces"
],
"summary": "List Workspaces",
"description": "List all existing workspaces with optional keyword search.",
"operationId": "list_workspaces_workspaces__get",
"parameters": [
{
"name": "search",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Search workspaces by keyword in name",
"title": "Search"
},
"description": "Search workspaces by keyword in name"
},
{
"name": "request",
"in": "query",
"required": true,
"schema": {
"title": "Request"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/WorkspaceResponse"
},
"title": "Response List Workspaces Workspaces Get"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
},
"post": {
"tags": [
"workspaces"
],
"summary": "Create Workspace",
"description": "Create a new workspace.",
"operationId": "create_workspace_workspaces__post",
"parameters": [
{
"name": "request",
"in": "query",
"required": true,
"schema": {
"title": "Request"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/WorkspaceCreateRequest"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/WorkspaceResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/workspaces/{workspace_name}": {
"delete": {
"tags": [
"workspaces"
],
"summary": "Delete Workspace",
"description": "Delete a workspace (not implemented).",
"operationId": "delete_workspace_workspaces__workspace_name__delete",
"parameters": [
{
"name": "workspace_name",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Workspace Name"
}
},
{
"name": "request",
"in": "query",
"required": true,
"schema": {
"title": "Request"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/": {
"get": {
"summary": "Redirect To Webui",
"description": "Redirect root path to /webui",
"operationId": "redirect_to_webui__get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
}
}
}
},
"/auth-status": {
"get": {
"summary": "Get Auth Status",
"description": "Get authentication status and guest token if auth is not configured",
"operationId": "get_auth_status_auth_status_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
}
}
}
},
"/login": {
"post": {
"summary": "Login",
"operationId": "login_login_post",
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/Body_login_login_post"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/health": {
"get": {
"summary": "Get Status",
"description": "Get current system status",
"operationId": "get_status_health_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
}
},
"security": [
{
"OAuth2PasswordBearer": [
]
},
{
"APIKeyHeader": [
]
}
]
}
}
}