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.21.tar.gz (126.3 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.21-cp38-abi3-win_amd64.whl (36.3 MB view details)

Uploaded CPython 3.8+Windows x86-64

embex-0.1.21-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.21-cp38-abi3-macosx_11_0_arm64.whl (32.9 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

embex-0.1.21-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.21.tar.gz.

File metadata

  • Download URL: embex-0.1.21.tar.gz
  • Upload date:
  • Size: 126.3 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.21.tar.gz
Algorithm Hash digest
SHA256 662ae6ce9a1a4282600873fb8ec4b86fb3a87b1e3ffd27baef0284f96f600d18
MD5 1329d8d50ff843e1b9ae7c2690bb20f1
BLAKE2b-256 ef5d88d2a9ff62f9cf914ed55bb2576e9f39065e78e2b00726d39b6237998184

See more details on using hashes here.

File details

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

File metadata

  • Download URL: embex-0.1.21-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.21-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4d749b5b0a4b1ae3d8255dd10ffa716dc9be8e5f43aa44020fb61896c7c2e418
MD5 d87e3c867504c383e2e7ecd6274fe38a
BLAKE2b-256 31132e0760977784fd8ef154c81da63401b16fa311845cd3f177dfccac2ddba7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for embex-0.1.21-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b383a8403116dbb7b0469394f3191a5edac4be29073af3aeb493bb0b20e97cb2
MD5 d910b27e5f47632e5a1b859901d40987
BLAKE2b-256 c92f24b4e51ac3d537c13a3f69b35a2d7cc8a02e3ed00c52798f33c7fcd5d266

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for embex-0.1.21-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9d44c2abc266e4280522fad1ea3ec073a07c6c6663ce3112a6c94e7b91287608
MD5 a3415f4f626b87cd0422ee701208512b
BLAKE2b-256 766770aa86abeb1a4d2b7e59f72195b9b9c25ebf5401cc2a11ac383e33776769

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for embex-0.1.21-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 39da95eae611df2fc0497a67384f445f3a46d3d9f039ceec5248c5a254506da9
MD5 660504d9e488bc47f5364c9548442fab
BLAKE2b-256 d7cc74644d637ae6b82cf0b3535e3bb489f3afc8039d965a49f1f4125cebbc57

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