MariaDB AI RAG hands-on
Table of contents
Preamble
MariaDB corporation has released a ALL-In-One paid product to manage your Retrieval Augmented Generation (RAG) needs called MariaDB AI RAG. As we have a support contract with MariaDB corporation for our MariaDB databases I have been able to get a 30 days free trial key for the product…
I have already tested RAG with my Virtual DBA application so I thought it would be a good idea to see if this product could do (almost) the same. They have released it only as container and still only with Docker Engine (the free version), no podman yet. Fortunately we have already done the basic of setting up Docker Engine in a previous post about MariaDB Enterprise Manager and I’m starting from this setup.
I obviously plan to test on the same set of documents, at least on the database part of this repository, I have done for my Virtual DBA application and will git clone the Oracle Skills repository.
To have the same free spirit of my Virtual DBA application I have initially plan to use Ollama that is running on my desktop but due to a bug in the container (feature is still beta) I had to fallback to a free Gemini API key. The MariaDB AI RAG container will run on a virtual machine with 4 cores and 8GB of memory and Oracle Linux 9.8. The backend database will be MariaDB 12.3.2 running on a RedHat 9.8 Linux server.
The MariaDB AI RAG is not yet ready in production and I have experienced it during my testing as I had plenty of bugs… Overall the solution is cool as it automate all the task I have done in Python while creating my Virtual DBA application so if you don’t want to have your hands dirty then give it a try !
MariaDB AI RAG configuration
You need an account and a dedicated database on your MariaDB database server:
MariaDB [(none)]> create database rag_db character set utf8mb4 collate utf8mb4_general_ci; Query OK, 1 row affected (0.013 sec) MariaDB [(none)]> create user raguser@'%' identified by 'secure_password'; Query OK, 0 rows affected (0.002 sec) MariaDB [(none)]> grant all on rag_db.* to raguser@'%'; Query OK, 0 rows affected (0.002 sec) MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.017 sec)
On my MariaDB AI RAG virtual machine I create a dedicated /mariadb mount point:
[root@server03 ~]# lvcreate --name lvol02 --size 10g vg00
Logical volume "lvol02" created.
[root@server03 ~]# mkfs -t xfs /dev/vg00/lvol02
meta-data=/dev/vg00/lvol02 isize=512 agcount=4, agsize=655360 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1 bigtime=1 inobtcount=1 nrext64=0
= exchange=0
data = bsize=4096 blocks=2621440, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1, parent=0
log =internal log bsize=4096 blocks=16384, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@server03 ~]# tail -n 1 /etc/fstab
/dev/mapper/vg00-lvol02 /mariadb xfs defaults 0 0
[root@server03 ~]# mkdir /mariadb
[root@server03 ~]# mount -a
mount: (hint) your fstab has been modified, but systemd still uses
the old version; use 'systemctl daemon-reload' to reload.
[root@server03 ~]# systemctl daemon-reload
[root@server03 ~]# df -h /mariadb
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg00-lvol02 10G 104M 9.9G 2% /mariadb
[root@server03 ~]# chown mariadb:dba /mariadb
I create (as mariadb account) the suggested filesystems in official documentation:
[mariadb@server03 ~]$ cd /mariadb/ [mariadb@server03 mariadb]$ mkdir uploaded_files [mariadb@server03 mariadb]$ mkdir logs [mariadb@server03 mariadb]$ ll total 0 drwxr-xr-x 2 mariadb dba 6 Jul 30 14:36 logs drwxr-xr-x 2 mariadb dba 6 Jul 30 14:36 uploaded_files
As suggested I generate the secret keys to be put in configuration file with:
[mariadb@server03 ~]# openssl rand -hex 32 018a08ae88ef28e061bc73f89e4f6787e715f385ee77e6447defe34889f25b91 [mariadb@server03 ~]# openssl rand -hex 32 80051574a3596c4b9e7628c5ba91d2bc1c8b67652619f39958008db22027fa15 [mariadb@server03 ~]# openssl rand -hex 32 2f72ed611d25ff466441d429bd3780588a32c543e0e3253d52d513b720ae381a
Generate a MariaDB AI RAG trial key (30 days free) on support portal:

