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-mariadbQuick 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
LangChain no longer hosts a MariaDB page of its own: its vector store integrations index links back to this documentation. The maintained references for the package are:
API Reference - Complete API documentation
Resources
Version
Current version: v0.0.20
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

