Key takeaways
- MariaDB Cloud AI Retrieval is a managed retrieval-augmented generation (RAG) service in MariaDB Cloud, now in Public Preview, that lets teams ship AI applications and agents without building or operating their own retrieval stack.
- A Document Knowledge Base turns documents such as PDF, DOCX, and PPTX into answers with citations, using managed parsing, chunking, embedding, hybrid search, and reranking.
- A Database Knowledge Base turns natural-language questions into read-only SQL against the MariaDB database, so operational data isn't copied into a separate vector store or warehouse.
- Developers query both knowledge base types through a simple REST API.
Teams asked to ship AI applications and agents fast often spend months building retrieval plumbing first, and still end up copying database data into a second system that has to be secured and kept in sync. MariaDB Cloud AI Retrieval, now in Public Preview, takes that work off your team: it’s a managed retrieval-augmented generation (RAG) service that grounds AI applications and agents in your documents and in the live data in your MariaDB databases, through a simple REST API.
Why retrieval is the hard part
Teams set out to ship an AI application and end up building retrieval plumbing instead. They usually hit three walls:
- Building the stack. A production document pipeline means choosing, hosting, and tuning a parser, a chunker, an embedding model, a vector store, hybrid search, and a reranker, then keeping all of it running highly available and scalable.
- Building it twice. When the application also needs operational data, documents aren’t enough. Teams need a separate Text-to-SQL pipeline, and the hard part is mapping the schema well enough to trust the answers.
- Copying the data. The common workaround is to copy database data into a vector store or warehouse. That copy needs its own security and a sync pipeline, and it drifts from the source of truth.
AI Retrieval removes all three: the pipelines are managed, both data types sit behind one service, and database questions run against the source.
What is MariaDB Cloud AI Retrieval?
MariaDB Cloud AI Retrieval is a managed RAG service. You create a knowledge base (KB), connect it to a source, and query it. There are two KB types, each backed by MariaDB:
| Document KB | Database KB | |
|---|---|---|
| Source | PDF, DOCX, PPTX, HTML, TXT, MD, JSON, uploaded directly or synced from object storage | A schema in a MariaDB Cloud database |
| How it retrieves | Hybrid vector and full-text search, then cross-encoder reranking | Natural language to validated, read-only SQL, run on the live database |
| What is stored | Chunks and embeddings, in a MariaDB database in your account | A semantic map of the schema; the data itself is not copied |
| Retrieve returns | Ranked chunks with source references | Rows, plus the generated SQL |
| Retrieve & Generate returns | An answer with inline citations to chunks | An answer grounded in the SQL result |
Use Retrieve when your own model or agent should reason over the context. Use Retrieve & Generate when you want AI Retrieval to call the LLM and return a grounded answer.
What MariaDB Cloud AI Retrieval changes for your team
For engineering and data leaders
- Faster time to market. Your engineers build the AI application, not the retrieval stack under it. A knowledge base is created in a few clicks, and the document processing and SQL generation behind it are managed.
- Less to operate. One managed service replaces a parser, a chunker, model provider integrations, a vector store, a reranker, and a Text-to-SQL pipeline, and keeps data in sync with sources. One vendor, one support contact.
- No second copy to secure. Database KB queries run against the source database under that database role’s permissions, so there is no warehouse or vector store copy to protect, audit, and keep in sync.
- One database for transactional data, JSON, and vectors. A Document KB stores its chunks and embeddings in a separate schema on an existing MariaDB Cloud database, next to your transactional tables and JSON documents. You run, secure, and back up one database instead of adding a separate vector store.
For AI builders
- Simple REST API for both sources. Call Retrieve to get ranked chunks or rows for your own model or agent, or Retrieve & Generate for a grounded answer.
- Works with your stack. Any framework or agent that can make HTTP requests can use AI Retrieval, with no SDKs or additional dependencies to install.
- Quality you can tune without code. Choose the parsing strategy, chunking strategy, and embedding model per knowledge base, and teach the Database KB your business terms with annotations and custom instructions.
- Answers you can verify. Document answers cite the chunks they came from, and Database KB responses include the SQL that produced the rows.
See MariaDB Cloud AI Retrieval in action
In this video, a Document KB over customer contracts and a Database KB over a live billing database answer the question every revenue team asks: which customers renew this quarter, and what do their contracts allow on price increases?
What teams can build with MariaDB Cloud AI Retrieval
- Support assistants. Answer customer questions from product manuals and help articles, and pull the customer’s orders, plan, or ticket history from the live database in the same conversation.
- Revenue and account workflows. Combine contract terms with billing and renewal data, as in the video, so account teams stop switching between two systems to answer one question.
- Self-serve data questions. Let people who don’t write SQL ask questions of operational data in plain English, with the generated SQL shown so an analyst can check it.
- Per-tenant knowledge in SaaS products. Give each of your customers an assistant over their own documents, with one knowledge base per tenant on a shared MariaDB service.
Document KB: from documents to accurate answers, stored in MariaDB
The Document KB runs the full pipeline for you, from ingesting and preparing documents to retrieving the most relevant passages at query time, with embeddings stored in the MariaDB database you already run.
- Ingestion that stays in sync. Upload files through the API or console, or sync from Amazon S3 or Google Cloud Storage with incremental sync.
- Tables and structure survive parsing. Layout-aware parsing keeps tables, headings, lists, and reading order in digital-source documents, so a pricing table or a contract clause reaches the model intact.
- Chunks keep their context. Structure-aware chunking keeps tables, code blocks, and formulas whole, and each chunk carries the heading path of the section it came from.
- Choice of embedding models. Cohere Embed 3 (English or Multilingual) and Cohere Embed 4 on Amazon Bedrock, or Gemini Embedding 2.
- Meaning and exact terms. Hybrid search combines vector search, which matches meaning, with full-text search, which matches exact terms such as SKUs, codes, and contract numbers.
- Only the most relevant context reaches the model. A cross-encoder reranker re-scores the top candidates before generation.
- Vector search in the database you already run. Point a Document KB at an existing MariaDB Cloud service. The knowledge base keeps its chunks and embeddings in a separate schema on that service, using MariaDB’s native VECTOR data type with a vector index.
- One vector store, many isolated knowledge bases. You can create multiple Document KBs on the same MariaDB service. Each keeps its chunks and embeddings in its own schema, and every retrieval request is scoped to a single knowledge base. That lets you isolate data per tenant, customer, or business unit without running a separate vector database for each.
Database KB: SQL you can trust over live data
Text-to-SQL is only useful if you can trust the SQL, and that gets harder on real schemas with hundreds of tables, cryptic column names, and business terms nobody wrote down. Ask for “churned accounts” without a definition, and the model has to guess. The Database KB builds that trust by understanding your schema, taking your business definitions, learning from use, and never changing your data.
- Understands your schema automatically. When you connect a schema, AI Retrieval reads its metadata, runs exploration queries, and builds a semantic layer: indexes and column relations, table and column descriptions, and an index of column values such as customer names and status codes.
- Gets better with use. Failed queries are remembered for similar questions, and column descriptions are updated when users explain what a column means.
- Takes your business context. Annotations let you include or exclude tables and columns and edit their descriptions. Custom instructions carry business rules, such as “revenue means net revenue after refunds.”
- Read-only by design. Generated SQL is validated as read-only and capped at a row limit. You can also get the SQL without running it.
- Follow-up questions. Pass a session key, and each question builds on the previous ones.
Calling MariaDB Cloud AI Retrieval from your application
Every knowledge base is queried with a simple REST call.
Ask a Database KB a question:
curl -X POST "$API_BASE/ai/v1/knowledge-bases/$KB_ID/retrieve-rows-and-generate" \
-H "X-API-Key: $MARIADB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "Which customers renew this quarter?",
"execute": true,
"max_rows": 20
}'
The response returns the generated sql, the result rows (col_keys and data, with a truncated flag when the row limit cuts results off), and the grounded answer. It also returns a session_key which you can pass with the next request to ask a follow-up in the same context.
Ask a Document KB, with hybrid search, reranking, and the LLM used for generation (Document KB requests go to the regional endpoint of the knowledge base’s AWS region):
curl -X POST "$REGION_API_BASE/ai/v1/knowledge-bases/$KB_ID/retrieve-chunks-and-generate" \
-H "X-API-Key: $MARIADB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enable_rerank": true,
"query": "What does Globex's contract allow on price increases at renewal?",
"retrieval_method": "hybrid",
"top_k": 30,
"llm_provider": "bedrock",
"llm_model": "anthropic.claude-sonnet-5",
"temperature": 0.3,
"top_p": 1,
"max_tokens": 8192
}'
The response returns the answer plus a citations array; each citation carries the chunk_id, document_id, document_name, and chunk_text.
Data residency and security
Adding AI to your applications shouldn’t create a new copy of your data or a new security perimeter to build.
- Documents are processed in the region you choose. Parsing, chunking, embedding, and reranking run in the AWS region of the knowledge base. Chunks and embeddings are stored in a MariaDB database in your own MariaDB Cloud account in the same region, not in a shared index, so you control access to them like any other database.
- No copy of your operational data. A Database KB doesn’t replicate your database into a vector store or warehouse. It runs SQL at query time and works only with the result rows, capped by a row limit.
- Your database permissions are the boundary. The Database KB connects with the credentials you provide and sees only what that database role can see, and generated SQL is validated as read-only before it runs.
Get started with MariaDB Cloud AI Retrieval
The context your AI needs already lives in your documents and your MariaDB databases. MariaDB Cloud AI Retrieval grounds AI applications in both, so your engineers ship the application instead of a retrieval stack, with no copy of your data to maintain.
To try it, sign in to MariaDB Cloud, open AI Retrieval (Public Preview) in the left navigation, and select Create Knowledge Base. The AI Retrieval documentation walks through both KB types and the API.
Document KBs are available on AWS in US East (N. Virginia), Europe (London), Europe (Frankfurt), and Asia Pacific (Singapore).
Frequently Asked Questions
Teams delivering AI applications and agents that need grounded answers from documents, MariaDB data, or both. Engineering and data leaders use it to shorten time to market and avoid a second copy of their data; AI builders call its REST API from any framework.
Yes. MariaDB stores embeddings in a native VECTOR data type with a vector index, alongside your transactional tables. A Document KB can use an existing MariaDB Cloud service as its vector store; for heavy ingestion or query volume, size that service for both workloads or give the knowledge base a dedicated one.
Yes. Create a Document KB per tenant on the same MariaDB service. Each knowledge base stores its data in its own schema, and each retrieval request targets one knowledge base by ID, so one tenant’s documents aren’t returned for another tenant’s queries. Your application maps each tenant to its knowledge base.
No. A Database KB stores a semantic map of the schema and runs read-only SQL against the live database at query time. A Document KB stores document chunks and embeddings in a MariaDB database in your own MariaDB Cloud account.
No. Generated SQL is validated as read-only before it runs, and results are capped by a row limit.
PDF, DOCX, PPTX, HTML, TXT, Markdown, and JSON. Layout-aware parsing preserves tables, headings, lists, and reading order in digital-source documents.
Yes. The Retrieve call returns ranked chunks or rows without generation, so any model or framework that can make an HTTP request can use them. Retrieve & Generate calls the LLM for you, with the model set per request.
During Public Preview, every MariaDB Cloud account gets a free allowance of 100 MariaDB Compute Units (MCUs) per month for AI Retrieval, enough to evaluate both Document KBs and Database KBs.