Last but not least tune the config.env template file to match your environment. I did not customized it widely at least fill the MARIADB_LICENSE_KEY and I configured the LLM configuration to reach my local Ollama that is running on my desktop (that is also running the MariaDB AI AG virtual machine). So the 192.168.56.1 IP address. As well as a local embedding configuration to totally avoid using paid AI API:
# License key MARIADB_LICENSE_KEY=<your_mariadb_license_key_from_above> # LLM Configuration LLM_PROVIDER=ollama LLM_MODEL=gemma4:latest OLLAMA_HOST=http://192.168.56.1:11434 # Embedding Configuration EMBEDDING_PROVIDER=huggingface EMBEDDING_MODEL=BAAI/bge-base-en-v1.5
I changed ADMIN_EMAIL and ADMIN_PASSWORD to be able to connect to MariaDB AI RAG API and changed the database configuration to reach my test MariaDB 12.3.2 database:
# Database Configuration DB_HOST=192.168.56.201 DB_PORT=3316 DB_USER=raguser DB_PASSWORD=secure_password DB_NAME=rag_db DB_SSL_ENABLED=true
I fed the security keys that I generated with OepnSSL:
# Security Keys SECRET_KEY=018a08ae88ef28e061bc73f89e4f6787e715f385ee77e6447defe34889f25b91 JWT_SECRET_KEY=80051574a3596c4b9e7628c5ba91d2bc1c8b67652619f39958008db22027fa15 MCP_AUTH_SECRET_KEY=2f72ed611d25ff466441d429bd3780588a32c543e0e3253d52d513b720ae381a
And I configured the link between the different containers:
# Server Ports APP_HOST=rag-api APP_PORT=8000 MCP_HOST=mcp-server MCP_PORT=8002 MCP_MARIADB_HOST=mariadb MCP_MARIADB_PORT=3316
The rest of the config.env file has not been touched…
Finally I clone the Oracle Skills on my Windows desktop as the philosophy is to use MariaDB AI RAG as a service through a REST API. So in a Powershell command line with git SCM:
PS D:\Download> $env:https_proxy='http://proxy_user:proxy_password@proxy_server:proxy_port' PS D:\Download> git clone https://github.com/oracle/skills.git Cloning into 'skills'... remote: Enumerating objects: 3007, done. remote: Counting objects: 100% (380/380), done. remote: Compressing objects: 100% (148/148), done. remote: Total 3007 (delta 280), reused 235 (delta 232), pack-reused 2627 (from 1) Receiving objects: 100% (3007/3007), 2.73 MiB | 10.32 MiB/s, done. Resolving deltas: 100% (1514/1514), done. Updating files: 100% (1083/1083), done. PS D:\Download> cd .\skills\ PS D:\Download\skills> ll Directory: D:\Download\skills Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 31/07/2026 11:39 .claude-plugin d---- 31/07/2026 11:39 .github d---- 31/07/2026 11:39 apex d---- 31/07/2026 11:39 db d---- 31/07/2026 11:39 fusion d---- 31/07/2026 11:39 graal d---- 31/07/2026 11:39 oci -a--- 31/07/2026 11:39 60 .gitignore -a--- 31/07/2026 11:39 2182 CONTRIBUTING.md -a--- 31/07/2026 11:39 1874 LICENSE.txt -a--- 31/07/2026 11:39 5432 README.md -a--- 31/07/2026 11:39 1773 SECURITY.md -a--- 31/07/2026 11:39 5834 SKILL_AUTHORING_GUIDE.md
MariaDB AI RAG deployment
With all the setting above it’s now time to launch the docker compose command:
[mariadb@server03 mariadb]$ docker compose -f docker-compose.yml --env-file config.env up -d WARN[0000] The "VOYAGE_API_KEY" variable is not set. Defaulting to a blank string. WARN[0000] The "OPENAI_API_KEY" variable is not set. Defaulting to a blank string. WARN[0000] The "GEMINI_API_KEY" variable is not set. Defaulting to a blank string. WARN[0000] The "COHERE_API_KEY" variable is not set. Defaulting to a blank string. WARN[0000] The "COHERE_API_KEY" variable is not set. Defaulting to a blank string. WARN[0000] The "OPENAI_API_KEY" variable is not set. Defaulting to a blank string. WARN[0000] The "GEMINI_API_KEY" variable is not set. Defaulting to a blank string. WARN[0000] The "VOYAGE_API_KEY" variable is not set. Defaulting to a blank string. WARN[0000] The "COHERE_API_KEY" variable is not set. Defaulting to a blank string. WARN[0000] The "VOYAGE_API_KEY" variable is not set. Defaulting to a blank string. WARN[0000] The "GEMINI_API_KEY" variable is not set. Defaulting to a blank string. WARN[0000] The "OPENAI_API_KEY" variable is not set. Defaulting to a blank string. [+] up 60/60 ✔ Image mariadb/ai-rag:docling-ray Pulled 448.1s ✔ Image mariadb:11.8 Pulled 48.5s ✔ Image redis:7-alpine Pulled 14.9s ✔ Image mariadb/ai-rag:celery-worker-runtime Pulled 292.1s ✔ Image mariadb/ai-rag:mcp-server-runtime Pulled 258.4s ✔ Image mariadb/ai-rag:rag-api-runtime Pulled 285.0s ✔ Container rag-docling-ray Healthy 24.2s ✔ Container rag-redis Healthy 24.2s ✔ Container rag-mariadb Healthy 24.2s ✘ Container rag-api Error dependency rag-api failed to start 41.0s ✔ Container rag-mcp-server Created 0.2s ✔ Container rag-celery-worker Created 0.2s dependency failed to start: container rag-api is unhealthy
The rag-api container is not able to start, in fact it kept trying to restart forever. Check the log with:
[mariadb@server03 mariadb]$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f39147fdb510 mariadb/ai-rag:celery-worker-runtime "/bin/sh -c '/app/ce…" 16 minutes ago Created rag-celery-worker 1287dc24ea7d mariadb/ai-rag:mcp-server-runtime "/app/mcp-server-dis…" 16 minutes ago Created rag-mcp-server d0fb2ee00681 mariadb/ai-rag:rag-api-runtime "/app/rag-api-dist/r…" 16 minutes ago Restarting (1) 35 seconds ago rag-api d53ae36e80bb redis:7-alpine "docker-entrypoint.s…" 16 minutes ago Up 16 minutes (healthy) 0.0.0.0:6379->6379/tcp, [::]:6379->6379/tcp rag-redis 248bd1082dc6 mariadb:11.8 "docker-entrypoint.s…" 16 minutes ago Up 16 minutes (healthy) 0.0.0.0:3316->3306/tcp, [::]:3316->3306/tcp rag-mariadb 5b806c1478b7 mariadb/ai-rag:docling-ray "python main.py" 16 minutes ago Up 16 minutes (healthy) 8003/tcp, 8265/tcp rag-docling-ray [mariadb@server03 mariadb]$ docker logs d0fb2ee00681 2026-08-11 08:16:08,349 - RAGAPIController - INFO - [CONFIG] Configuration mode detected: standalone 2026-08-11 08:16:08,349 - RAGAPIController - INFO - [STANDALONE] Setting up Standalone mode (environment variables only) 2026-08-11 08:16:08,864 - LicenseManager - INFO - Attempting to fetch key online... 2026-08-11 08:16:09,204 - LicenseManager - WARNING - Online key fetch failed: Fail to fetch data from the url, err: "<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1016)>" 2026-08-11 08:16:09,211 - LicenseManager - ERROR - License invalid: Signing key 98264472-32fc-4db8-90f8-7130eeb6418b could not be found locally or online. FATAL: License Check Failed for RAG API. Signing key 98264472-32fc-4db8-90f8-7130eeb6418b could not be found locally or online. . .
You can also use:
[mariadb@server03 mariadb]$ docker inspect d0fb2ee00681
So the container is trying to connect on internet to validate the license key but the ZScaler certificates of our internet control solution are not in the container…
In this situation the good strategy would be to duplicate the rag-api image, copy the required certificate inside the image and update the certificate. Let’s check first of what is made this RAG API image (docker images for the list of downloaded images):
[mariadb@server03 mariadb]$ docker run --rm -it --entrypoint /bin/bash mariadb/ai-rag:rag-api-runtime root@cbc406807d64:/app# cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" root@cbc406807d64:/app# ls -l /usr/local/share/ca-certificates total 0 root@cbc406807d64:/app# update-ca-certificates Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d... done.
As it is a one time trial I have decided to try to push my certificates directly inside the container. I stop the container first (I initially forbid the autorestart with docker update –restart=no d0fb2ee00681 but this is not required at the end):
[mariadb@server03 mariadb]$ docker stop d0fb2ee00681 d0fb2ee00681 [mariadb@server03 mariadb]$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f39147fdb510 mariadb/ai-rag:celery-worker-runtime "/bin/sh -c '/app/ce…" 32 minutes ago Created rag-celery-worker 1287dc24ea7d mariadb/ai-rag:mcp-server-runtime "/app/mcp-server-dis…" 32 minutes ago Created rag-mcp-server d0fb2ee00681 mariadb/ai-rag:rag-api-runtime "/app/rag-api-dist/r…" 32 minutes ago Exited (1) 49 seconds ago rag-api d53ae36e80bb redis:7-alpine "docker-entrypoint.s…" 32 minutes ago Up 32 minutes (healthy) 0.0.0.0:6379->6379/tcp, [::]:6379->6379/tcp rag-redis 248bd1082dc6 mariadb:11.8 "docker-entrypoint.s…" 32 minutes ago Up 32 minutes (healthy) 0.0.0.0:3316->3306/tcp, [::]:3316->3306/tcp rag-mariadb 5b806c1478b7 mariadb/ai-rag:docling-ray "python main.py" 32 minutes ago Up 32 minutes (healthy) 8003/tcp, 8265/tcp rag-docling-ray
I copy the certificates to the right location inside the container with (I noticed the update-ca-certificates Debian command does not accept file containing multiple certificate so avoid clubbing multiple in same files):
[mariadb@server03 mariadb]$ docker cp /mariadb/root_CA1.crt d0fb2ee00681:/usr/local/share/ca-certificates/ Successfully copied 2.22kB (transferred 4.1kB) to d0fb2ee00681:/usr/local/share/ca-certificates/
Then I tried to restart and manually update the certificate but I got ejected before the command completed:
[mariadb@server03 mariadb]$ docker start d0fb2ee00681 16f001226061 [mariadb@server03 mariadb]$ docker exec -it d0fb2ee00681 /bin/sh # update-ca-certificates Updating certificates in /etc/ssl/certs...
So used this trick to have the job done:
[mariadb@server03 mariadb]$ docker stop d0fb2ee00681; docker start d0fb2ee00681; docker exec -it d0fb2ee00681 update-ca-certificates 16f001226061 Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d... done.
And voilà:
[mariadb@server03 mariadb]$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1a0eada743ef mariadb/ai-rag:celery-worker-runtime "/bin/sh -c '/app/ce…" About an hour ago Created rag-celery-worker e0acb4fb2f98 mariadb/ai-rag:mcp-server-runtime "/app/mcp-server-dis…" About an hour ago Created rag-mcp-server 16f001226061 mariadb/ai-rag:rag-api-runtime "/app/rag-api-dist/r…" About an hour ago Up 3 minutes (healthy) 0.0.0.0:8000->8000/tcp, [::]:8000->8000/tcp rag-api 9d68d5f48bce redis:7-alpine "docker-entrypoint.s…" About an hour ago Up 30 minutes (healthy) 0.0.0.0:6379->6379/tcp, [::]:6379->6379/tcp rag-redis 703ece2e1ae3 mariadb:11.8 "docker-entrypoint.s…" About an hour ago Up 30 minutes (healthy) 0.0.0.0:3316->3306/tcp, [::]:3316->3306/tcp rag-mariadb 2c8c26f3db52 mariadb/ai-rag:docling-ray "python main.py" About an hour ago Up 30 minutes (healthy) 8003/tcp, 8265/tcp rag-docling-ray
To confirm it’s working you can go to the VM IP address on port 8000 to see if you get the Swagger UI REST API documentation:

