langchain-alayalite is an official LangChain partner integration that connects AlayaLite, a high-performance lightweight vector database, with the LangChain ecosystem.
It provides a native VectorStore implementation fully compatible with langchain-core, enabling seamless usage of AlayaLite for vector storage, similarity search, and retrieval workflows in modern LLM-powered applications.
This project is officially maintained by members of the AlayaLite team, with the primary goal of promoting AlayaLite as a production-ready, lightweight, and high-performance vector database solution.
AlayaLite is a lightweight vector database designed for efficient embedding storage, similarity search, and retrieval workloads, optimized for simplicity, performance, and developer friendliness.
GitHub Repository: https://github.com/AlayaDB-AI/AlayaLite
- High Performance: Optimized vector indexing and search pipeline.
- Elastic Scalability: Multi-threaded design powered by C++20 coroutines.
- Adaptive Flexibility: Pluggable quantization strategies, metrics, and data types.
- Ease of Use: Intuitive Python APIs with minimal configuration.
- Low Resource Overhead: Designed for lightweight deployments.
LangChain is a widely used framework for building applications powered by large language models (LLMs), providing modular components for prompt engineering, chains and agents, memory systems, Retrieval-Augmented Generation (RAG), and vector database integrations.
Official Website: https://www.langchain.com/
GitHub Repository: https://github.com/langchain-ai/langchain
- Native LangChain VectorStore implementation
- Fully compatible with langchain-core
- Supports:
add_documentsadd_textssimilarity_searchsimilarity_search_with_scoreget_by_idsfrom_textsfrom_documents
- Passes LangChain official standard integration test suite
- Simple configuration, production-ready API
- High-performance, low-overhead backend
- ✅ All synchronous APIs are fully supported.
- ✅ Passes LangChain official standard test suite (except async tests).
- ❌ Asynchronous APIs are not fully supported yet
- ❌ MMR (Maximal Marginal Relevance) retrieval is currently unavailable
Due to current limitations in the underlying AlayaLite storage engine, asynchronous execution and MMR retrieval are temporarily unavailable.
These features are actively under development and planned for upcoming releases.
Except for async-related tests, all LangChain official standard integration tests pass successfully, ensuring correctness, consistency, and compatibility.
Install from PyPI:
pip install langchain-alayaliteFor development mode:
pip install -e .Below is a complete working example using OpenAI embeddings.
from langchain_alayalite import AlayaLite
from langchain_core.documents import Document
from langchain_openai import OpenAIEmbeddings
# Initialize embedding model
embeddings = OpenAIEmbeddings()
# Create vector store
vectorstore = AlayaLite(
embedding=embeddings,
persist_directory="./alayalite_data" # Optional: persist data to disk
)
# Prepare documents
docs = [
Document(page_content="LangChain makes building LLM applications easy."),
Document(page_content="AlayaLite is a high-performance lightweight vector database."),
Document(page_content="Vector databases enable fast semantic similarity search.")
]
# Add documents
vectorstore.add_documents(docs)
# Perform similarity search
results = vectorstore.similarity_search("lightweight vector database", k=2)
for doc in results:
print(doc.page_content)AlayaLite is a high-performance lightweight vector database.
Vector databases enable fast semantic similarity search.
Contributions, issues, and feature requests are welcome!
Please open issues or pull requests at: https://github.com/AlayaDB-AI/AlayaLite
MIT