Skip to content

Data, embeddings and vector DB

The endpoints under the projects: what the server can read, a chunking preview, the embedding model, and the raw vector DB API. Projects use the vector DB for you; the /vectordb endpoints are for using it directly.

Paths are relative to /api/v1. The examples use BASE=http://localhost:8000/api/v1 and an API key in $KEY.

GET /

The app's name and version. It needs no key, even with authentication on, and touches nothing else, so use it as a liveness check: the process is up and answering.

curl "$BASE/"
{"app_name": "pagelore", "app_version": "0.1.0"}

GET /health

Readiness: checks that the app can reach Postgres (SELECT 1) and the vector DB (asks whether a collection exists), both at once, each within 5 seconds. Use it for a load balancer or a Kubernetes readiness probe. It needs no key, even with authentication on. No query parameters.

Response: 200 when both answer, 503 when either does not. Same body either way:

Field Type
status string ok or unavailable
app_name, app_version string As in GET /
checks object database and vector_db, each {ok, latency_ms, error}
checks.*.ok boolean The check passed
checks.*.latency_ms number How long the check took
checks.*.error string Only on a failed check: the error's type (such as OperationalError) or no answer within 5s. The message is logged on the server, with credentials masked, and not returned, since the endpoint is public
curl -i "$BASE/health"
{"status": "ok", "app_name": "pagelore", "app_version": "0.1.0",
 "checks": {"database": {"ok": true, "latency_ms": 1.8},
            "vector_db": {"ok": true, "latency_ms": 3.2}}}

When the vector DB is down (HTTP 503):

{"status": "unavailable", "app_name": "pagelore", "app_version": "0.1.0",
 "checks": {"database": {"ok": true, "latency_ms": 1.6},
            "vector_db": {"ok": false, "latency_ms": 2.4, "error": "ResponseHandlingException"}}}

Don't use it as a liveness probe: an orchestrator would restart the app when only Postgres or the vector DB is down. Use GET / for that.

GET /data/file-types

Every file type the server reads and whether its optional parser is installed here, the chunking strategies, the default chunking options and the upload limits. Needs read.

Response: 200

Field
file_types One per loader: loader (its name, such as PDF), description, extensions (without the dot, such as ["pdf"]), content_type (what its text looks like, which picks the auto strategy: text, markdown, code, table, json, slides or transcript), page_unit (what page counts in its citations: page, slide, sheet, table, chapter, message, cell or frame; null when it has no pages), available (it can be used on this server), missing (the packages it still needs) and extra (the package extra that installs them). Two more entries: DOCLING, the Docling extractor and the types it reads, and ARCHIVE, the archives whose files become documents
chunking_strategies strategy, description and needs_embeddings (semantic embeds the sentences to find where the meaning shifts)
chunking_defaults The chunking options a project starts with (from the CHUNKING_* / CHUNK_* settings), every option filled in
limits file_max_size_mb (per file), max_files_per_request, archive_max_files and archive_max_total_size_mb (what an archive may hold, unpacked)
curl "$BASE/data/file-types" -H "Authorization: Bearer $KEY"
{
  "file_types": [
    {"loader": "PDF", "description": "PDF, one section per page, without running headers and footers (OCR for scanned pages with the ocr extra)",
     "extensions": ["pdf"], "content_type": "text", "page_unit": "page", "available": true,
     "missing": [], "extra": null},
    {"loader": "DOCLING", "description": "Docling (DOCUMENT_EXTRACTOR=docling or extractor=docling): layout analysis, reading order, table structure and OCR, as Markdown per page or slide",
     "extensions": ["docx", "html", "pdf", "pptx", "xlsx"], "content_type": "markdown",
     "page_unit": null, "available": false, "missing": ["docling"], "extra": "docling"},
    {"loader": "ARCHIVE", "description": "ZIP and TAR archives: each file inside becomes its own document",
     "extensions": ["zip", "tar", "tgz", "tar.gz", "tbz2", "tar.bz2", "txz", "tar.xz"],
     "content_type": null, "page_unit": null, "available": true, "missing": [], "extra": null}
  ],
  "chunking_strategies": [
    {"strategy": "auto", "description": "Picks from the file type: markdown, code, table, json, page for slides, recursive for everything else",
     "needs_embeddings": false},
    {"strategy": "semantic", "description": "Sentences grouped where the meaning shifts (embedding distance; percentile / standard_deviation / interquartile / gradient)",
     "needs_embeddings": true}
  ],
  "chunking_defaults": {"extractor": "native", "strategy": "auto", "chunk_size": 1000,
                        "chunk_overlap": 200, "length_unit": "chars", "token_encoding": "cl100k_base",
                        "separators": null, "separators_regex": false, "language": null,
                        "rows_per_chunk": null, "table_format": "csv",
                        "semantic_threshold_type": "percentile", "semantic_threshold_amount": 95.0,
                        "semantic_buffer_size": 1, "contextual_header": false, "llm_context": false,
                        "parent_chunk_size": null},
  "limits": {"file_max_size_mb": 100, "max_files_per_request": 50,
             "archive_max_files": 1000, "archive_max_total_size_mb": 1024}
}

