Key facts
| Embeddings | POST /v1/embeddings with plugsky-embed per chunk; plugsky-embed-multilingual for Arabic content |
| Pipeline | Parse, normalize, chunk, embed, index, then retrieve and answer |
| Chunking | Structure-aware chunks with title, heading, page and document id metadata |
| Generation | POST /v1/chat/completions with retrieved passages and citation instructions |
| Pricing model | Flat monthly self-serve plans with unlimited fair-use usage |
| RAG status | RAG is live; embeddings plus chat completions are the building blocks |
| Freshness | Re-embed changed documents by hash and remove vectors for deleted documents |
| Roadmap | Batch ingestion is coming soon; schedule ingestion jobs yourself |
TL;DR
- Ingestion quality sets the ceiling for every answer; invest there first.
- Chunk on document structure and keep provenance metadata on every chunk.
- Embed incrementally by document hash; never re-embed an unchanged corpus.
- Test retrieval with real questions before tuning generation prompts.
- Plan for deletion and updates as first-class pipeline operations.
How it works, step by step
- Inventory document sources and define the retention, access and deletion rules for each.
- Parse documents to text with layout awareness; validate OCR quality on scanned inputs.
- Normalize text and chunk on structure such as headings, clauses and table rows.
- Embed chunks with plugsky-embed and store vectors plus document id, page, section and version.
- Retrieve per question, filter by access metadata, and generate answers with citations.
- Re-embed changed documents by hash and remove vectors when documents are deleted or superseded.
Try it yourself
Open the RAG chunk size calculator →
Two pipelines, one goal
Document RAG separates ingestion from query because they fail differently:
- Ingestion pipeline: parse, normalize, chunk, embed and index. Failures here appear as missing or misleading evidence at query time.
- Query path: retrieve, filter, assemble context and generate with citations. Failures here are visible in answers and citations.
Debugging is far easier when the two are measured separately. If ingestion recall is poor, no generation prompt will fix it.
Ingestion details
Choices that determine retrieval quality:
- Parse with layout awareness: preserve headings, lists, tables and page numbers; check OCR output before indexing scanned documents.
- Normalize carefully: unify Unicode forms and whitespace, but keep original text for display and citation.
- Chunk on structure: headings, clauses and table rows beat fixed character counts for contracts, manuals and reports.
- Attach metadata: document id, title, section, page, version, access class and updated date on every chunk.
- Incremental updates: hash documents, embed only what changed, and delete vectors for removed content.
- Deduplicate: repeated boilerplate wastes retrieval slots and produces repetitive citations.
Query path and evaluation
The query path is deliberately simple:
- Embed the question with plugsky-embed and retrieve candidates under a context budget.
- Filter by access class and document freshness before assembling the prompt.
- Generate with an instruction to answer only from passages and cite source ids.
- Verify cited chunks exist and return them with the answer for review.
Evaluate chunk recall on a labeled question set, citation correctness, groundedness and freshness (share of answers grounded in current document versions). Track ingestion failures separately: parse errors, OCR failures and documents that produced no usable chunks.
Limitations
Document RAG has well-known rough edges:
- Tables and multi-column layouts lose meaning when flattened to text; dedicated table extraction is often required.
- Plugsky returns embeddings, so you own the vector store, ranking and access filtering.
- Freshness is ongoing work: every document update needs a corresponding index update, and stale chunks answer confidently.
- Rerankers are not part of the documented live stack, and batch ingestion is coming soon, so initial bulk indexing needs rate-limited jobs.
- Access control must be enforced at retrieval time, not by hoping the model ignores restricted passages.
Honest comparison
| Capability | Document RAG on Plugsky | Managed document AI | Folder search |
|---|---|---|---|
| Provenance | Page and section metadata per chunk | Vendor citations | Filename only |
| Chunking control | Yours, structure-aware | Vendor defaults | None |
| Freshness | Hash-based incremental re-embedding | Vendor sync | File timestamps |
| Access control | Enforced in retrieval filters | Vendor permissions | Filesystem permissions |
| Model choice | 30+ aliases for generation | Vendor model | Not applicable |
Frequently asked questions
What is the hardest part of document RAG?
Ingestion: parsing layout, chunking on structure and keeping the index fresh. Retrieval and generation are comparatively straightforward once ingestion is clean.
How should I chunk long documents?
On structure — headings, clauses, sections and table rows — with modest overlap and full provenance metadata. Fixed-size splits separate related content and hurt answers.
Which embedding model should I use?
plugsky-embed for English-dominant corpora and plugsky-embed-multilingual for Arabic or mixed-language documents.
How do I handle document updates?
Hash each document at ingestion, re-embed only changed documents, and delete vectors for removed or superseded versions.
Can I restrict which documents a user can retrieve?
Yes, but you must enforce it. Attach access metadata to chunks and filter at retrieval time before the model sees any content.
Do I need OCR?
For scanned documents, yes. Validate OCR quality first, because no amount of embedding quality recovers text that was captured incorrectly.
Can I build the pipeline on the free plan?
Yes. Embeddings are live, the free plan includes two free models with no card, and the 14-day full-access trial supports evaluation on your document corpus.