> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/mariadb-cloud/cloud-ai/ai-retrieval/quickstart.md).

# Quickstart

Create a document knowledge base or a database knowledge base in MariaDB Cloud AI Retrieval with the default settings, and run your first query.

This quickstart creates a knowledge base with the default settings and runs a first query. It has two sections: one for a document knowledge base, which answers questions about files that you upload, and one for a database knowledge base, which answers questions about the data in a MariaDB service. For every option and the reasons behind the defaults, see [Document Knowledge Bases](https://mariadb.com/docs/mariadb-cloud/cloud-ai/ai-retrieval/document-knowledge-bases.md) and the other pages in this section.

## Before You Begin

* You need a MariaDB Cloud account and a role that can create knowledge bases. The Viewer role cannot.
* Knowledge bases run on AWS.

## Create a Document Knowledge Base

1. In the portal, select **AI Retrieval** in the navigation, and then **Create Knowledge Base**.
2. For **Type**, select **Document Knowledge Base**.
3. Enter a **Name**.
4. Leave **AWS** and the region as they are.
5. Under **Vector Store Configuration**, select **Auto-provision new service**. MariaDB Cloud creates a MariaDB Serverless service to store the vectors. To use an existing Provisioned or Serverless service instead, select **Use existing service**.
6. Select **Create Knowledge Base**.

<figure><img src="https://3360768873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvPz15Lz0Iw3P3yKR3Prd%2Fuploads%2Fgit-blob-86d2d3b4160258494d9e34bc0e83d74b8f574dda%2Fai-retrieval-quickstart-create.png?alt=media" alt="The Create Knowledge Base form with Document Knowledge Base, the name quickstart-docs, AWS in Frankfurt, and Auto-provision new service selected."><figcaption><p>The Create Knowledge Base form with the default settings</p></figcaption></figure>

The knowledge base shows the status **Provisioning**. This usually takes a few minutes.

<figure><img src="https://3360768873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvPz15Lz0Iw3P3yKR3Prd%2Fuploads%2Fgit-blob-fec5893cb7b82cdc031dc4102e85fab6ac137c71%2Fai-retrieval-quickstart-provisioning.png?alt=media" alt="The page of the knowledge base quickstart-docs with the Provisioning status and the banner that says that the knowledge base is being provisioned."><figcaption><p>A knowledge base that is being provisioned</p></figcaption></figure>

When the status is \*\*Ready\*\*, the knowledge base is ready for documents.

The knowledge base uses the default embedding model and generation model, and the reranker is on. You do not need to change them to continue.

### Upload a Document

1. On the knowledge base page, select **Upload Documents**.
2. Select a file, such as a PDF, a Word document, or a Markdown file, and select **Next**. A file can be up to 50 MB.
3. Leave the parsing and chunking options as they are, and select **Upload**.

<figure><img src="https://3360768873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvPz15Lz0Iw3P3yKR3Prd%2Fuploads%2Fgit-blob-336cedbd8e08d4f3204759a3c28a4395f62ee700%2Fai-retrieval-upload-files.png?alt=media" alt="The Files step of the Upload Files dialog with three files selected."><figcaption><p>The Files step of the Upload Files dialog</p></figcaption></figure>

The document appears in the **Documents** list. Wait until its status is **Ingested**. The **Chunks** column then shows how many chunks the document produced.

<figure><img src="https://3360768873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvPz15Lz0Iw3P3yKR3Prd%2Fuploads%2Fgit-blob-4da38a1dfadb02db07055e7cd1788948a5616c6a%2Fai-retrieval-quickstart-ingested.png?alt=media" alt="The page of the Ready knowledge base quickstart-docs, with the vector store quickstart-docs-vs and a Documents list that shows the file getting-started.md with the status Ingested and 4 chunks."><figcaption><p>A document with the status Ingested</p></figcaption></figure>

### Run a Query

1. Select **Test**.
2. On the **Retrieve & Generate** tab, enter a question about your document, and select **Test Query**.

The answer cites the chunks of your document that it uses. The **Retrieve** tab shows the matching chunks without a generated answer.

<figure><img src="https://3360768873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvPz15Lz0Iw3P3yKR3Prd%2Fuploads%2Fgit-blob-386ca8aeebc50a14e7e5b495f567565e5a5d2235%2Fai-retrieval-quickstart-answer.png?alt=media" alt="The Test Knowledge Base drawer on the Retrieve and Generate tab with the question How do I create my first widget and a generated answer that ends with the citation marker 1."><figcaption><p>A generated answer with a citation</p></figcaption></figure>

To call the knowledge base from an application, see [Connect Your Application](https://mariadb.com/docs/mariadb-cloud/cloud-ai/ai-retrieval/document-knowledge-bases.md#connect-your-application).

## Create a Database Knowledge Base

A database knowledge base reads the tables of a MariaDB service that already holds your data.

1. Select **AI Retrieval** in the navigation, and then **Create Knowledge Base**.
2. For **Type**, select **Database Knowledge Base**.
3. Enter a **Name**.
4. Under **Datasource**, select your service. The hostname, the port, and the credentials of the service are filled in, and you can change them.
5. Select **Fetch schemas**, and select the **Schema** that holds your tables. If the list is empty, enter the schema name.
6. Under **Tables**, all tables of the schema are included. Clear the check box of a table to leave it out, or expand a table to leave out some of its columns.
7. Select **Create Knowledge Base**.
8. AI Retrieval connects to the database and builds the semantic map automatically, from the tables that the user can see. You do not need to do anything. Wait until the knowledge base shows **Ready**.
9. Select **Test**, and ask a question about your data.

<figure><img src="https://3360768873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvPz15Lz0Iw3P3yKR3Prd%2Fuploads%2Fgit-blob-5a98a4b2b68b78bda95857eca0962055531c404b%2Fai-retrieval-database-create.png?alt=media" alt="The Create Knowledge Base form with Database Knowledge Base selected, the service docs-demo, the schema shop, and its four tables listed."><figcaption><p>The Create Knowledge Base form for a database knowledge base</p></figcaption></figure>

<figure><img src="https://3360768873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvPz15Lz0Iw3P3yKR3Prd%2Fuploads%2Fgit-blob-b3f91ef7cfc4878da3bb018da670fe5064de7ae7%2Fai-retrieval-database-kb-ready.png?alt=media" alt="The page of a Ready database knowledge base, with its data source, the statistics of 4 tables, 16 columns, and 0 golden queries, and the Schema Annotations table that lists the tables orders, customers, order_items, and products, each with the status Retrievable."><figcaption><p>A Ready database knowledge base</p></figcaption></figure>

<figure><img src="https://3360768873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvPz15Lz0Iw3P3yKR3Prd%2Fuploads%2Fgit-blob-255993b58109b65c7f42bddd92b506af865089a2%2Fai-retrieval-database-test.png?alt=media" alt="The Test Knowledge Base drawer of a database knowledge base on the Retrieve tab, with the question Which customer ordered the most widgets, the generated SQL query, and one row with the columns customer_id, name, and widget_quantity."><figcaption><p>The Test drawer with the generated SQL and the rows that it returned</p></figcaption></figure>

For access requirements, such as the IP allowlist and restricting what the knowledge base can read, see [Access and Security](https://mariadb.com/docs/mariadb-cloud/cloud-ai/ai-retrieval/access-and-security.md).

## Next Steps

{% content-ref url="/pages/VvBZ0j71jH4il7tRtaBk" %}
[Document Knowledge Bases](https://mariadb.com/docs/mariadb-cloud/cloud-ai/ai-retrieval/document-knowledge-bases.md)
{% endcontent-ref %}

{% content-ref url="/pages/rT2vQYiKccvZHE65CdPQ" %}
[Parsing and Chunking](https://mariadb.com/docs/mariadb-cloud/cloud-ai/ai-retrieval/parsing-and-chunking.md)
{% endcontent-ref %}

{% content-ref url="/pages/P8jIKgH1GRY4u4S0mHqc" %}
[Access and Security](https://mariadb.com/docs/mariadb-cloud/cloud-ai/ai-retrieval/access-and-security.md)
{% endcontent-ref %}

<sub>*This page is: Copyright © 2026 MariaDB. All rights reserved.*</sub>

{% @marketo/form formId="4316" %}
