Docs

How does the Plugsky RAG API work?

Plugsky's RAG API exposes three endpoints: create a collection, upload documents, and query. PDF, DOCX, TXT, MD and HTML files are chunked, embedded and indexed automatically, and queries return ranked chunks with citations. Documents are encrypted at rest and are never used to train models.

Key facts

CollectionsPOST /v1/rag/collections
DocumentsPOST /v1/rag/collections/{id}/documents
QueryPOST /v1/rag/collections/{id}/query
FormatsPDF, DOCX, TXT, MD, HTML
Chunking500-token chunks with 50-token overlap by default
EmbeddingsDocuments embedded with the plugsky-embed model
RerankingOptional rerank: true on queries
Data useDocuments never used to train any model

TL;DR

  • Three calls: create a collection, upload documents, query.
  • Chunking, embedding and indexing happen automatically.
  • Queries return ranked chunks with source citations and scores.
  • pgvector is the default store; Pinecone, Qdrant and Weaviate on Enterprise.
  • Bring your own embeddings by setting embedding_model to custom.

How it works, step by step

  1. Create a collection with POST /v1/rag/collections and note its id.
  2. Upload files with multipart POST to the collection's documents endpoint.
  3. Attach metadata such as department or access level to each document.
  4. Query with top_k and rerank: true to tune recall and ordering.
  5. Read chunks, scores and source references from the response.
  6. Compose the retrieved chunks into a chat completion prompt with citation instructions.
1Create a collectionwith POST/v1/rag/collections2Upload files withmultipart POST tothe collection's3Attach metadatasuch as departmentor access level to4Query with top_kand rerank: true totune recall and5Read chunks, scoresand sourcereferences from the6Compose theretrieved chunksinto a chat

Original data

POST /v1/rag/cCollectionsPOST /v1/rag/cDocumentsPOST /v1/rag/cQuery500-token chunChunkingSource: Plugsky facts table · updated 2026-09-25

Try it yourself

Open the RAG sandbox →

Collections and document upload

A collection is the container for one knowledge base. You create it with a name and optional metadata, then upload documents to its documents endpoint. The API accepts PDF, DOCX, TXT, MD and HTML. During upload you can attach per-document metadata, which is returned with chunks at query time and is useful for access filters or routing.

Documents move through parsing, chunking, embedding and indexing automatically; there is no separate indexing call to make.

Chunking, embeddings and storage

By default documents are split into 500-token chunks with 50-token overlap and embedded with the plugsky-embed model. Overlap preserves context that would otherwise be cut at a boundary. If your content has structure — policies with sections, contracts with clauses — test a smaller or larger chunk size against your own evaluation set before uploading everything.

pgvector is the default vector store. Pinecone, Qdrant and Weaviate are supported on Enterprise, and Private Endpoint deployments can bring their own store. You can also set embedding_model: "custom" and supply your own vectors at upload time.

Querying and citations

A query takes the search text, top_k and an optional rerank flag. The response contains the top chunks with text, similarity score, source (for example handbook.pdf#page=12) and metadata, plus rerank scores when enabled. Because every chunk carries its source, you can require the chat model to cite the document and page it used.

Ask for fewer, more relevant chunks rather than a large top_k: every chunk consumes context window and can dilute the answer.

Scale, deployment and data handling

Self-serve collections scale to large document counts, and Enterprise removes the hard cap. The same endpoints run in region-locked data planes and in VPC, on-prem and air-gapped deployments. Documents are stored encrypted at rest, used only for retrieval, and never used to train models — an important distinction when your material is confidential.

Honest caveat: the RAG API is a managed retrieval layer, not a full document-management system. Versioning, retention policy and complex permission models belong in your application or in your own index if those requirements are strict.

Honest comparison

CapabilityPlugsky RAG APIDIY RAG stackFully managed competitor
SetupThree endpoints, automatic indexingChunking, embedding, store and query codeVaries
FormatsPDF, DOCX, TXT, MD, HTMLWhatever you parseVaries
CitationsBuilt into query resultsYou implementOften available
Vector storepgvector default; bring your own on EnterpriseYour choiceVendor's store
DeploymentCloud, VPC, on-prem, air-gappedWherever you host itUsually SaaS only
Ops overheadManagedHighManaged

Frequently asked questions

What vector store does Plugsky use?

pgvector by default. Pinecone, Qdrant and Weaviate are supported on Enterprise, and Private Endpoint deployments can bring their own store.

Can I use my own embeddings?

Yes. Set embedding_model to custom in the collection create request and provide embeddings with the document upload.

How big can a collection be?

Self-serve collections support large document volumes, and Enterprise has no hard cap; check the live docs for the current limit on your plan.

Does RAG use my data to train models?

No. Documents are stored encrypted at rest, used only for retrieval, and never used to train any model.

Which file formats are supported?

PDF, DOCX, TXT, MD and HTML are supported by default.

Can I rerank results?

Yes. Set rerank: true on a query and the response includes rerank scores alongside the original similarity scores.

Where does RAG run for regulated workloads?

The RAG API runs in the same region-locked data planes as chat and can be deployed in VPC, on-prem or air-gapped environments on Enterprise.

Cite this page

Plugsky (2026). “RAG API — Collections, Documents, Queries”. Plugsky. Available at: https://plugsky.com/docs/rag (last updated 2026-09-25).