AI Retrieval
MariaDB Cloud AI Retrieval indexes your documents or your database in a knowledge base and returns relevant passages, rows, or generated answers through a REST API.
AI Retrieval is a managed retrieval-augmented generation (RAG) service that grounds AI and agentic applications in documents or data in MariaDB databases.
MariaDB Cloud AI Retrieval works over two kinds of data. For documents, it handles parsing, chunking, embeddings, managed vector storage, and reranking, and returns results through retrieval REST API. For data in a MariaDB database, it turns a natural-language question into SQL, runs it against the database, and returns the results also via retrieval REST API — with multi-turn follow-up requests.
Knowledge Base Types
Document knowledge base
Files such as PDF, Word, PowerPoint, Markdown, and HTML documents
You ask a question in natural language and receive the most relevant passages, or a generated answer.
Database knowledge base
Tables of an existing MariaDB service
You ask a question in natural language and receive the rows that answer it, or a generated answer.
For the details, see Document Knowledge Bases and Database Knowledge Bases.
How It Works

Document Knowledge Bases
You create a knowledge base. AI Retrieval stores its chunks and embeddings in a MariaDB service, the vector store. You can use an existing Provisioned or Serverless service, or let MariaDB Cloud provision a Serverless service for you.
You add documents by uploading files or by connecting an Amazon S3 or Google Cloud Storage bucket.
AI Retrieval parses each document, splits the text into chunks, creates an embedding for each chunk, and stores both in the vector store.
Your application sends a question to the knowledge base endpoint.
AI Retrieval searches the chunks, ranks them, and returns the best matches. For a generated answer, it passes the best chunks to a generation model, which writes the answer and cites the chunks that it used.
Database Knowledge Bases
You create a knowledge base from a schema of a MariaDB service.
AI Retrieval connects to the database, reads the tables and columns that the database user can see, and builds the semantic map: the metadata layer over the database, with the schema metadata (including indexes and column relations), generated table and column descriptions, and a column literals index. You do not need to do anything for this step. You can refine the semantic map later.
Your application sends a question to the knowledge base endpoint.
AI Retrieval uses the semantic map to turn the question into an SQL query, checks that the query only reads data, runs it, and returns the rows. For a generated answer, it writes the answer from the rows. A follow-up question in the same session can build on the earlier ones.
Key Concepts
Knowledge base
The searchable collection that you create and query. It has a type, a cloud region, and settings such as the models and the reranker.
Vector store
The MariaDB service, Provisioned or Serverless, that stores the chunks and embeddings of a document knowledge base.
Document
A file in a document knowledge base.
Data source
An Amazon S3 or Google Cloud Storage bucket that is connected to a document knowledge base.
And MariaDB database connected as a source to database knowledge base.
Chunk
A passage of a document. A retrieval request returns chunks.
Embedding
A list of numbers that represents the meaning of a chunk. AI Retrieval compares the embedding of a question with the embeddings of the chunks to find related text.
Sync
The action that ingests the new and changed files of a data source, or builds the semantic map of a database. AI Retrieval does not sync by itself.
Semantic map
The metadata layer built automatically over the source database: schema metadata (including indexes and column relations), generated table and column descriptions, and a column literals index.
Reranker
A model that re-scores the retrieved chunks.
Generation model
The LLM that writes an answer from the retrieved content.
API key
The credential that your application uses to call a knowledge base.
Retrieval Modes
Both knowledge base types offer two modes:
Retrieve
The most relevant chunks for the question
The SQL query that answers the question, and its rows
Retrieve & Generate
An answer that the generation model writes from the retrieved chunks, with citations to the chunks used
An answer in plain language, written from the query and its rows
A document knowledge base searches its chunks with one of three methods.
Hybrid (default)
Combines semantic and full-text search
Semantic
Matches the meaning of the question
Full text
Matches the keywords in the question
For a document knowledge base, Retrieve & Generate can stream the answer as it is generated. A database knowledge base can keep the context of a session, so that a follow-up question builds on the earlier ones. See Database Knowledge Bases.
Requirements and Availability
Document knowledge bases run on AWS, in the region that you select. Database knowledge bases are available in every region. See Supported Models, Formats, and Regions.
For a document knowledge base, the vector store must be a MariaDB service, Provisioned or Serverless, in the same cloud and region as the knowledge base, running MariaDB 11.8 or later. You can select an existing service or let MariaDB Cloud provision a new Serverless service.
For a database knowledge base, you need a MariaDB service with your data, a database user that can read it, and, if the service restricts connections with an IP allowlist, the AI Retrieval IP address in that allowlist. See Access and Security.
Your role decides what you can do with knowledge bases. See Access and Security.
You need an API key to call the REST API from an application. See Access and Security.
Supported Files and Limits
This applies to document knowledge bases. A document knowledge base accepts TXT, Markdown, HTML, JSON, Word (DOCX), PDF, and PowerPoint (PPTX) files. See Supported Models, Formats, and Regions.
Scanned documents, which are PDFs that contain only images of pages, and password-protected files are not supported yet. Images inside documents are skipped. Documents must be in English.
Quotas
AI Retrieval limits request rates, document sizes, and concurrent ingestion for each organization, and the MCUs that an organization can consume each month. See Service Quotas.
Known Limitations
All Knowledge Bases
AI Retrieval is not available for Bring Your Own Cloud (BYOC) organizations.
Document Knowledge Bases
Syncs are manual. AI Retrieval does not sync a bucket on a schedule, so run a sync whenever you add files to the bucket.
You cannot change the embedding model after you create the knowledge base.
Multi-turn queries are not supported. Each request is answered on its own.
Scanned documents and image documents are not supported yet.
Do not delete the vector store service of a knowledge base. If it is deleted, the knowledge base still shows Ready, but requests to it fail. Delete the knowledge base and create a new one.
If you restore the vector store service from a backup, or you change or delete its data directly, the knowledge base can fall out of step with the documents it lists. AI Retrieval does not detect this. Add the affected documents again to restore consistency.
If you remove a file from a bucket, AI Retrieval does not remove its document from the knowledge base. Delete the document in the knowledge base.
Deleting a knowledge base or a data source does not delete the chunks that it stored in the vector store service. Deleting a single document does delete its chunks.
Ingesting many large documents can take hours. A file that times out is retried once at the end of the sync. Run the sync again to ingest the files that still failed.
If you delete the MariaDB service that stores the vectors, the knowledge base still shows Ready, but requests to it fail.
Ingesting many documents into a vector store on a small Serverless instance can be slow or stall.
The document status in the portal can lag. A document can show Queued or Retrying while you can already retrieve its content. See Troubleshooting.
Next Steps
QuickstartDocument Knowledge BasesDatabase Knowledge BasesParsing and ChunkingSupported Models, Formats, and RegionsAccess and SecurityService QuotasUsage and BillingThis page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

