TalaDB is an embedded document and vector database built on a Rust core. Store JSON documents, query them with filters and indexes, and run vector, full-text and hybrid search inside your app — in the browser, on Node.js, and in React Native, Android and iOS apps. No server, no cloud round-trip.
pnpm add taladb @taladb/webembed() = any embedding modelimport { openDB } from 'taladb'
const db = await openDB('app.db')
const notes = db.collection('notes')
// Documents and their embeddings live together
await notes.createVectorIndex('embedding', {
dimensions: 384,
})
await notes.insert({
title: 'Trip ideas',
archived: false,
embedding: await embed('Trip ideas'),
})
// Filter on metadata first, then rank by similarity
const similar = await notes.findNearest(
'embedding',
await embed('weekend getaway'),
5,
{ archived: false },
)Capabilities
Keep records, metadata and embeddings together, and query all of them in-process, with no separate search service or vector store to run.
Store JSON documents in collections. Query them with MongoDB-style filters, updates, sorting and aggregation pipelines. A query planner uses your secondary indexes automatically.
Filters: Documents and structured queries →Store embeddings next to the records they describe. Search is exact k-NN by default, with optional HNSW for large collections. Metadata filters apply before ranking, so every one of the top k results matches the filter.
Vector search: Vector similarity search →Rank keyword matches with BM25. Hybrid search fuses keyword and vector rankings with reciprocal rank fusion, so both exact terms and paraphrases can surface from a single query.
Full-text & hybrid search: Full-text and hybrid search →The engine runs inside your app process, with no server to deploy. Data stays on the device and the app keeps working offline. Nothing is sent anywhere unless you opt in, for example with the change webhook.
Core concepts: Local-first and embedded →Writes are ACID transactions on redb, a pure-Rust B-tree store. Data persists to a file on native platforms and to OPFS in the browser, with an IndexedDB fallback. Optional AES-GCM-256 encryption at rest.
Encryption: Transactions and persistence →Subscribe to a filter and get fresh results after every matching write. Versioned migrations run when the database opens, so your data model can evolve between app releases.
Live queries: Live queries and migrations →Architecture
Each platform has a thin binding over the same taladb crate, so filters, indexes and search work the same way everywhere. Storage and API style follow each platform's conventions.
JavaScript & TypeScript: one API from taladb
taladbQuickstart
Pick a platform. Each example is the minimal setup from that platform's guide, which covers bundler, build and permission details.
1. Install
pnpm add taladb @taladb/web2. Configure Vite: OPFS needs a cross-origin isolated worker
// vite.config.ts
import { defineConfig } from 'vite'
export default defineConfig({
optimizeDeps: { exclude: ['taladb', '@taladb/web'] },
server: {
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'credentialless',
},
},
})3. Open a database and query
import { openDB } from 'taladb'
const db = await openDB('myapp.db') // persisted to OPFS
const users = db.collection<{ name: string; age: number }>('users')
await users.insert({ name: 'Alice', age: 30 })
const adults = await users.find({ age: { $gte: 18 } })1. Install
pnpm add taladb @taladb/node2. Open a database and query
import { openDB } from 'taladb'
const db = await openDB('./data.db') // parent directory must exist
const products = db.collection<{ name: string; price: number }>('products')
await products.createIndex('price')
await products.insert({ name: 'Widget', price: 9.99 })
const cheap = await products.find({ price: { $lte: 20 } })1. Install (New Architecture, React Native 0.73+)
pnpm add taladb @taladb/react-native
cd ios && pod install2. Initialize once at startup, then use the same API as the web
import { TalaDBModule } from '@taladb/react-native'
import { openDB } from 'taladb'
await TalaDBModule.initialize('myapp.db')
const db = await openDB('myapp.db')
const notes = db.collection<{ body: string; pinned: boolean }>('notes')
await notes.insert({ body: 'Buy milk', pinned: false })
const pinned = await notes.find({ pinned: true })1. Add the dependency (Maven Central, minSdk 24)
// build.gradle.kts — typed collections also need the kotlinx.serialization plugin
dependencies {
implementation("dev.taladb:taladb-android:0.2.3")
}2. Open a database and query: every call is a suspend function
@Serializable
data class Note(
@SerialName("_id") val id: String? = null,
val title: String,
val tags: List<String> = emptyList(),
)
val db = TalaDB.open(context.filesDir.resolve("app.db"))
val notes = db.collection<Note>("notes")
notes.insert(Note(title = "Groceries", tags = listOf("home")))
val home = notes.find(buildJsonObject { put("tags", "home") })1. Add the package (iOS 13+, macOS 10.15+)
.package(url: "https://github.com/taladb/taladb-swift", from: "0.2.3")
// target dependency: .product(name: "TalaDB", package: "taladb-swift")2. Open a database and query: every call is async
import TalaDB
struct Note: Codable, Sendable {
var id: String?
var title: String
var tags: [String] = []
enum CodingKeys: String, CodingKey { case id = "_id", title, tags }
}
let db = try await TalaDB.open(at: url)
let notes = db.collection("notes", as: Note.self)
try await notes.insert(Note(title: "Groceries", tags: ["home"]))
let home = try await notes.find(["tags": "home"])1. Add the crate (Rust 1.90+)
cargo add taladb serde --features serde/derive
cargo add serde_json2. Open a database and query
use serde::{Deserialize, Serialize};
use serde_json::json;
#[derive(Serialize, Deserialize)]
struct Note {
title: String,
done: bool,
}
fn main() -> Result<(), taladb::TalaDbError> {
let db = taladb::open("app.db")?;
let notes = db.typed::<Note>("notes")?;
notes.insert(&Note { title: "Buy groceries".into(), done: false })?;
let open: Vec<Note> = notes.find(json!({ "done": false }))?;
println!("{} open notes", open.len());
Ok(())
}TalaDB is dual-licensed under MIT or Apache-2.0. Read the docs, try a demo, or open an issue or pull request on GitHub.