How it works

From upload to answer, step by step.

A document doesn't sit passively in storage — it goes through a pipeline that makes it searchable within moments of arriving.

The pipeline

What happens when a document is uploaded.

  1. 01

    Upload goes straight to object storage

    The client uploads directly to a Cloudflare R2 bucket via a presigned URL — the file never transits the API server itself.

  2. 02

    A job is queued

    The API enqueues a processing job on Cloudflare Queues, and an ingestion worker picks it up.

  3. 03

    The document is split into overlapping chunks

    Text is divided into a sliding window of roughly 2,048 characters per chunk, with a 400-character overlap so a sentence split across two chunks doesn't lose context.

  4. 04

    Each chunk is embedded

    Cloudflare Workers AI generates a 768-dimension vector embedding per chunk, capturing its meaning, not just its words.

  5. 05

    Everything lands in Postgres

    Chunks, their embeddings (via pgvector), and a generated full-text-search column all land in the organization's scoped rows, ready to be queried the moment indexing finishes.

  6. 06

    A query searches by keyword, meaning, or both

    Keyword search hits the full-text index; semantic search compares your question's embedding against chunk embeddings; hybrid search blends both rankings with reciprocal rank fusion.

  7. 07

    (Planned) An answer is generated with citations

    The retrieval-augmented generation layer will take the top-ranked chunks, generate an answer, and attach a citation back to the source file and passage — this step is still being built.

02Architecture

A hosted pipeline, not a desktop app.

A document you upload goes to object storage, gets picked up by an ingestion worker that splits it into overlapping chunks and embeds them, and lands in Postgres ready to be searched — by keyword, by meaning, or both.

yourdocsNext.jsfrontendNestJSAPICF WorkersingestionR2file storageSupabasePostgres + pgvector

Want the full technical reference?

Data model, RLS policy structure, and a capability-by-capability build-status breakdown — for your security and procurement review.

Talk to the team that actually builds the software.

Pilot deployments, volume licensing, product demos, security questionnaires — all handled by engineers and product leads, not a routing layer. We respond within one business day.

Schedule a discovery call
Half-hour walkthrough with someone who built the product — no sales script.
Run a pilot deployment
Full-feature evaluation with guided install, configured for your environment.
Email us directly
sales@royalsoftworks.com — we respond within one business day.

Send us a message

Leave your details and we'll follow up within one business day.