The lists are shortened here; the limits and defaults are the out-of-the-box settings.

GET /data/text-search-languages

The languages a project's keyword index can use: the Postgres text search configurations, which decide stemming and stop words. simple only lower-cases words and works for any language. Set it on a project with text_search_language. Needs read.

Response: 200 with default (TEXT_SEARCH_LANGUAGE, the language of new projects) and languages.

curl "$BASE/data/text-search-languages" -H "Authorization: Bearer $KEY"
{"default": "english",
 "languages": ["arabic", "danish", "dutch", "english", "french", "german", "simple", "spanish"]}

POST /data/preview

Extract and chunk one file without storing anything, to try strategies and sizes before uploading it to a project. Needs write.

Body (multipart/form-data):

Field Type Allowed values Default
file file one file, not an archive, up to FILE_MAX_SIZE_MB required The file to chunk
limit integer 1 to 500 20 The most chunks (and parents) to return. The counts and lengths cover all of them
any chunking option the server's defaults extractor, strategy, chunk_size, chunk_overlap, length_unit, token_encoding, separators (repeat the field), separators_regex, language, rows_per_chunk, table_format, semantic_threshold_type, semantic_threshold_amount, semantic_buffer_size, contextual_header, llm_context, parent_chunk_size, ... as form fields

Options you leave out come from the CHUNKING_* / CHUNK_* settings, not from a project. llm_context is accepted but no LLM contexts are written in a preview.

Response: 200

Field
chunking The options used, every one filled in, plus resolved_strategy: the strategy auto picked
chunk_count Chunks in all
chars {min, max, avg} chunk length in characters
chunks The first limit chunks: {chunk_index, chunk_text, chunk_metadata, parent_index}. chunk_metadata has the chunk's citation fields (page, headings, ...) and its char_start and char_end in the document's text; parent_index is its parent, with parent_chunk_size
parent_count, parent_chars, parents With parent_chunk_size: the parent count, their {min, max, avg} length, and the first limit parents ({parent_index, parent_text, parent_metadata})
document What was extracted: file_name, loader, content_type, page_unit, metadata (title, author, ... when the file has them), section_count and text_length (characters)

Errors:

Status When
400 The file is an archive (preview one file at a time)
413 The file is larger than FILE_MAX_SIZE_MB
422 The file can't be read (an unsupported type, a parser that is not installed, a damaged file), or a chunking option is invalid
502 The embedding provider failed (semantic strategy)
# Markdown-aware chunks of 400 tokens, with parents of 2000 characters
curl -X POST "$BASE/data/preview" -H "Authorization: Bearer $KEY" \
     -F file=@handbook.md -F strategy=markdown -F chunk_size=400 -F length_unit=tokens \
     -F parent_chunk_size=2000 -F limit=3

