Manage RAG (Retrieval-Augmented Generation) collections and documents. Collections are named
containers for documents that are chunked, embedded, and indexed for semantic search.
Actions:
Collection actions:
- "create_collection": Create a new collection
- "list_collections": List all collections in an app
- "get_collection": Get details for a specific collection (includes document counts by status)
- "delete_collection": Permanently delete a collection and all its documents/embeddings
Document actions:
- "ingest_document": Add a document (raw text or uploaded file) to be chunked, embedded, and indexed
- "list_documents": List all documents in a collection with their status
- "get_document_status": Check the processing status of a specific document
- "delete_document": Permanently delete a document and its chunks/embeddings
Parameters by action:
create_collection: { app_id, action: "create_collection", name, description?, access_mode?, chunk_size?, chunk_overlap? }
list_collections: { app_id, action: "list_collections" }
get_collection: { app_id, action: "get_collection", name }
delete_collection: { app_id, action: "delete_collection", name }
ingest_document: { app_id, collection, action: "ingest_document", text?, storage_object_id?, filename?, metadata? }
list_documents: { app_id, collection, action: "list_documents" }
get_document_status: { app_id, collection, action: "get_document_status", document_id }
delete_document: { app_id, collection, action: "delete_document", document_id }
access_mode options (create_collection):
- "private" (default): Only the app owner can query
- "shared": All authenticated users can query
- "custom": Use RLS policies for fine-grained access
Ingestion modes for ingest_document (provide one):
1. Raw text: provide "text" directly
2. File-based: upload via manage_storage (action: "upload_url") first, then provide "storage_object_id"
Supported file types: PDF, TXT, Markdown, CSV, HTML, DOCX, XLSX, PPTX.
Document statuses: "pending" → "processing" → "ready" (or "failed")
Workflow: create_collection → ingest_document → poll get_document_status until "ready" → query with rag_query.
Warning: "delete_collection" permanently removes the collection, all documents, and embeddings. Cannot be undone.
Warning: "delete_document" permanently removes the document and its embeddings. To replace, delete then re-ingest.
Common errors:
- RESOURCE_NOT_FOUND: App, collection, or document doesn't exist
- VALIDATION_DUPLICATE_NAME: Collection name already exists (create_collection)
- VALIDATION_ERROR: Neither text nor storage_object_id provided (ingest_document)