LangChain’s MariaDB integration (langchain-mariadb) provides vector capabilities for working with MariaDB version 11.7.1 and above, distributed under the MIT license. Users can use the provided implementations as-is or customize them for specific needs.
Key features include:
Built-in vector similarity search
Support for cosine and euclidean distance metrics
Robust metadata filtering options
Performance optimization through connection pooling
docs = [ Document( page_content="there are cats in the pond", metadata={"id": 1, "location": "pond", "topic": "animals"}, ), Document( page_content="ducks are also found in the pond", metadata={"id": 2, "location": "pond", "topic": "animals"}, ), # More documents...]vectorstore.add_documents(docs)
Or as plain text with optional metadata:
Copy
Ask AI
texts = [ "a sculpture exhibit is also at the museum", "a new coffee shop opened on Main Street",]metadatas = [ {"id": 6, "location": "museum", "topic": "art"}, {"id": 7, "location": "Main Street", "topic": "food"},]vectorstore.add_texts(texts=texts, metadatas=metadatas)