AI applications are increasingly being connected to business databases instead of operating as isolated chatbot systems. An AI assistant may need customer records, product information, support history, orders, documents, and application metadata before it can produce a useful response.
That creates a database challenge. The application needs to store normal relational data while also supporting AI-oriented workloads such as semantic search, embeddings, retrieval, and agent memory.
MariaDB Enterprise Platform 2027 provides a database platform that can be considered for these workloads while keeping application data in a familiar relational environment.
The important part is not simply adding AI features to a database. A production AI application needs a clear data model, controlled retrieval, secure access, predictable performance, and a way to keep AI-generated information connected to trusted application data.
This article explains how to approach AI application development with MariaDB Enterprise Platform.
What an AI Application Needs From a Database
A typical AI application contains more than a prompt and a model.
For example, an enterprise support assistant may need:
Users
Tickets
Products
Knowledge Documents
Conversation History
Embeddings
AI Responses
Tool Results
Agent StateA simplified architecture looks like this:
User
|
v
AI Application
|
+----------------------+
| |
v v
AI Model MariaDB
|
+-----------+-----------+
| | |
v v v
Business AI Data Agent State
Data Embeddings SessionsThe database becomes part of the application's AI architecture.
Keep Business Data and AI Data Organized
One common mistake is putting everything into a single generic AI table.
Instead, separate different types of information.
For example:
customers
---------
customer_id
name
email
status
documents
---------
document_id
title
content
updated_at
document_chunks
---------------
chunk_id
document_id
content
embedding
conversations
-------------
conversation_id
customer_id
created_at
messages
--------
message_id
conversation_id
role
content
created_atThis separation makes the application easier to maintain.
Business tables contain trusted application data, while AI-related tables store information used for retrieval, conversations, and model interaction.
Store Embeddings Alongside Application Data
Retrieval-augmented generation applications commonly convert documents or text into embeddings.
An embedding represents semantic information as numerical values.
For example:
Document
|
v
Embedding Model
|
v
Vector
|
v
DatabaseThe application can later convert a user question into another vector and use similarity search to identify relevant content.
A conceptual table could contain:
document_chunks
---------------
chunk_id
document_id
content
embedding
created_at
updated_atKeeping the source document identifier with the embedding is important.
The application should always be able to answer:
Which document produced this chunk?This allows the application to retrieve the original content and provide appropriate context to the AI model.
Design the Retrieval Pipeline
A basic AI retrieval flow can be implemented as:
User Question
|
v
Embedding Model
|
v
Query Embedding
|
v
MariaDB Retrieval
|
v
Relevant Chunks
|
v
Prompt Construction
|
v
AI Model
|
v
ResponseThe database is responsible for retrieving relevant information. The model is responsible for generating the response.
Keeping these responsibilities separate makes the system easier to debug.
Example AI Retrieval Workflow
Suppose a user asks:
How can I reset my company account password?The application can process the request as follows:
Convert the question into an embedding.
Search the document chunks for relevant content.
Select the highest-quality results.
Add those results to the model context.
Ask the AI model to generate the answer.
Return the response to the user.
The application should not send the entire knowledge base to the model.
Only relevant information should be included in the context.
Store Source Metadata With AI Content
AI-generated and retrieved information should contain enough metadata to trace its source.
For example:
document_id
chunk_id
source_type
source_name
created_at
updated_atThis is useful when the application needs to show where an answer came from or determine whether an indexed document is outdated.
A retrieval result without source information is difficult to audit.
Keep AI-Generated Data Separate From Trusted Data
An AI model can generate incorrect information.
Therefore, avoid treating AI-generated output as equivalent to verified application data.
For example, an AI assistant might generate:
customer_status = "approved"That does not mean the application's customer table should be updated automatically.
Instead:
Trusted Database Data
|
v
AI Application
|
v
AI-generated suggestion
|
v
Validation
|
v
Business OperationThe AI system should follow application rules before modifying important business data.
Use AI as a Layer Around the Database
A useful architecture is to keep the database as the source of structured business information while the AI layer provides reasoning and natural-language interaction.
For example:
AI Application
|
+--------------+--------------+
| | |
v v v
AI Model Retrieval Agent Logic
|
v
MariaDB
/ \
/ \
v v
Business Tables AI DataThis architecture avoids making the AI model responsible for storing business truth.
Add Agent Memory Carefully
AI agents often need memory between requests.
For example, an agent may need to remember:
User preferences
Previous decisions
Current task
Tool results
Conversation stateThis information can be stored in MariaDB.
A simple session model might look like:
agent_sessions
--------------
session_id
user_id
status
created_at
updated_at
agent_messages
--------------
message_id
session_id
role
content
created_at
Join the conversation! Your thoughts help the community grow.