{"openapi":"3.1.0","info":{"title":"PixelRAG Search API","version":"0.1.0"},"paths":{"/search":{"post":{"summary":"Search","operationId":"search_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"}}}}}}},"/status":{"get":{"summary":"Status","operationId":"status_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/departments":{"get":{"summary":"Departments","description":"Departments available for the `department` search filter, with doc counts.","operationId":"departments_departments_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/reconstruct":{"post":{"summary":"Reconstruct","description":"Reconstruct stored embeddings by vector_id (for alignment debugging).","operationId":"reconstruct_reconstruct_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconstructRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tile":{"get":{"summary":"Tile","description":"Serve a tile image by its local path (legacy, use /tile/{article_id}/{tile_index}/{chunk_index} instead).","operationId":"tile_tile_get","parameters":[{"name":"path","in":"query","required":true,"schema":{"type":"string","title":"Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tile/{article_id}/{tile_index}/{chunk_index}":{"get":{"summary":"Tile By Id","description":"Serve a tile image by article_id, tile_index, chunk_index.","operationId":"tile_by_id_tile__article_id___tile_index___chunk_index__get","parameters":[{"name":"article_id","in":"path","required":true,"schema":{"type":"integer","title":"Article Id"}},{"name":"tile_index","in":"path","required":true,"schema":{"type":"integer","title":"Tile Index"}},{"name":"chunk_index","in":"path","required":true,"schema":{"type":"integer","title":"Chunk Index"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Hit":{"properties":{"score":{"type":"number","title":"Score"},"vector_id":{"anyOf":[{"type":"integer"},{"type":"string"}],"title":"Vector Id"},"article_id":{"type":"integer","title":"Article Id"},"tile_index":{"type":"integer","title":"Tile Index"},"chunk_index":{"type":"integer","title":"Chunk Index"},"y_offset":{"type":"integer","title":"Y Offset"},"tile_height":{"type":"integer","title":"Tile Height"},"path":{"type":"string","title":"Path"},"url":{"type":"string","title":"Url"},"article_pages":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Article Pages"},"image_base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Base64"}},"type":"object","required":["score","vector_id","article_id","tile_index","chunk_index","y_offset","tile_height","path","url"],"title":"Hit"},"Query":{"properties":{"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image"},"embedding":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"title":"Embedding"}},"type":"object","title":"Query"},"QueryResult":{"properties":{"hits":{"items":{"$ref":"#/components/schemas/Hit"},"type":"array","title":"Hits"}},"type":"object","required":["hits"],"title":"QueryResult"},"ReconstructRequest":{"properties":{"vector_ids":{"items":{"anyOf":[{"type":"integer"},{"type":"string"}]},"type":"array","title":"Vector Ids"}},"type":"object","required":["vector_ids"],"title":"ReconstructRequest"},"SearchRequest":{"properties":{"queries":{"items":{"$ref":"#/components/schemas/Query"},"type":"array","title":"Queries"},"n_docs":{"type":"integer","title":"N Docs","default":10},"nprobe":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Nprobe"},"min_tile_height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Tile Height"},"instruction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instruction"},"include_images":{"type":"boolean","title":"Include Images","default":false},"articles_only":{"type":"boolean","title":"Articles Only","default":false},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"}},"type":"object","required":["queries"],"title":"SearchRequest"},"SearchResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/QueryResult"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"SearchResponse"},"StatusResponse":{"properties":{"total_vectors":{"type":"integer","title":"Total Vectors"},"dimension":{"type":"integer","title":"Dimension"},"nlist":{"type":"integer","title":"Nlist"},"nprobe":{"type":"integer","title":"Nprobe"},"model":{"type":"string","title":"Model"},"index_dir":{"type":"string","title":"Index Dir","default":""},"tiles_dir":{"type":"string","title":"Tiles Dir","default":""},"index_built_at":{"type":"string","title":"Index Built At"},"index_size_bytes":{"type":"integer","title":"Index Size Bytes"},"metadata_size_bytes":{"type":"integer","title":"Metadata Size Bytes"}},"type":"object","required":["total_vectors","dimension","nlist","nprobe","model","index_built_at","index_size_bytes","metadata_size_bytes"],"title":"StatusResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}