I noticed two container where only in CREATED state, so I started them manually with:
[mariadb@server03 mariadb]$ docker start 1287dc24ea7d 1287dc24ea7d [mariadb@server03 mariadb]$ docker start f39147fdb510 f39147fdb510 [mariadb@server03 mariadb]$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f39147fdb510 mariadb/ai-rag:celery-worker-runtime "/bin/sh -c '/app/ce…" 57 minutes ago Restarting (1) 19 seconds ago rag-celery-worker 1287dc24ea7d mariadb/ai-rag:mcp-server-runtime "/app/mcp-server-dis…" 57 minutes ago Up 4 minutes 0.0.0.0:8002->8002/tcp, [::]:8002->8002/tcp rag-mcp-server d0fb2ee00681 mariadb/ai-rag:rag-api-runtime "/app/rag-api-dist/r…" 57 minutes ago Up 15 minutes (healthy) 0.0.0.0:8000->8000/tcp, [::]:8000->8000/tcp rag-api d53ae36e80bb redis:7-alpine "docker-entrypoint.s…" 57 minutes ago Up 57 minutes (healthy) 0.0.0.0:6379->6379/tcp, [::]:6379->6379/tcp rag-redis 248bd1082dc6 mariadb:11.8 "docker-entrypoint.s…" 57 minutes ago Up 57 minutes (healthy) 0.0.0.0:3316->3306/tcp, [::]:3316->3306/tcp rag-mariadb 5b806c1478b7 mariadb/ai-rag:docling-ray "python main.py" 57 minutes ago Up 57 minutes (healthy) 8003/tcp, 8265/tcp rag-docling-ray
And same certificate error for ai-rag:celery-worker-runtime container:
[mariadb@server03 mariadb]$ docker logs f39147fdb510 INFO:LicenseManager:Attempting to fetch key online... WARNING:LicenseManager:Online key fetch failed: Fail to fetch data from the url, err: "<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1016)>" ERROR:LicenseManager:License invalid: Signing key 98264472-32fc-4db8-90f8-7130eeb6418b could not be found locally or online. FATAL: License Check Failed for Celery Worker. Signing key 98264472-32fc-4db8-90f8-7130eeb6418b could not be found locally or online.
So applied the same certificate tricks we have seen above… But this time it did not solve the issue I still had (docker logs):
INFO:LicenseManager:Skipping activation (Offline/Network Error): HTTPSConnectionPool(host='customers.mariadb.com', port=443): Max retries exceeded with url: /license/activated/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1016)'))) . 10:19:11 - LiteLLM:WARNING: logging_utils.py:94 - LiteLLM: Failed to fetch remote model cost map from https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1016). Falling back to local backup. . WARNING: Failed to load rerankers model: HTTPSConnectionPool(host='us.aws.cdn.hf.co', port=443): Max retries exceeded with url: /xet-bridge-us/65f8780bf7e710c3ae9b1777/1f64da558773edbe16102a78d1cb8d1c1c013f0924259e3f67b2802e3b9562dc ?user_id=public&X-Xet-Cas-Uid=public&response-content-disposition=inline%3B+filename*%3DUTF-8%27%27ms-marco-MiniLM-L-12-v2.zip%3B+filename%3D%22ms-marco-MiniLM-L-12-v2.zip%22%3B&response-content-type=application%2Fzip&Expires=1786447159& Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly91cy5hd3MuY2RuLmhmLmNvL3hlMTItdjIuemlwJTIyJTNCJnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1hcHBsaWNhdGlvbiUyRnppcCIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiRXBvY2hUaW1lIjoxNzg2NDQ3MTU5fX19XX0_& Signature=MEQCIGtGv5y1kEPBbq2TC1-QszGJysm~IPBjf21vUD7ADvg__&Key-Pair-Id=01KXEF4KZ1B6FV465MAWR4M21F (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1016)'))). Falling back to sentence-transformers. .
You can also try to run the application inside the container getting the complete command with:
[mariadb@server03 mariadb]# docker ps -a --no-trunc --format 'table {{.Names}}\t{{.Command}}'
NAMES COMMAND
rag-celery-worker "/bin/sh -c '/app/celery-worker-dist/celery-worker --pool ${CELERY_POOL} --concurrency ${CELERY_WORKER_CONCURRENCY} --prefetch-multiplier ${CELERY_WORKER_PREFETCH_MULTIPLIER} --max-tasks-per-child ${CELERY_WORKER_MAX_TASKS_PER_CHILD} --queues default,ingestion,chunking,high_priority --loglevel info'"
rag-mcp-server "/app/mcp-server-dist/mcp-server"
rag-api "/app/rag-api-dist/rag-api"
rag-redis "docker-entrypoint.sh redis-server --appendonly yes --appendfsync everysec"
rag-mariadb "docker-entrypoint.sh mariadbd"
rag-docling-ray "python main.py"
Which is Python (requests/urllib3) error, I could temporarily solve the error and try to rerun the application inside the container with those three environment variables:
export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
But it is not possible to “inject” those environment variables inside the docker container. So I had to fallback to what I wanted to avoid, means recreating the containers and by same time modify the official MariaDB images to inject my root certificate. In fact make a copy of the official image and inject in them my root certificate… At the end it created a nice configuration ready for future update of MariaDB official images with a fully automatic process:
I have this Dockerfile.ca file:
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
USER root
COPY certs/root_CA1.crt /usr/local/share/ca-certificates/root_CA1.crt
RUN update-ca-certificates
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt \
REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \
CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
This docker-compose.override.yml file (of course you could avoid injecting your proxy root certificate in all containers but just to be future prof I have done it for all):
x-ca-env: &ca-env
SSL_CERT_FILE: "/etc/ssl/certs/ca-certificates.crt"
REQUESTS_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt"
CURL_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt"
services:
rag-api:
build:
context: .
dockerfile: Dockerfile.ca
args:
BASE_IMAGE: mariadb/ai-rag:rag-api-runtime
image: local/ai-rag:rag-api-runtime-ca
environment:
SSL_CERT_FILE: "/etc/ssl/certs/ca-certificates.crt"
REQUESTS_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt"
CURL_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt"
celery-worker:
build:
context: .
dockerfile: Dockerfile.ca
args:
BASE_IMAGE: mariadb/ai-rag:celery-worker-runtime
image: local/ai-rag:celery-worker-runtime-ca
environment:
SSL_CERT_FILE: "/etc/ssl/certs/ca-certificates.crt"
REQUESTS_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt"
CURL_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt"
mcp-server:
build:
context: .
dockerfile: Dockerfile.ca
args:
BASE_IMAGE: mariadb/ai-rag:mcp-server-runtime
image: local/ai-rag:mcp-server-runtime-ca
environment:
SSL_CERT_FILE: "/etc/ssl/certs/ca-certificates.crt"
REQUESTS_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt"
CURL_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt"
docling-ray:
build:
context: .
dockerfile: Dockerfile.ca
args:
BASE_IMAGE: mariadb/ai-rag:docling-ray
image: local/ai-rag:docling-ray-ca
environment:
SSL_CERT_FILE: "/etc/ssl/certs/ca-certificates.crt"
REQUESTS_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt"
CURL_CA_BUNDLE: "/etc/ssl/certs/ca-certificates.crt"
And finally I stop (docker stop) and remove (docker rm) all the containers and recreate everything with:
docker compose -f docker-compose.yml -f docker-compose.override.yml --env-file config.env up -d
All the self signed certificate errors have gone but the container stay unhealthy:
[mariadb@server03 mariadb]$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ed3d71d47616 local/ai-rag:celery-worker-runtime-ca "/bin/sh -c '/app/ce…" 20 minutes ago Up 13 minutes (unhealthy) rag-celery-worker 1c6a364f9ffd local/ai-rag:mcp-server-runtime-ca "/app/mcp-server-dis…" 20 minutes ago Up 13 minutes 0.0.0.0:8002->8002/tcp, [::]:8002->8002/tcp rag-mcp-server 3cc46a723fc1 local/ai-rag:rag-api-runtime-ca "/app/rag-api-dist/r…" 20 minutes ago Up 19 minutes (healthy) 0.0.0.0:8000->8000/tcp, [::]:8000->8000/tcp rag-api 8051d2423d6e redis:7-alpine "docker-entrypoint.s…" 20 minutes ago Up 20 minutes (healthy) 0.0.0.0:6379->6379/tcp, [::]:6379->6379/tcp rag-redis 2fcd1d5b292c mariadb:11.8 "docker-entrypoint.s…" 20 minutes ago Up 20 minutes (healthy) 0.0.0.0:3316->3306/tcp, [::]:3316->3306/tcp rag-mariadb 21d29ad682bd local/ai-rag:docling-ray-ca "python main.py" 20 minutes ago Up 20 minutes (healthy) 8003/tcp, 8265/tcp rag-docling-ray
Looking at the celery-worker-runtime-ca log I saw:
Error loading embedding model: Failed to load embeddings via SentenceTransformerEmbeddings after registry/fallback failure: Unrecognized processing class in BAAI/bge-m3. Can't instantiate a processor, a tokenizer, an image processor or a feature extractor for this model. Make sure the repository contains the files of at least one of those processing classes.
Which might be due to a too recent BAAI/bge-m3 model, so I have tried to fallback to BAAI/bge-base-en-v1.5…
MariaDB AI RAG testing
I have started by validating that from my VM I can connect to my Ollama running on my Windows desktop, and for this I activated:

