Skip to main content

Embex: A Universal Vector Database ORM

Project description

Embex (Python)

The fastest way to add vector search to your app.

Embex is a universal vector database client that lets you start with zero setup and scale to production without rewriting code.

🚀 Features

  • Start Simple: Use LanceDB (embedded) for zero-setup local development.
  • Unified API: Switch to Qdrant, Pinecone, or Milvus just by changing the config.
  • Performance: Powered by a shared Rust core with SIMD acceleration.
  • Type Safety: Fully typed Python bindings.

📦 Installation

pip install embex lancedb sentence-transformers

⚡ Quick Start

Build semantic search in 5 minutes using LanceDB (embedded) and local embeddings. No API keys or Docker needed!

import asyncio
from embex import EmbexClient, Vector
from sentence_transformers import SentenceTransformer

async def main():
    # 1. Setup Embedding Model
    model = SentenceTransformer('all-MiniLM-L6-v2')

    # 2. Initialize Client (uses LanceDB embedded)
    client = await EmbexClient.new_async(provider="lancedb", url="./data")

    # 3. Create Collection (384 dimensions for MiniLM)
    await client.create_collection("products", dimension=384)

    # 4. Insert Data
    documents = [
        {"id": "1", "text": "Apple iPhone 15", "category": "electronics"},
        {"id": "2", "text": "Samsung Galaxy S24", "category": "electronics"},
    ]

    vectors = []
    for doc in documents:
        vectors.append(Vector(
            id=doc["id"],
            vector=model.encode(doc["text"]).tolist(),
            metadata={"text": doc["text"]}
        ))

    await client.insert("products", vectors)

    # 5. Search
    query = "smartphone"
    results = await client.search(
        collection_name="products",
        vector=model.encode(query).tolist(),
        limit=1
    )

    print(f"Query: '{query}'")
    print(f"Match: {results[0].metadata['text']}")

if __name__ == "__main__":
    asyncio.run(main())

🗺️ Development → Production Roadmap

Stage Recommendation Why?
Day 1: Learning LanceDB Embedded. Zero setup. Free.
Week 2: Staging Qdrant / Pinecone Managed cloud. Connection pooling.
Month 1: Scale Milvus Distributed. Billion-scale vectors.
Anytime PgVector You already use PostgreSQL.

☁️ Switch Provider (Zero Code Changes)

Ready for production? Just change the initialization line.

From LanceDB (Dev):

client = await EmbexClient.new_async(provider="lancedb", url="./data")

To Qdrant Cloud (Prod):

client = EmbexClient(
    provider="qdrant",
    url="https://your-cluster.qdrant.io",
    api_key="..."
)

🔄 Data Migration

Move data between providers effortlessly using the built-in DataMigrator.

from embex import DataMigrator, EmbexClient

# 1. Setup clients
source = await EmbexClient.new_async("lancedb", "./local_data")
dest = EmbexClient("qdrant", "http://prod-db:6333")

# 2. Migrate
migrator = DataMigrator(source, dest)
result = await migrator.migrate_simple(
    source_collection="products",
    dest_collection="products_v2"
)

print(f"Migrated {result.points_migrated} points!")

🔗 Resources

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

embex-0.1.20.tar.gz (122.6 kB view details)

Uploaded Source

Built Distributions

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

embex-0.1.20-cp38-abi3-win_amd64.whl (36.3 MB view details)

Uploaded CPython 3.8+Windows x86-64

embex-0.1.20-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (38.8 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

embex-0.1.20-cp38-abi3-macosx_11_0_arm64.whl (32.9 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

embex-0.1.20-cp38-abi3-macosx_10_12_x86_64.whl (37.1 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file embex-0.1.20.tar.gz.

File metadata

  • Download URL: embex-0.1.20.tar.gz
  • Upload date:
  • Size: 122.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for embex-0.1.20.tar.gz
Algorithm Hash digest
SHA256 288e280268b3bf688f3deef0537aaec852ab87f57a358fa177c5b88566c44e37
MD5 1c19f329c13197e45a7e28ea65e5a4db
BLAKE2b-256 0ae3ed5c636039ecf419e4829993398368be0b3e7d330bad1353387ba5698a50

See more details on using hashes here.

File details

Details for the file embex-0.1.20-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: embex-0.1.20-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 36.3 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for embex-0.1.20-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 840a9315b153c374ad8b7ec2b9da419f27cb68b9514f8c3013fb70a6c973645e
MD5 ea8d5210c14337d0a19bbabe4c96eb80
BLAKE2b-256 d8d3189f53839c6a58c91f7cb08f0ea8782323fd9287dfa23b8d0aae578b30b4

See more details on using hashes here.

File details

Details for the file embex-0.1.20-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for embex-0.1.20-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2f680796a93f5c756f51f94adef2ac9ee8439f3c0aee544b6bfe9640de162e41
MD5 3ac8ae63de8f614c3036fe5aa3a0347b
BLAKE2b-256 4250b8d5a515b3d5a846e00c46177b59cc18500f735bd103af5ea0cc13bf0793

See more details on using hashes here.

File details

Details for the file embex-0.1.20-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for embex-0.1.20-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9a18c7018582308efcd1a5de31f154931afe0a2b4583c92a761793251e8fa40d
MD5 5d69417af72abb05e86ff3219f8847cd
BLAKE2b-256 7e12b38964216f445cb66b461f651b69f8d24457f4aa7e69adbc086b16a88a41

See more details on using hashes here.

File details

Details for the file embex-0.1.20-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for embex-0.1.20-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ed612a72751ac4aa81f1c19c8e28e6d9917b076e618b709aae6e2457c077dbb5
MD5 a1356e33f15fa2ccf05478017bd782f3
BLAKE2b-256 66f0b07838527840dd48dd5ea1a92973641a128c6f4ae91f80b6a7b3e19c0276

See more details on using hashes here.

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