# Custom separators: repeat the field
curl -X POST "$BASE/data/preview" -H "Authorization: Bearer $KEY" \
     -F file=@notes.txt -F strategy=recursive -F separators=$'\n\n' -F separators=$'\n'
{
  "chunking": {"extractor": "native", "strategy": "markdown", "chunk_size": 400,
               "chunk_overlap": 200, "length_unit": "tokens", "parent_chunk_size": 2000,
               "resolved_strategy": "markdown"},
  "chunk_count": 58,
  "chars": {"min": 212.0, "max": 1790.0, "avg": 1324.6},
  "chunks": [
    {"chunk_index": 0, "chunk_text": "# Handbook\n\nWelcome to Acme...",
     "chunk_metadata": {"headings": ["Handbook"], "char_start": 0, "char_end": 1402},
     "parent_index": 0}
  ],
  "parent_count": 21,
  "parent_chars": {"min": 640.0, "max": 2000.0, "avg": 1870.2},
  "parents": [
    {"parent_index": 0, "parent_text": "# Handbook\n\nWelcome to Acme...",
     "parent_metadata": {"headings": ["Handbook"]}}
  ],
  "document": {"file_name": "handbook.md", "loader": "MARKDOWN", "content_type": "markdown",
               "page_unit": null, "metadata": {}, "section_count": 24, "text_length": 76840}
}

chunking is shortened here: it has every option.

GET /embeddings/model

The configured embedding model. New collections and projects are bound to it. Needs read.

Response: 200 with provider, model and dimension (the vector size). Errors: 502 when the provider fails (the dimension is read from it when it is not configured).

curl "$BASE/embeddings/model" -H "Authorization: Bearer $KEY"
{"provider": "openai", "model": "text-embedding-3-small", "dimension": 1536}

POST /embeddings

Embed texts with the configured model, for example to search the vector DB with your own vectors. Needs read.

Body (JSON):

Field Type Allowed values Default
texts list of strings 1 to 256 texts, each 1 to 100000 characters required
input_type string document, query document Models that embed questions and passages differently (Cohere, Voyage, E5, ...) use it; others ignore it. Use query for search queries

Response: 200 with provider, model, dimension and embeddings (one vector per text, in order).

Errors: 400 (the provider refused the input), 422 (a field is invalid), 502 (the provider failed).

curl -X POST "$BASE/embeddings" -H "Authorization: Bearer $KEY" \
     -H 'Content-Type: application/json' \
     -d '{"texts": ["How long is the notice period?"], "input_type": "query"}'
{"provider": "openai", "model": "text-embedding-3-small", "dimension": 1536,
 "embeddings": [[0.0123, -0.0456, 0.0789]]}

Vector DB

The raw API of the configured vector database (Qdrant, pgvector, Chroma, ...): collections and the records in them. Every /vectordb endpoint needs admin.

Each collection is bound to an embedding model when it is created: text you insert or search with is embedded with that model, and a collection made for another model than the configured one gives 409. A collection created with embedding_size holds external vectors instead: it takes only vectors of that size, never text.

Projects keep their chunks in collections named pagelore_project_{id}. They show up here; change them through the project endpoints, not these.

Collection names: 3 to 45 characters, letters, digits, _ and -, starting and ending with a letter or digit (the rules every supported database accepts).

The collection embedding

Field Type
embedding_provider string or null null for external vectors
embedding_model string or null
embedding_size integer The vector size
distance_method string Such as cosine
external_vectors boolean No model: it takes only vectors
created_at datetime or null

GET /vectordb/collections

The collection names. Response: 200 with {"collections": [...]}.

curl "$BASE/vectordb/collections" -H "Authorization: Bearer $ADMIN_KEY"
{"collections": ["pagelore_project_1", "faq"]}

POST /vectordb/collections

Create a collection.

Body (JSON):

Field Type Allowed values Default
collection_name string the name rules above required
do_reset boolean false Drop it and create it again if it exists, records included
embedding_size integer more than 0 the configured model's Leave it out to bind the collection to the configured model. Set it only for vectors computed outside the app

Response: 201 with collection_name, created (true) and embedding.

