1. Create a collection
POST https://api.plugsky.com/v1/rag/collections
curl -X POST https://api.plugsky.com/v1/rag/collections \
-H "Authorization: Bearer $PLUGSKY_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "acme-handbook",
"metadata": {"department": "engineering"}
}'
2. Upload a document
POST https://api.plugsky.com/v1/rag/collections/{collection_id}/documents
curl -X POST \
https://api.plugsky.com/v1/rag/collections/abc123/documents \
-H "Authorization: Bearer $PLUGSKY_KEY" \
-F "file=@handbook.pdf" \
-F "metadata={"department":"engineering"}"
Supported formats: PDF, DOCX, TXT, MD, HTML. Documents are chunked (default 500 tokens, 50 token overlap) and embedded with plugsky-embed-v1.
3. Query
POST https://api.plugsky.com/v1/rag/collections/{collection_id}/query
curl -X POST \
https://api.plugsky.com/v1/rag/collections/abc123/query \
-H "Authorization: Bearer $PLUGSKY_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "What is the vacation policy?",
"top_k": 5,
"rerank": true
}'
Query response
{
"chunks": [
{
"id": "chunk_abc",
"text": "Employees receive 25 days of paid vacation per year...",
"score": 0.92,
"source": "handbook.pdf#page=12",
"metadata": {"department": "engineering"}
},
...
],
"rerank_scores": [0.94, 0.87, 0.81, 0.65, 0.58]
}
Frequently asked questions
What vector store do you use?
pgvector by default. Pinecone, Qdrant, and Weaviate are supported on Enterprise. Bring your own on Private Endpoint.
Can I use my own embeddings?
Yes. Set embedding_model: "custom" in the collection create request and provide embeddings in the document upload.
How big can a collection be?
Self-serve: up to 200K documents (Starter 1K, Builder 20K, Scale 200K). Enterprise: no hard cap.
Does RAG use my data to train models?
Never. Documents are stored encrypted at rest and used only for retrieval. They are not used for training any model.
Try RAG
OpenAI-compatible RAG. Free trial, private by default.
Start $5 trial → See RAG feature overview