Docker Deployment Guide

📋 Quick Navigation


System Overview

What is MariaDB AI RAG?

MariaDB AI RAG (RAG-in-a-Box) is a containerized RAG system providing:

  • Document ingestion & processing (PDF, TXT, DOCX, MD, etc.)

  • Vector embeddings using Google Gemini

  • Semantic search & AI-powered queries

  • RESTful RAG API (Port 8000)

  • MCP Server for AI agents (Port 8002)

  • MariaDB 11 with vector support (Port 3306)

Architecture

Technology Stack

  • Container: Docker Desktop + Docker Compose

  • OS: Ubuntu 24.04 LTS

  • Database: MariaDB 11 with vector support

  • Embedding: Google Gemini text-embedding-004 (768-dim)

  • LLM: Google Gemini gemini-2.0-flash

  • Framework: FastAPI + Uvicorn


Prerequisites

Hardware Requirements

Component
Minimum
Recommended

CPU

4 cores

8+ cores

RAM

8 GB

16+ GB

Storage

20 GB free

50+ GB free

Software Requirements

  1. Windows 10/11 Pro/Enterprise (64-bit)

  2. Docker Desktop 4.x+ with WSL 2 backend

  3. PowerShell 5.1+ (built-in)

API Keys

  1. Google Gemini API Key (Required)

    • Get from: https://makersuite.google.com/app/apikey

    • Free tier available

Port Requirements

  • 8000 (RAG API)

  • 8002 (MCP Server)

  • 3306 (MariaDB)

  • 8200 (Vault - if using Vault mode)


Pre-Deployment Checklist

1. Verify Docker Installation

2. Check Available Ports

3. Navigate to Project Directory

4. Configure API Key


Deployment - Standalone Mode

Standalone Mode = Simplest setup with secrets in config file

Step 1: Build Docker Image

Time: 2-5 minutes (first time)

Step 2: Start Services

Expected Output:

Step 3: Monitor Startup

Wait for:

Press Ctrl+C to exit logs (containers keep running)

Step 4: Verify Services

Expected:

Step 5: Test Accessibility

✅ Deployment Complete!

Access Points:

  • RAG API: http://localhost:8000/docs

  • MCP Server: http://localhost:8002/mcp


Deployment - Vault Mode

Vault Mode = Production-like secret management with HashiCorp Vault

Step 1: Build Docker Image

Step 2: Run Automated Vault Setup

Expected:

Step 3: Update Gemini API Key in Vault

Step 4: Start MariaDB AI RAG with Vault Config

Step 5: Monitor & Verify

✅ Deployment Complete!

Vault Management:


Post-Deployment

1. Generate Authentication Token

2. Authorize in Swagger UI

3. Test Document Ingestion

4. Test RAG Query


Usage Guide

Document Ingestion

Via Swagger UI

  1. Open http://localhost:8000/docs

  2. Authorize with Bearer token

  3. Use POST /documents/ingest endpoint

  4. Upload file(s)

  5. Wait for processing

Via PowerShell

RAG Query

Via Swagger UI

  1. Open http://localhost:8000/docs

  2. Use POST /orchestrate/generation endpoint

  3. Enter your question

  4. Get AI-generated answer

Via PowerShell

MCP Server Integration

For Windsurf/Claude Desktop

Add to MCP configuration:

Available MCP Tools

  • Database Tools: execute_sql, list_tables, get_table_schema

  • Vector Tools: create_vector_store, search_vector_store

  • RAG Tools: ingest_documents, generate_response

  • Health Tools: health_check, get_server_status


Troubleshooting

Services Won't Start

Database Connection Errors

Port Already in Use

Authentication Fails

API Key Invalid

Health Check Timeout


Management Commands

View Status

View Logs

Stop Services

Start Services

Restart Services

Clean Everything (⚠️ Deletes Data)

Access Container Shell

View Resource Usage


Quick Reference

Standalone Mode

Vault Mode

Switching Modes

Access Points

  • RAG API: http://localhost:8000/docs

  • MCP Server: http://localhost:8002/mcp

  • Database: localhost:3306


Support

Check Logs

Verify Configuration

Test Connectivity


🎉 Deployment Complete! Your MariaDB AI RAG is ready to use.

This page is: Copyright © 2025 MariaDB. All rights reserved.

Last updated

Was this helpful?