Skip to main content

llama-index vector_stores mariadb integration

Project description

LlamaIndex Vector_Stores Integration: MariaDB

With the release of MariaDB 11.6 Vector Preview, the MariaDB relational database introduced the long-awaited vector search functionality. Thus now it can be used as a fully-functional vector store in LlamaIndex. Please note, however, that the latest MariaDB version is only an Alpha release, which means that it may crash unexpectedly.

To learn more about the feature, check the Vector Overview in the MariaDB docs.

Installation

pip install llama-index-vector-stores-mariadb

Usage

from llama_index.vector_stores.mariadb import MariaDBVectorStore

vector_store = MariaDBVectorStore.from_params(
    host="localhost",
    port=3306,
    user="llamaindex",
    password="password",
    database="vectordb",
    table_name="llama_index_vectorstore",
    embed_dim=1536,  # OpenAI embedding dimension
)

Development

Running Integration Tests

A suite of integration tests is available to verify the MariaDB vector store integration. The test suite needs a MariaDB database with vector search support up and running, if not found the tests are skipped. To facilitate that, a sample docker-compose.yaml file is provided, so you can simply do:

docker compose -f tests/docker-compose.yaml up

pytest -v

# Clean up when you finish testing
docker compose -f tests/docker-compose.yaml down

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

Built Distribution

Supported by

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