Skip to main content

Bridge legacy MySQL/MariaDB data into RAG pipelines without migration

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdb_rag-0.1.0.tar.gz (42.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdb_rag-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file mdb_rag-0.1.0.tar.gz.

File metadata

  • Download URL: mdb_rag-0.1.0.tar.gz
  • Upload date:
  • Size: 42.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for mdb_rag-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3783af658a2a872940749e3e719f922a04841bde7770de719e41acb80e2744f1
MD5 e389fb5cd9c0294718ba4bc5397c92d0
BLAKE2b-256 0ffbfc53ddb6a4d048567e6d0dc37671d6030c5e9460c9f4e0db9e4180dfec58

See more details on using hashes here.

File details

Details for the file mdb_rag-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mdb_rag-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for mdb_rag-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b8f5765f3b84793105950f392d3bc99538aa903d7027d67993e7bd32db62e03e
MD5 7d893b5793a5d188f9eac7aed927dddb
BLAKE2b-256 c148a1c902412b6f34ad175a89e5e897cc1b76d6892105be8d4a0139ef96c0c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page