Skip to main content

A simple and intuitive vector database abstraction layer

Project description

Flex Vector

A simple and intuitive vector database abstraction layer supporting multiple vector stores.

CI

Features

  • Unified interface for multiple vector databases
    • Chroma
    • Qdrant
    • Weaviate
    • PGVector
  • Seamless integration with LangChain and LlamaIndex
  • Flexible data loading from files, direct data, or URIs
  • Async support for all operations
  • Command-line interface for common operations

Installation

pip install flexvector

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:

python cli.py load --input-file examples/files/data.txt --collection my_documents

Load documents from a directory:

python cli.py load --input-dir examples/files --collection research_papers

Search for documents:

python cli.py search --query "What is vector database?" --collection my_documents --top-k 5

Delete a collection:

python cli.py 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.

Projects using FlexVextor

More Use Cases

This package aims to be a versatile tool for various AI applications, including but not limited to:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flexvector-0.1.0rc1.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flexvector-0.1.0rc1-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file flexvector-0.1.0rc1.tar.gz.

File metadata

  • Download URL: flexvector-0.1.0rc1.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for flexvector-0.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 9505cc56b23ce58ac5710377231c612b73739c02d62e0594398b5556a0d5d88a
MD5 d020a351c5851ad8f9dbce358d89f91d
BLAKE2b-256 86fe0680c43c9904b9d01513e3ff11a07045e7aadf61472806253f6f368a21ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for flexvector-0.1.0rc1.tar.gz:

Publisher: publish-to-pypi.yml on ndamulelonemakh/flexvector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flexvector-0.1.0rc1-py3-none-any.whl.

File metadata

  • Download URL: flexvector-0.1.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for flexvector-0.1.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 38a51f5045cd00cd84a55e2df50bf5432f69629527764e4ab6db597abd0b83bc
MD5 60d812e786bff74f4218d3400912375b
BLAKE2b-256 e1f7a58409aa1af3a516e7f205b54ffaf4b3b86808eaa30cd59909854f04143c

See more details on using hashes here.

Provenance

The following attestation bundles were made for flexvector-0.1.0rc1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on ndamulelonemakh/flexvector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page