Availability
RAG and datasource services are available to plugins that run in AI Studio.
Studio plugins can build their own document ingestion and semantic search with these calls. The plugin controls chunking, embedding generation and storage. For example, a plugin can ingest a GitHub repository or a Confluence space with its own chunking strategy. The calls are functions of the
ai_studio_sdk package. For the scope of each call, refer to Scopes.
Core RAG APIs
GenerateEmbedding
Generate embeddings for text chunks without storing them.Expandable
datasources.embeddings
Use Case: Custom chunking workflows where you generate embeddings first, then decide what to store.
StoreDocuments
Store pre-computed embeddings in the vector store without regenerating them.Expandable
datasources.embeddings
Use Case: Complete control over embeddings - use custom models, external services, or cached embeddings.
Supported Vector Stores:
- Pinecone, PGVector, Chroma (v0.2.5 or later) and Weaviate
- Qdrant, with the Qdrant SDK installed
- Redis, with RediSearch configured
ProcessAndStoreDocuments
Convenience method that generates embeddings and stores in one step.Expandable
datasources.embeddings
Use Case: Simplified workflow when you don’t need to inspect or cache embeddings.
QueryDatasource
Semantic search using a text query (embedding generated automatically).Expandable
datasources.query
Use Case: Standard semantic search - plugin provides text, system handles embedding.
QueryDatasourceByVector
Semantic search using a pre-computed embedding vector.Expandable
datasources.query
Use Case: Advanced workflows with custom query embeddings or hybrid search strategies.
Supported Vector Stores: the same stores as StoreDocuments.
Complete Custom Ingestion Example
Building a GitHub repository documentation ingestion plugin:Expandable
Datasource Configuration
For RAG APIs to work, datasources must be configured with: Embedder Configuration:EmbedVendor: Embedder provider ("openai","ollama","vertex","googleai")EmbedModel: Model name (for example,"text-embedding-3-small"for OpenAI or"nomic-embed-text"for Ollama)EmbedAPIKey: API key if required by embedderEmbedUrl: Embedder endpoint URL
DBSourceType: Vector store type ("pinecone","chroma","pgvector","qdrant","redis","weaviate")DBConnString: Connection URL for vector storeDBConnAPIKey: API key if requiredDBName: Collection/namespace/table name
EmbedModel to the model name, for example "text-embedding-3-small". Do not set it to the vendor name.
RAG Workflow Patterns
Pattern 1: Generate and Store Separately
Pattern 2: Process and Store in One Call
Pattern 3: Hybrid Search
Datasource Management APIs
For managing datasources programmatically:Expandable
datasources.read (list/get/search), datasources.write (create/update/delete)
Error Handling
Expandable
"datasource does not have embedder configured"- Set EmbedVendor/EmbedModel/EmbedAPIKey"datasource does not have vector store configured"- Set DBSourceType/DBConnString/DBName"failed to generate embeddings with openai/openai"- Set EmbedModel to the model name. Do not set it to the vendor."vector store connection failed"- Ensure vector store is running and accessible
Advanced Datasource Operations
These operations provide fine-grained control over vector store data through metadata filtering and namespace management.Delete Documents by Metadata
Delete specific documents from vector stores using metadata filters:Expandable
metadataFilter: map of metadata key-value pairs to matchfilterMode:"AND"(all conditions must match) or"OR"(any condition matches)dryRun: iftrue, returns count without deleting
datasources.write
Query by Metadata Only
Query documents using only metadata filters (no vector similarity):Expandable
metadataFilter: metadata key-value pairs to matchfilterMode:"AND"or"OR"limit: max results per page (1-100, default: 10)offset: pagination offset
datasources.query
List Namespaces
List all namespaces/collections in a vector store:datasources.read
Note: Document count may be -1 if not supported by the vector store.
Delete Namespace
Delete an entire namespace/collection (bulk operation):namespace: namespace/collection name to deleteconfirm: must betrueto proceed (safety check)
datasources.write
Warning: This is a destructive operation that deletes all documents in the namespace. Use with caution.
Supported Vector Stores:
- Chroma, PGVector, Pinecone and Weaviate support all these operations.
- Redis does not fully support delete and query by metadata.
- Qdrant supports namespace management only.