Open WebUI Engines — MDDB API

The request shapes Open WebUI sends to an external web search engine, reranker and document loader (v2.19.10, issues 449-451). Each is a feature module that starts off. See OPENWEBUI.md.

Search readable collections (external web search shape) #

POST /v1/web-search

v2.19.10 (#449), module webSearch (off by default). Runs the cross-collection full-text search (searchType=hybrid for hybrid) over every collection the caller may read, tenant-scoped, skipping the server's own memory and chat stores; collections on the URL or MDDB_WEBSEARCH_COLLECTIONS narrows that. Each hit becomes link (the document's url, source_url or link metadata when it is http(s), else its /v1/doc-meta URL on the address the request reached), title (meta.title, else the key) and snippet (the passage around the query's words, at most 4096 characters).

Authorization: BearerAuth or APIKeyAuth or none

Parameters #

Name In Type Description
collections query string Collections to search, comma-separated or repeated; aliases and role:<role> are resolved. Every one must be readable.
searchType query string fts (default) or hybrid One of "fts", "hybrid". Default "fts".

Request body #

Required.

Content type application/json: object

Property Type Description
query (required) string What to search for
count integer Results wanted; 10 when absent, under the server's limit cap
{
  "count": 3,
  "query": "how do I reset the pump"
}

Responses #

Status Description Body
200 The hits, best first array of object (application/json)
400 The request is malformed (a body that is not JSON, a missing or invalid field, an unreadable body) or names a subsystem that is not initialized. The message says which. ErrorResponse (application/json)
401 Auth is on (MDDB_AUTH_ENABLED=true) and the request carries no credentials, an invalid or expired JWT, or an unknown API key. ErrorResponse (application/json)
403 The caller lacks the permission the route needs (SEC-019 access gate, auth on: read, write or admin on the collections the request names), or a write meets read-only mode (MDDB_MODE=read or the protocol's own mode). ErrorResponse (application/json)
404 The module this route belongs to is off: switched off at /v1/features (GO-049), or — temporal and spell — not started (MDDB_TEMPORAL or MDDB_SPELL not set to true). Before 2.19.0 the routes of a module not started were not registered and answered a plain-text 404. object (application/json)
405 The route answers one method only (issues 449-451); the Allow header names it. ErrorResponse (application/json)
413 The body is over MDDB_MAX_BODY_BYTES (32 MiB by default). ErrorResponse (application/json)
429 The client is over the API rate limit (MDDB_RATE_LIMIT_ENABLED=true, MDDB_RATE_LIMIT_REQUESTS per MDDB_RATE_LIMIT_WINDOW seconds). A call that embeds can also be refused by the collection's daily embedding budget, with a QuotaExceeded body. Since v2.19.8 (GO-054) a request over its tenant's or its credential's rate or concurrency limit is refused with a TenantLimit body. anyOf RateLimitError | TenantLimit (application/json)
503 The collection list is still being computed, or every search slot is busy; retry ErrorResponse (application/json)

200 example (application/json)

[
  {
    "link": "http://mddb:11023/v1/doc-meta?collection=kb\u0026key=pump\u0026lang=en",
    "snippet": "To reset the pump, hold the button for five seconds.",
    "title": "Pump maintenance"
  }
]

400 example (application/json)

{
  "error": "missing collection"
}

401 example (application/json)

{
  "error": "missing authentication"
}

403 example (application/json)

{
  "error": "forbidden"
}

404 example (application/json)

{
  "error": "feature disabled",
  "feature": "temporal"
}

405 example (application/json)

{
  "error": "method not allowed: use POST"
}

413 example (application/json)

{
  "error": "request body too large"
}

Score texts against a query (external reranker shape) #

POST /v1/rerank

v2.19.10 (#450), module rerankApi (off by default). Scores the documents with the reranking model the search rerank stage uses (a stored configuration of kind rerank, else MDDB_RERANK_*), with its cache. The server runs one model, so model does not choose one: reranker, empty or any other name use it, and the answer names it. Every document gets a result; one the model did not score gets a score below all the others. Each document is read up to 2048 characters; at most 200 documents and 2 MiB of text per call.

Authorization: BearerAuth or APIKeyAuth or none

Request body #

Required.

Content type application/json: object

Property Type Description
model string Accepted and ignored
query (required) string
documents (required) array of string
top_n integer Results to return; 0 or absent returns one per document Minimum 0.
{
  "documents": [
    "Hold the button.",
    "Oil monthly."
  ],
  "model": "reranker",
  "query": "pump reset",
  "top_n": 2
}

Responses #

Status Description Body
200 The scores, best first object (application/json)
400 The request is malformed (a body that is not JSON, a missing or invalid field, an unreadable body) or names a subsystem that is not initialized. The message says which. ErrorResponse (application/json)
401 Auth is on (MDDB_AUTH_ENABLED=true) and the request carries no credentials, an invalid or expired JWT, or an unknown API key. ErrorResponse (application/json)
404 The module this route belongs to is off: switched off at /v1/features (GO-049), or — temporal and spell — not started (MDDB_TEMPORAL or MDDB_SPELL not set to true). Before 2.19.0 the routes of a module not started were not registered and answered a plain-text 404. object (application/json)
405 The route answers one method only (issues 449-451); the Allow header names it. ErrorResponse (application/json)
413 The body is over MDDB_MAX_BODY_BYTES (32 MiB by default). ErrorResponse (application/json)
429 The client is over the API rate limit (MDDB_RATE_LIMIT_ENABLED=true, MDDB_RATE_LIMIT_REQUESTS per MDDB_RATE_LIMIT_WINDOW seconds). A call that embeds can also be refused by the collection's daily embedding budget, with a QuotaExceeded body. Since v2.19.8 (GO-054) a request over its tenant's or its credential's rate or concurrency limit is refused with a TenantLimit body. anyOf RateLimitError | TenantLimit (application/json)
502 The reranking model failed (timeout, invalidResponse or error) ErrorResponse (application/json)
503 No reranking model is configured ErrorResponse (application/json)

200 example (application/json)

{
  "model": "my-reranker",
  "results": [
    {
      "index": 0,
      "relevance_score": 0.92
    },
    {
      "index": 1,
      "relevance_score": 0.11
    }
  ]
}

400 example (application/json)

{
  "error": "missing collection"
}

401 example (application/json)

{
  "error": "missing authentication"
}

404 example (application/json)

{
  "error": "feature disabled",
  "feature": "temporal"
}

405 example (application/json)

{
  "error": "method not allowed: use POST"
}

413 example (application/json)

{
  "error": "request body too large"
}

502 example (application/json)

{
  "error": "the reranking model failed: timeout"
}

Convert a file to Markdown without storing it (external document loader shape) #

PUT /v1/extract/process

v2.19.10 (#451), module extractApi (off by default). The converters of /v1/upload, without the write. The format comes from Content-Type, then the X-Filename extension; PDF and the zip formats are also recognised by content. One document answers an object; a mailbox or an email with attachments answers a list, the file first. Metadata values are strings, conversionConfidence a number.

Authorization: BearerAuth or APIKeyAuth or none

Parameters #

Name In Type Description
X-Filename header string The file's name, URL-quoted; a directory part is dropped
maxSize query integer Size limit in bytes; 10 MB when absent, at most 100 MB (MDDB_MAX_BODY_BYTES still applies) Minimum 1.

Request body #

Required.

The file's bytes

Content type application/octet-stream: string (binary)

string

Responses #

Status Description Body
200 The document, or the documents the file holds oneOf ExtractedDocument | array of ExtractedDocument (application/json)
400 The request is malformed (a body that is not JSON, a missing or invalid field, an unreadable body) or names a subsystem that is not initialized. The message says which. ErrorResponse (application/json)
401 Auth is on (MDDB_AUTH_ENABLED=true) and the request carries no credentials, an invalid or expired JWT, or an unknown API key. ErrorResponse (application/json)
404 The module this route belongs to is off: switched off at /v1/features (GO-049), or — temporal and spell — not started (MDDB_TEMPORAL or MDDB_SPELL not set to true). Before 2.19.0 the routes of a module not started were not registered and answered a plain-text 404. object (application/json)
405 The route answers one method only (issues 449-451); the Allow header names it. ErrorResponse (application/json)
413 The body is over MDDB_MAX_BODY_BYTES (32 MiB by default). ErrorResponse (application/json)
415 No converter reads this format; the message lists the supported ones ErrorResponse (application/json)
422 The file is of a supported format but could not be converted ErrorResponse (application/json)
429 The client is over the API rate limit (MDDB_RATE_LIMIT_ENABLED=true, MDDB_RATE_LIMIT_REQUESTS per MDDB_RATE_LIMIT_WINDOW seconds). A call that embeds can also be refused by the collection's daily embedding budget, with a QuotaExceeded body. Since v2.19.8 (GO-054) a request over its tenant's or its credential's rate or concurrency limit is refused with a TenantLimit body. anyOf RateLimitError | TenantLimit (application/json)

200 example (application/json)

{
  "metadata": {
    "conversionConfidence": 1,
    "converter": "pdf",
    "mime": "application/pdf",
    "source": "Report Q1.pdf"
  },
  "page_content": "# Report\n\nWater level 4.2 m."
}

400 example (application/json)

{
  "error": "missing collection"
}

401 example (application/json)

{
  "error": "missing authentication"
}

404 example (application/json)

{
  "error": "feature disabled",
  "feature": "temporal"
}

405 example (application/json)

{
  "error": "method not allowed: use POST"
}

413 example (application/json)

{
  "error": "request body too large"
}