Ingestion¶
Ingestion turns a source into searchable chunks. Every document belongs to a project, which has its own vector collection and can set its own default chunking and keyword-search language.
flowchart LR
S["Source<br/>upload / text / URL / S3"] --> H["Hash +<br/>external_id check"]
H --> X["Extract sections<br/>(native or Docling)"]
X --> C["Chunk<br/>(strategy)"]
C --> P["Parents<br/>(optional)"]
C --> LC["LLM context<br/>(optional)"]
LC --> E["Embed"]
C --> E
E --> V[("Vector DB")]
C --> PG[("Postgres<br/>text + BM25 index")]
Sources¶
| Endpoint | Source |
|---|---|
POST /projects/{id}/documents |
File uploads (multipart). ZIP and TAR archives are expanded |
POST /projects/{id}/documents/text |
Text, Markdown, HTML or JSON in the request body |
POST /projects/{id}/documents/url |
Web pages, files by URL, sitemaps, or a crawl of a site |
POST /projects/{id}/documents/s3 |
S3 (or MinIO, R2, B2, Wasabi, ...) objects under a prefix, or by key |
POST /projects/{id}/sync |
Re-read the web and S3 documents and re-index what changed |
Options every source takes¶
| Option | Default | |
|---|---|---|
metadata |
none | Your metadata for every document, a JSON object (Metadata) |
on_conflict |
new_version |
What to do when the external_id already exists: new_version, skip, keep_both |
chunking |
project / server defaults | Any chunking option, for this request only |
process |
true |
false stores the document without extracting or indexing it (created) |
background |
false |
Return at once with a job_id, and do the work as a background job |
Uploads take these as form fields (-F chunk_size=500,
-F metadata='{"team": "hr"}'), plus external_id for a single file. The
other sources take them in the JSON body, with chunking options under
chunking.
Results¶
Each file, page or object gets its own result with a reason. One bad file never fails the rest.
| Status | Meaning |
|---|---|
indexed |
Extracted, chunked, embedded and searchable |
created |
Stored but not processed (process: false, or background: true) |
duplicate |
The project already has this exact content under this key |
skipped |
The key exists and on_conflict is skip |
unchanged |
The web page or S3 object did not change since its import |
unsupported |
No loader reads this file type on this server |
rejected |
Refused: too large, an unsafe archive member, over a limit |
failed |
Extraction or indexing failed; message says why |
missing / deleted |
Sync only: the page or object is gone (and was deleted with delete_missing) |
Web and S3 imports also return stats (pages fetched, skipped by
robots.txt, ...) and warnings.
Document status¶
A stored document has one of these status values:
stateDiagram-v2
[*] --> pending
pending --> processing
processing --> indexed
processing --> failed
indexed --> processing: process / reindex
failed --> processing: process / reindex
GET /projects/{id}/documents?status=failed lists the failed ones, with the
error.
Limits¶
| Setting | Default | |
|---|---|---|
FILE_MAX_SIZE_MB |
100 |
Largest file, or archive member |
FILE_MAX_FILES_PER_REQUEST |
50 |
Files per upload request |
ARCHIVE_MAX_FILES |
1000 |
Files read from one archive |
ARCHIVE_MAX_TOTAL_SIZE_MB |
1024 |
Total uncompressed size of one archive (guards against zip bombs) |
FILE_KEEP_ORIGINALS |
true |
Keep each original file, so it can be extracted again (reload, a change of extractor) |
Archive members with unsafe paths are rejected, and nested archives are skipped.
Re-processing a stored document¶
# Re-chunk with other options (the extracted text is reused)
curl -X POST localhost:8000/api/v1/projects/1/documents/7/process \
-H 'Content-Type: application/json' -d '{"chunking": {"chunk_size": 500}}'
# Extract the kept file again, for example after installing OCR
curl -X POST localhost:8000/api/v1/projects/1/documents/7/process \
-H 'Content-Type: application/json' -d '{"reload": true}'
force: true also takes a document stuck in processing, and
background: true returns at once with a job_id (Background jobs).
Trying options without storing anything¶
# A file, chunked with these options, nothing stored
curl -X POST localhost:8000/api/v1/data/preview -F file=@report.pdf \
-F strategy=semantic -F limit=10
# A stored document, re-chunked in memory
curl -X POST localhost:8000/api/v1/projects/1/documents/7/preview \
-H 'Content-Type: application/json' -d '{"chunking": {"strategy": "markdown"}}'
Previews return the chunks (up to limit, default 20, at most 500), their
metadata and, with parent_chunk_size, the parents.