You should be able to access the chat API endpoint with curl from the machine running your Docker containers:
[mariadb@server03 ~]$ curl http://192.168.56.1:11434/api/chat -d '{ "model": "gemma4:latest", "messages": [ {"role": "user", "content": "Say hello" }], "stream": false }'
{"model":"gemma4:latest","created_at":"2026-08-11T15:56:52.4213038Z","message":{"role":"assistant","content":"Hello! 😊"},"done":true,"done_reason":"stop","total_duration":79028712200,
"load_duration":62823215200,"prompt_eval_count":18,"prompt_eval_duration":15871806000,"eval_count":4,"eval_duration":318847000}But doing few trials I realized that even if I configured Ollama running on my desktop with:
LLM_PROVIDER=ollama LLM_MODEL=gemma4:latest OLLAMA_HOST=http://192.168.56.1:11434
It is NOT taken into account in the rag-celery-worker worker container:
celery.utils.serialization.UnpickleableExceptionWrapper: Exception("Failed to generate response (enhanced: LLM provider 'ollama' failed to generate a response: litellm.APIConnectionError: OllamaException -
Cannot connect to host localhost:11434 ssl:<ssl.SSLContext object at 0x7feb1c22fec0> [Connect call failed ('127.0.0.1', 11434)],
fallback: LLM provider 'ollama' failed to generate a response: litellm.APIConnectionError: OllamaException -
Cannot connect to host localhost:11434 ssl:<ssl.SSLContext object at 0x7feb1c22fec0> [Connect call failed ('127.0.0.1', 11434)])")It kept trying to use an Ollama running on 127.0.0.1 instead of 192.168.56.1 (the host running my VMs as virtual network defined by Virtualbox). Looks like the configuration variable is not taken into account everywhere…
So I have tried to create a free Gemini API key to try to conclude this testing… Also gemini-2.5-flash-lite is no more available so I had to fallback to gemini-3.5-flash-lite… Also test that a call to your Gemini API works:
PS D:\Download\skills> curl "https://generativelanguage.googleapis.com/v1beta/interactions" --ssl-no-revoke -H 'Content-Type: application/json' -H "x-goog-api-key: $GEMINI_API_KEY" -X POST -d '{ "model": "gemini-3.5-flash-lite", "input": "Explain how AI works in a few words" }'
{"id":"v1_ChdfazE41aZm1uc0VQNHFUDRzdWUwUXM","status":"completed","usage":{"total_tokens":29,"total_input_tokens":9,"input_tokens_by_modality":[{"modality":"text","tokens":9}],"total_cached_tokens":0,"total_output_tokens":20,"total_tool_use_tokens":0,"total_thought_tokens":0,
"raw_prompt_token":40},"created":"2026-08-12T10:42:06Z","updated":"2026-08-12T10:42:06Z","service_tier":"standard","steps":[{"signature":"El4KXAERTTIPS+H6B0YBSHuAuxiep3y/m640mM+nslvHKdb+2STetdN/c+e2q19l7xqo2NoOajF7vZOugvHZbrjFvFrZLTOg","type":"thought"},
{"content":[{"text":"AI looks at huge amounts of data, finds patterns, and uses them to make predictions or decisions.","type":"text"}],"type":"model_output"}],"object":"interaction","model":"gemini-3.5-flash-lite"}Change in config.env below configuration and recreate all containers (docker stop, docker rm and docker compose). Here I have really appreciated to have automated the whole process of certificates:
LLM_PROVIDER=gemini LLM_MODEL=gemini-3.5-flash-lite # gemini-2.5-flash-lite no more available, use gemini-3.5-flash-lite instead GEMINI_API_KEY=<your_gemini_api_key>
To use the MariaDB AI RAG API endpoint you need first to generate a token and store it in a environment variable for convenience:
PS D:\Download\skills> $TOKEN = (curl -X 'POST' 'http://192.168.56.103:8000/token' -d 'username=yannick.jaquier@st.com&password=secure_password' | ConvertFrom-Json).access_token
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 313 100 257 100 56 197 43 00:01 00:01 54Once you have the token I have used the /orchestrate/full-pipeline REST API endpoint to ingest a document and ask a question at same time:
PS D:\Download\skills> curl -X POST "http://192.168.56.103:8000/orchestrate/full-pipeline?wait=true" -H "Authorization: Bearer $TOKEN" -F 'query=How to generate an HTML AWR report ?' -F "files=@D:/Download/skills/db/performance/awr-reports.md"
I have not displayed the messy long JSON result and for better display I have copy/paste in jsonformatter.org:

