A simple and intuitive vector database abstraction layer
Project description
Flex Vector
A simple and intuitive vector database abstraction layer supporting multiple vector stores.
Features
- Unified interface for multiple vector databases
- Chroma
- Qdrant
- Weaviate
- PGVector
- Milvus
- Azure AI Search
- ...and more to come!
- LangChain support
- LlamaIndex support
- Flexible data loading from files, direct data, or URIs
- Async support for all operations
- Command-line interface for common operations
Installation
pip install flexvector
Add the CLI tool to your path:
# After installation, use the 'flexvector' command directly
flexvector --help
Quick Start
Using the Python API
from flexvector import VectorDBFactory
from flexvector.config import VectorDBSettings
from flexvector.core import Document
# Initialize client with configuration
config = VectorDBSettings()
client = VectorDBFactory.get("chroma", config)
# Load documents from file or directory
docs = client.load(collection_name="my_collection", path="path/to/document.txt")
# Or create and add documents directly
from langchain_core.documents import Document
doc = Document(page_content="Hello world", metadata={"source": "example"})
client.from_langchain("my_collection", [doc])
# Search
results = client.search(
collection_name="my_collection",
query="hello",
top_k=5
)
# Delete collection
client.remove_collection("my_collection")
# Delete documents
Using the Command Line Interface
Load documents from a file:
flexvector load --input-file examples/files/data.txt --collection my_documents
# Or using python
python cli.py load --input-file examples/files/data.txt --collection my_documents
Load documents from a directory:
flexvector load --input-dir examples/files --collection research_papers
Search for documents:
flexvector search --query "What is vector database?" --collection my_documents --top-k 5
Delete a collection:
flexvector delete --collection my_documents
Documentation
For more usage info, see docs.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
This package aims to be a versatile tool for various AI applications, including but not limited to:
Research and Development
- Prototyping: Quickly test different vector databases without changing your application code
- A/B Testing: Compare performance across different vector stores for your specific use case
- Academic Research: Study vector search behavior with a standardized interface
RAG Pipeline Integration
Build robust Retrieval Augmented Generation (RAG) systems with a database-agnostic approach:
- ETL Workflows: Create efficient extract-transform-load pipelines that process documents and store embeddings without locking into a specific vector database
- Multi-modal RAG: Store and retrieve text, images, and other data types with the same consistent interface
- Hybrid Search Systems: Combine semantic search with traditional keyword search for improved retrieval quality
Research and Development
- Prototyping: Quickly test different vector databases without changing your application code
- A/B Testing: Compare performance across different vector stores for your specific use case
- Academic Research: Study vector search behavior with a standardized interface
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flexvector-0.1.0.tar.gz.
File metadata
- Download URL: flexvector-0.1.0.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ec6a39ad2bba1a7154b2f9e7ec3c3a0c9782aba59b1c250496051eff546c81e
|
|
| MD5 |
ad62c2e40ecd581c9213c8e36d7aab0f
|
|
| BLAKE2b-256 |
16afc74f288fc385bd3cb933d909649013e74596e5bf2b4a40d10701007457de
|
Provenance
The following attestation bundles were made for flexvector-0.1.0.tar.gz:
Publisher:
publish-to-pypi.yml on ndamulelonemakh/flexvector
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flexvector-0.1.0.tar.gz -
Subject digest:
0ec6a39ad2bba1a7154b2f9e7ec3c3a0c9782aba59b1c250496051eff546c81e - Sigstore transparency entry: 200992093
- Sigstore integration time:
-
Permalink:
ndamulelonemakh/flexvector@cebcf47bd5811401615bb0636a6f69ba975eef69 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/ndamulelonemakh
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@cebcf47bd5811401615bb0636a6f69ba975eef69 -
Trigger Event:
release
-
Statement type:
File details
Details for the file flexvector-0.1.0-py3-none-any.whl.
File metadata
- Download URL: flexvector-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e27c723736f4b8649c4117c856ab22c260c6393c8b7294aa6a037e63d3daf59c
|
|
| MD5 |
902d0f3a65c2988468540e0a2c0839f0
|
|
| BLAKE2b-256 |
11926107d85b391199ef594fddd6f1bb5b7e2e22a0513fc3c9996e4eb07c518a
|
Provenance
The following attestation bundles were made for flexvector-0.1.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on ndamulelonemakh/flexvector
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flexvector-0.1.0-py3-none-any.whl -
Subject digest:
e27c723736f4b8649c4117c856ab22c260c6393c8b7294aa6a037e63d3daf59c - Sigstore transparency entry: 200992098
- Sigstore integration time:
-
Permalink:
ndamulelonemakh/flexvector@cebcf47bd5811401615bb0636a6f69ba975eef69 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/ndamulelonemakh
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@cebcf47bd5811401615bb0636a6f69ba975eef69 -
Trigger Event:
release
-
Statement type: