@bridgerust/embex
v0.1.6
Published
Embex Vector Database ORM Node.js Bindings
Downloads
346
Maintainers
Readme
Embex (Node.js)
The Universal Vector Database ORM. One API for Qdrant, Pinecone, Chroma, LanceDB, and more.
Embex is a high-performance, universal client for vector databases, built on a shared Rust core related to BridgeRust.
🚀 Features
- Unified API: Switch providers instantly. "Write once, run anywhere."
- Performance: Powered by Rust with SIMD acceleration.
- Type Safety: Full TypeScript support.
📦 Installation
npm install embexyarn add embexbun add embex⚡ Quick Start
Try Embex in 30 seconds - No setup required! Uses LanceDB embedded mode (no server needed).
import { EmbexClient } from "@bridgerust/embex";
async function main() {
// LanceDB embedded - zero setup, just a local path
const client = await EmbexClient.newAsync("lancedb", "./data");
const collection = client.collection("documents");
// Create collection
await collection.create(768, "cosine");
// Insert data
await collection.insert([
{
id: "1",
vector: Array(768).fill(0.1),
metadata: { text: "Hello World" },
},
]);
// Search
const results = await collection.search(Array(768).fill(0.1), 5);
console.log(results.results);
}
main();Run it: npx tsx examples/lancedb/node/quickstart.ts
All Provider Quick Starts
Try Embex with any provider! Same API, different backend:
| Provider | Setup | Quick Start |
| ------------ | --------------- | ---------------------------------------------- |
| LanceDB | None (embedded) | npx tsx examples/lancedb/node/quickstart.ts |
| Qdrant | Docker server | npx tsx examples/qdrant/node/quickstart.ts |
| Pinecone | API key | npx tsx examples/pinecone/node/quickstart.ts |
| Chroma | Optional server | npx tsx examples/chroma/node/quickstart.ts |
💡 Same API everywhere! Just change the provider name - all code stays the same. See examples/README.md for setup instructions.
5. Filtered Search (Builder Pattern)
const results = await collection.buildSearch([0.1, 0.2, ...])
.limit(10)
.filter({
course: "CS101"
})
.execute();☁️ Connecting to Cloud Providers
To connect to managed services like Pinecone, Qdrant Cloud, or Zilliz (Milvus), simply provide your API key and endpoint URL.
import { EmbexClient } from "@bridgerust/embex";
// Connect to Pinecone
const client = new EmbexClient(
"pinecone",
"https://index-name.svc.pinecone.io",
process.env.PINECONE_API_KEY
);
// Connect to Qdrant Cloud
const qdrantClient = new EmbexClient(
"qdrant",
"https://xyz-example.eu-central.aws.cloud.qdrant.io:6333",
process.env.QDRANT_API_KEY
);Official Documentation & API Keys
Need help finding your API key? Check the official provider documentation:
- Pinecone: Authentication & API Keys
- Qdrant: Cloud Authentication
- Milvus (Zilliz): Manage Credentials
- Weaviate: Authentication
- Chroma: Auth & Client Settings
🔌 Supported Providers
| Provider | Key | Async Init? |
| -------- | ---------- | ----------- |
| Qdrant | qdrant | No |
| Chroma | chroma | No |
| Pinecone | pinecone | No |
| Weaviate | weaviate | No |
| LanceDB | lancedb | Yes |
| Milvus | milvus | Yes |
| PgVector | pgvector | Yes |
🔗 Resources
- Main Repository: github.com/bridgerust/bridgerust
- Issues: github.com/bridgerust/bridgerust/issues
- Documentation: Full Docs
