For the complete documentation index, see llms.txt. This page is also available as Markdown.

LangChain MariaDB

LangChain integration for MariaDB, providing vector stores, chat message history, and natural language query capabilities.

The langchain-mariadb package provides seamless integration between LangChain and MariaDB, enabling advanced AI and machine learning workflows with persistent storage.

Features

  • Vector Store - Store and search embeddings using MariaDB's vector capabilities

  • Chat Message History - Persistent conversation storage for chatbots and AI assistants

  • Expression Filters - Advanced metadata filtering for vector search

  • Natural Language Queries - Translate natural language to SQL queries

Installation

pip install langchain-mariadb

Quick Start

Vector Store Example

from langchain_mariadb import MariaDBStore
from langchain_openai import OpenAIEmbeddings

embeddings = OpenAIEmbeddings()
vectorstore = MariaDBStore(
    embeddings=embeddings,
    datasource="mariadb://user:password@localhost/database",
    collection_name="my_documents"
)

# Add documents
vectorstore.add_texts(["Hello world", "LangChain with MariaDB"])

# Search
results = vectorstore.similarity_search("greeting", k=1)

Chat Message History Example

Documentation

For complete documentation, guides, and tutorials, visit the official LangChain documentation:

This section contains only the API reference:

Resources

Version

Current version: v0.0.20

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

Last updated

Was this helpful?