We can see that the (markdown) answer is not too bad and similar to what I got with my Virtual DBA application (http) !
It has also generated (and overloaded) my free account on Google Cloud Platform (GCP):

Now the objective is to ingest the Oracle Skills markdown files with /documents/ingest REST API endpoint. We can see that the one of the above example is still there:
PS D:\Download\skills> curl -X GET "http://192.168.56.103:8000/documents" -H "Authorization: Bearer $TOKEN"
[{"source":"/app/uploaded_files/1/850fbd8b_awr-reports.md","filename":"awr-reports.md","content":"AWR Reports — Automatic Workload Repository Overview The Automatic Workload Repository (AWR) is Oracle's built-in performance data collection and analysis framework.
It automatically captures snapshots of performance statistics at regular intervals (default: every 60 minutes) and stores them in the SYSAUX tablespace.
AWR data is the foundation for diagnosing performance problems, understanding workload trends, and validating the impact of tuning changes. AWR reports compare two snapshots and sum...","error_message":null,"id":2,"status":"COMPLETED","created_at":"2026-08-11T15:40:35","updated_at":null}]So we could ask question related to this file with /orchestrate/generation REST API endpoint without ingesting it again:
PS D:\Download\skills> (curl -X POST "http://192.168.56.103:8000/orchestrate/generation?wait=true" -H "Authorization: Bearer $TOKEN" -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"query": "How to generate an HTML AWR report ?" }' | ConvertFrom-Json).result.response.answer
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 14318 100 14268 100 50 3532 12 00:04 00:04 16
To generate an HTML AWR report, you can use the PL/SQL function `DBMS_WORKLOAD_REPOSITORY.AWR_REPORT_HTML` within a SQL query [1]. Here is an example of how to execute it:
```sql
SELECT output
FROM TABLE(
DBMS_WORKLOAD_REPOSITORY.AWR_REPORT_HTML(
l_dbid => (SELECT dbid FROM v$database),
l_inst_num => 1,
l_bid => 200, -- begin snap ID
l_eid => 201 -- end snap ID
)
);
```To ingest all the markdown documents of the Oracle Skills repository (I focus only on the database ones) I have built this PowerShell script:
$rootPath = "D:\Download\skills\db"
$apiUrl = "http://192.168.56.103:8000/documents/ingest"
$TOKEN = (curl -X 'POST' 'http://192.168.56.103:8000/token' -d 'username=yannick.jaquier@st.com&password=secure_password' | ConvertFrom-Json).access_token
Get-ChildItem -Path $rootPath -Recurse -File -Filter *.md | ForEach-Object {
$file = $_
$file_unixlike = $file.FullName.Replace('\', '/')
Write-Host "Ingesting: $file_unixlike"
curl -X POST $apiUrl -H "Authorization: Bearer $TOKEN" -F "files=@$file_unixlike"
}You can check that all documents are here with:
curl -X GET "http://192.168.56.103:8000/documents" -H "Authorization: Bearer $TOKEN"
Then after, a part that is not fully clear in official documentation, is the creation of chunks (and vector embeddings) or if they have been done automatically when ingesting files. So to be 100% sure I have issued:
PS D:\Download\skills> curl -X POST "http://192.168.56.103:8000/chunk/all" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{ "chunking_method": "recursive", "chunk_size": 512, "chunk_overlap": 128, "threshold": 0.8 }'
{"message":"All 163 documents you own have been queued for chunking.","queued_documents":[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,
50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,
119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164],"status":"success"}
PS D:\Download\skills> curl -X GET 'http://192.168.56.103:8000/tasks?status=running&limit=50&offset=0' -H 'accept: application/json' -H "Authorization: Bearer $TOKEN"
{"tasks":[],"total":0,"offset":0,"limit":50}To see if all Oracle skills markdown are taken into account I am asking the same question hoping I will get the tips on sqlcl awr command:
PS D:\Download\skills> (curl -X POST "http://192.168.56.103:8000/orchestrate/generation?wait=true" -H "Authorization: Bearer $TOKEN" -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"query": "How to generate an HTML AWR report ?" }' | ConvertFrom-Json).result.response.answer
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 22070 100 22020 100 50 2983 6 00:08 00:07 00:01 4144
Based on the provided context, you can generate an HTML AWR (Automatic Workload Repository) report using several methods depending on the tool you are using:
### 1. Using SQLcl (`sqlcl-awr.md`)
You can use SQLcl's built-in `awr` command to generate an HTML report between two specific snapshot IDs or for the most recent interval:
* **For a specific time window (using snapshot IDs):**
```sql
awr create html <begin-snapshot-id> <end-snapshot-id>
```
*(Example: `awr create html 142 145`)* [1]
* **For the most recent interval (using the last two snapshots automatically):**
```sql
awr create html
``` [1]
### 2. Using PL/SQL in SQL*Plus or SQL developer (`awr-reports.md`)
You can directly call the `DBMS_WORKLOAD_REPOSITORY.AWR_REPORT_HTML` function inside a SQL query to output the report:
```sql
SELECT output
FROM TABLE(
DBMS_WORKLOAD_REPOSITORY.AWR_REPORT_HTML(
l_dbid => (SELECT dbid FROM v$database),
l_inst_num => 1,
l_bid => 200, -- begin snap ID
l_eid => 201 -- end snap ID
)
);
``` [3]
### Best Practices:
* **Format:** Use the HTML format for human review, as it provides a fully formatted report containing sections such as Load Profile, Instance Efficiency, Top 5 Timed Events, and Top SQL [1, 3].
* **Snapshot Verification:** Always run `awr list snapshots` (in SQLcl) or query `dba_hist_snapshot` beforehand to confirm that your target snapshot IDs exist and span the correct time window [1, 3].And voilà !
References
- MariaDB AI RAG
- Introduction to MariaDB AI RAG
- What is MariaDB AI RAG and what can I do with it?
- MariaDB AI RAG Docker images





