Skip to main content

mdb-rag: RAG pipelines for teams already running MariaDB

70-80% of legacy data in LATAM lives in MySQL/MariaDB. This library lets you plug that data into a RAG pipeline without migrating your stack.

The problem

Legacy MySQL/MariaDB data can't participate in AI pipelines without expensive ETL to PostgreSQL or external vector DBs. mdb-rag solves this with MariaDB 11.8 native HNSW vector indexes.

Install

pip install mdb-rag

Requirements

  • MariaDB 11.8+, self-hosted or PaaS (Railway, Render)
  • Major cloud managed services (AWS RDS, Google Cloud SQL) are still rolling out 11.8 support — this is a provider limitation, not a library limitation

Quickstart

from mdbrag import Bridge

# Connect to MariaDB
bridge = Bridge("mariadb+pymysql://user:pass@localhost:3306/mydb")

# Vectorize your data (bring your own vectors)
vectors = [[0.1, 0.2, ...], [0.3, 0.4, ...]]  # list[list[float]]
bridge.vectorize(
    source_table="clientes",
    fields=["notas", "descripcion"],
    vectors=vectors
)

# Search using pre-computed query vector
results = bridge.search(
    query_vector=[0.1, 0.2, ...],
    table_name="clientes_vectors",
    top_k=5
)

How it works

mdb-rag uses the bridge pattern: you generate embeddings using your preferred model (OpenAI, sentence-transformers, etc.) and pass them to mdb-rag. The library handles storage and HNSW indexing directly in MariaDB, enabling semantic search without any external services or data migration.

Contributing

git clone https://github.com/gaboexe0/mdb-rag
cd mdb-rag
pip install -e ".[dev]"
pytest

Requires MariaDB 11.8+ for integration testing.

Clone the repo, open issues, PRs welcome.

License

MIT

Metadata

Release files for mdb-rag 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mdb-rag 0.1.0
File Size Uploaded
mdb_rag-0.1.0.tar.gz 42.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for mdb-rag 0.1.0
File Interpreter ABI Platform
mdb_rag-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.7 MB

Release files / mdb_rag-0.1.0.tar.gz

Download URL mdb_rag-0.1.0.tar.gz
Size 42.7 MB
Tags Source
SHA-256 checksum
How to use checksums
3783af658a2a872940749e3e719f922a04841bde7770de719e41acb80e2744f1
BLAKE2b-256 checksum
How to use checksums
0ffbfc53ddb6a4d048567e6d0dc37671d6030c5e9460c9f4e0db9e4180dfec58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Release files / mdb_rag-0.1.0-py3-none-any.whl

Download URL mdb_rag-0.1.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8f5765f3b84793105950f392d3bc99538aa903d7027d67993e7bd32db62e03e
BLAKE2b-256 checksum
How to use checksums
c148a1c902412b6f34ad175a89e5e897cc1b76d6892105be8d4a0139ef96c0c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page