Errors: 409 (it exists and do_reset is false), 422 (a bad name), 502 (the embedding provider failed while reading the model's dimension).

# Bound to the configured model
curl -X POST "$BASE/vectordb/collections" -H "Authorization: Bearer $ADMIN_KEY" \
     -H 'Content-Type: application/json' -d '{"collection_name": "faq"}'

# 384-dimension vectors computed elsewhere
curl -X POST "$BASE/vectordb/collections" -H "Authorization: Bearer $ADMIN_KEY" \
     -H 'Content-Type: application/json' -d '{"collection_name": "ext-384", "embedding_size": 384}'
{"collection_name": "faq", "created": true,
 "embedding": {"embedding_provider": "openai", "embedding_model": "text-embedding-3-small",
               "embedding_size": 1536, "distance_method": "cosine", "external_vectors": false,
               "created_at": "2026-12-01T08:00:00Z"}}

GET /vectordb/collections/{collection_name}

A collection: name, record_count, details (what the database reports about it, which differs between databases) and embedding (null when no model was recorded for it, for example a collection made outside the app: create it again to use it here). Errors: 404.

curl "$BASE/vectordb/collections/faq" -H "Authorization: Bearer $ADMIN_KEY"

DELETE /vectordb/collections/{collection_name}

Delete a collection and its records. Response: 204. Errors: 404.

POST /vectordb/collections/{collection_name}/records

Insert records, or replace records with the same id.

Body (JSON):

Field Type Allowed values Default
records list 1 to 1000 records (below) required
batch_size integer 1 to 1000 50 Records embedded and written per call

Each record:

Field Type Default
id string or integer payload.chunk_id, else a random UUID
payload object {} Stored with the vector and returned by search. project_id and document_id in it can be filtered on
text string, 1 to 100000 characters Embedded with the collection's model; stored in payload.text
vector list of numbers A vector of the collection's size instead of text

Give each record exactly one of text and vector.

Response: 200 with collection_name and inserted_count.

Errors:

Status When
400 A vector of the wrong size, or text for an external-vectors collection
404 The collection does not exist
409 The collection has no recorded model, or belongs to another model than the configured one
422 Both or neither of text and vector, or another invalid field
500 The database refused the records
502 The embedding provider failed
curl -X POST "$BASE/vectordb/collections/faq/records" -H "Authorization: Bearer $ADMIN_KEY" \
     -H 'Content-Type: application/json' -d '{
  "records": [
    {"id": "refunds", "text": "Refunds are issued within 14 days.", "payload": {"project_id": 1, "topic": "billing"}},
    {"id": 2, "text": "Support is open 9 to 5, Monday to Friday."}
  ]
}'
{"collection_name": "faq", "inserted_count": 2}

POST /vectordb/collections/{collection_name}/search

The records nearest to a text or a vector.

Body (JSON):

Field Type Allowed values Default
text string 1 to 100000 characters Embedded with the collection's model
vector list of numbers the collection's size Instead of text
limit integer 1 to 100 5 Results
filters object project_id, document_id Only records whose payload matches. Each is a value (a string of 1 to 512 characters, or an integer) or a list of 1 to 1000 values, matching any of them; the fields are combined with AND. Unknown fields are refused

Give exactly one of text and vector.

Response: 200 with results: {id, score, payload}, nearest first. id is always a string.

Errors: 400, 404, 409, 422 and 502 as for inserting.

curl -X POST "$BASE/vectordb/collections/faq/search" -H "Authorization: Bearer $ADMIN_KEY" \
     -H 'Content-Type: application/json' \
     -d '{"text": "when do I get my money back", "limit": 3, "filters": {"project_id": [1, 2]}}'
{"results": [
  {"id": "refunds", "score": 0.83,
   "payload": {"project_id": 1, "topic": "billing", "text": "Refunds are issued within 14 days."}}
]}

POST /vectordb/collections/{collection_name}/records/delete

Delete records by id or by filter.

Body (JSON): exactly one of

Field Type Allowed values
ids list of strings or integers 1 to 1000 These records
filters object as for search, not empty Every record that matches

Response: 204. Unknown ids, and filters that match nothing, are not errors. Errors: 400, 404, 422 (both, or neither), 500.

curl -X POST "$BASE/vectordb/collections/faq/records/delete" -H "Authorization: Bearer $ADMIN_KEY" \
     -H 'Content-Type: application/json' -d '{"ids": ["refunds", 2]}'

curl -X POST "$BASE/vectordb/collections/faq/records/delete" -H "Authorization: Bearer $ADMIN_KEY" \
     -H 'Content-Type: application/json' -d '{"filters": {"document_id": 31}}'