Runs in your browser. Zero backend required.
Democratizing AI databases for frontend developers
Browser-Native | Graph + Vector Hybrid | No Server Costs | 2.4 MB Memory
| Section | Description |
|---|---|
| π― Why LatticeDB? | The problem we solve |
| β‘ Performance | Benchmark results vs Qdrant & Neo4j |
| πͺΆ Ultra-Low Footprint | 2.4 MB memory, ~500 KB WASM |
| 𧬠What is a Hybrid Database? | Vector-attributed graph theory |
| Β Β Β β³ Data Representation | The Point struct |
| Β Β Β β³ Mathematical Definition | Formal graph theory |
| π Why Hybrid? | Benefits of unified architecture |
| β¨ Features | Hybrid graph/vector, platform support |
| π‘ Use Cases | RAG, knowledge graphs, AI assistants |
| π Quick Start | Installation & first steps |
| ποΈ Architecture | SBIO pattern & crate structure |
| π‘οΈ ACID Durability | WAL, crash recovery, storage modes |
| βοΈ Optimizations | 8 state-of-the-art techniques |
| π API Reference | REST endpoints |
| πΊοΈ Roadmap | What's next |
| π¬ Research | Papers we build on |
| β FAQ | Common questions answered |
| π€ Contributing | How to help |
| π License | MIT License |
LatticeDB is the only database that lets you run production-grade vector search AND graph queries entirely in the browser.
| Problem | Traditional Solution | LatticeDB Solution |
|---|---|---|
| RAG for web apps | Pay for hosted vector DB | Run RAG in the frontend |
| Knowledge graphs | Host Neo4j/Qdrant server | Zero backend required |
| Single-user apps | Server for each user | Data stays on client |
| Network latency | Round-trips to backend | Sub-millisecond local access |
- π€ LLM app developers - Build RAG-powered apps without server costs
- π Frontend developers - Add semantic search to any web app
- π Startups - Ship faster without infrastructure overhead
- π Privacy-conscious apps - Data never leaves the user's browser
Optimized for small to medium datasets - the sweet spot for browser-based applications.
LatticeDB shines for datasets typical in frontend applications:
- Vectors: 1K - 50K points (RAG contexts, document collections, user embeddings)
- Graphs: 1K - 10K nodes (knowledge graphs, relationship data, user networks)
At these scales, LatticeDB dramatically outperforms server-based solutions by eliminating network latency and running entirely in-process.
Benchmark: 1,000 vectors, 128 dimensions, cosine distance
| Operation | LatticeDB In-MemoryΒΉ | LatticeDB HTTPΒ² | Qdrant HTTP |
|---|---|---|---|
| Search | 84 Β΅s | 168 Β΅s | 330 Β΅s |
| Upsert | 0.76 Β΅s | 115 Β΅s | 287 Β΅s |
| Retrieve | 2.2 Β΅s | β | 306 Β΅s |
| Scroll | 18 Β΅s | β | 398 Β΅s |
ΒΉ In-memory applies to browser/WASM deployments (no network overhead) Β² HTTP server uses simd-json, Hyper with pipelining, TCP_NODELAY
LatticeDB wins in ALL deployment modes: In-memory is 4-400x faster. Even LatticeDB HTTP is 2-2.5x faster than Qdrant HTTP.
Benchmark: 1,000 nodes with labels and properties, Cypher queries
| Operation | LatticeDB In-MemoryΒΉ | LatticeDB HTTPΒ² | Neo4j Bolt |
|---|---|---|---|
MATCH (n) RETURN n LIMIT 100 |
74 Β΅s | 85 Β΅s | 1,147 Β΅s |
MATCH (n:Person) RETURN n LIMIT 100 |
72 Β΅s | 110 Β΅s | 816 Β΅s |
MATCH (n:Person) RETURN n LIMIT 10 |
12 Β΅s | 72 Β΅s | 596 Β΅s |
ORDER BY n.name LIMIT 50 |
120 Β΅s | 173 Β΅s | 889 Β΅s |
WHERE n.age > 30 RETURN n |
619 Β΅s | 965 Β΅s | 3,136 Β΅s |
ΒΉ In-memory applies to browser/WASM deployments (no network overhead) Β² HTTP server uses Hyper with pipelining, TCP_NODELAY
LatticeDB wins ALL graph operations: In-memory is 5-78x faster. Even LatticeDB HTTP is 3-13x faster than Neo4j Bolt.
| Dataset Size | LatticeDB Advantage | Recommendation |
|---|---|---|
| < 10K | Excellent (10-100x faster) | Ideal for browser/embedded use |
| 10K - 50K | Good (2-10x faster) | Still great for single-user apps |
| > 50K | Diminishing | Consider dedicated vector DB for large datasets |
For datasets exceeding 50K elements, server-based solutions like Qdrant or Neo4j may offer better performance due to their optimized indexing for large-scale workloads.
LatticeDB HTTP server optimization is ongoing:
- SIMD-accelerated JSON parsing (simd-json)
- Zero-copy request/response handling
- Connection pipelining (HTTP/1.1)
- Response streaming for large results
- Binary protocol support (gRPC/protobuf)
Our primary focus remains in-memory performance for browser/WASM deployments where LatticeDB excels.
LatticeDB is engineered for minimal resource consumption:
| Platform | Metric | Size |
|---|---|---|
| Native | Runtime Memory (RSS) | 2.4 MB |
| Browser (WASM) | Bundle Size (gzip) | ~500 KB |
| Browser (WASM) | Runtime Memory | ~2-3 MB |
Why this matters:
- πΎ Runs on low-end devices and mobile browsers
- β‘ Instant startup - no JVM warmup or heavy initialization
- π± Ideal for PWAs and offline-first applications
- π Fast download and parse time in browsers
Compare this to typical database footprints:
- PostgreSQL: ~20-50 MB baseline
- MongoDB: ~100-200 MB baseline
- Neo4j: ~500+ MB (JVM-based)
- Qdrant: ~50-100 MB baseline
LatticeDB delivers full vector + graph database capabilities in under 3 MB.
LatticeDB implements a vector-attributed graph β a data structure where each node combines the properties of both vector databases and graph databases:
| Component | Description | Use Case |
|---|---|---|
| Vector | High-dimensional embedding ( |
Semantic similarity search |
| Payload | Key-value metadata | Filtering and storage |
| Edges | Directed, weighted connections | Relationship traversal |
This unified model eliminates the need for separate databases while enabling powerful hybrid queries.
Each point in LatticeDB is represented by the following structure:
pub struct Point {
pub id: PointId, // u64 - unique identifier
pub vector: Vector, // Vec<f32> - embedding
pub payload: HashMap<String, Vec<u8>>, // metadata
pub outgoing_edges: Option<SmallVec<[Edge; 4]>>, // graph links
pub label_bitmap: u64, // O(1) label checks
}
pub struct Edge {
pub target_id: PointId, // destination node
pub weight: f32, // similarity/strength
pub relation_id: u16, // relationship type
}Formally, LatticeDB implements a Vector-Attributed Graph defined as:
Where:
| Symbol | Definition |
|---|---|
| Set of vertices | |
| Set of directed edges | |
| Vector embedding function | |
| Attribute function (key-value pairs) | |
| Edge weight function |
Each vertex
Key operations derive from this structure:
| Operation | Mathematical Form | Complexity |
|---|---|---|
| Vector Search |
|
|
| Graph Traversal |
|
|
| Hybrid Query | Vector search |
This is what makes LatticeDB unique: a single data structure that supports both
$O(\log n)$ approximate nearest neighbor search and$O(k)$ graph traversal, unified in one ~500 KB WASM bundle.
One library for everything your frontend needs.
Modern AI-powered applications require multiple database capabilities:
| Capability | Traditional Approach | LatticeDB Approach |
|---|---|---|
| Semantic Search | Vector DB (Pinecone, Qdrant) | β Built-in HNSW |
| Knowledge Graphs | Graph DB (Neo4j, Dgraph) | β Built-in Cypher |
| Document Storage | Key-Value DB (Redis, DynamoDB) | β Built-in Payload |
| Relationship Queries | SQL or Graph DB | β Built-in Traversal |
- π Single Dependency - One import, not three separate databases
- π― Unified Queries - Vector similarity + graph traversal in one query
- π¦ Smaller Bundle - ~500 KB WASM vs multiple large dependencies
- π§ Simpler Mental Model - Points have vectors, payloads, AND relationships
- β‘ Zero Network Hops - No coordination between services
- π° No Server Costs - Everything runs client-side
// Find semantically similar documents AND their related concepts
const similar = await db.search({ vector: queryEmbedding, limit: 10 });
const related = await db.query(`
MATCH (doc:Document)-[:REFERENCES]->(concept:Concept)
WHERE doc.id IN $docIds
RETURN DISTINCT concept.name
`, { docIds: similar.map(r => r.id) });With separate databases, this requires:
- Query vector DB for similar documents
- Query graph DB for relationships
- Coordinate results between two systems
- Handle different data models and APIs
With LatticeDB, it's one library with unified data.
The only embedded database that combines:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LatticeDB β
β βββββββββββββββββββββββββ βββββββββββββββββββββββββ β
β β Vector Engine β β Graph Engine β β
β β βββββββββββββββββ β β βββββββββββββββββ β β
β β β’ HNSW Index β β β’ BFS/DFS Traversal β β
β β β’ SIMD Distance βββββΊβ β’ Cypher Queries β β
β β β’ Product Quant. β β β’ Weighted Edges β β
β β β’ Scalar Quant. β β β’ Relation Types β β
β βββββββββββββββββββββββββ βββββββββββββββββββββββββ β
β β² β
β β β
β Hybrid Queries β
β "Find similar vectors AND their neighbors" β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Platform | Status | SIMD Support |
|---|---|---|
| π Browser (WASM) | Production | SIMD128 |
| π§ Linux x86_64 | Production | AVX2/AVX-512 |
| π macOS Apple Silicon | Production | ARM NEON |
| πͺ Windows x86_64 | Production | AVX2 |
- π Qdrant REST API - Drop-in replacement, use existing SDKs
- π Cypher Query Language - Neo4j-compatible graph queries
- π΄ Service Worker - Offline-first browser operation (coming soon)
Build LLM-powered apps that run entirely in the browser:
import { LatticeDB } from 'lattice-db';
// Initialize in browser
const db = await LatticeDB.init();
await db.createCollection('knowledge', { dimension: 384 });
// User uploads documents β embed β store locally
for (const doc of userDocuments) {
const embedding = await embed(doc.text); // Local or API
await db.upsert('knowledge', [{
id: doc.id,
vector: embedding,
payload: { text: doc.text, source: doc.source }
}]);
}
// RAG query - zero network latency
const context = await db.search('knowledge', queryEmbedding, 5);
const answer = await llm.generate(query, context);Benefits:
- π° No server costs for vector storage
- πΎ Data persists in IndexedDB/OPFS
- π΄ Works offline
- β‘ Sub-millisecond search latency
Combine graph relationships with vector similarity:
// Find similar concepts AND their related entities
MATCH (concept:Concept)-[:RELATED_TO]->(related)
WHERE vector_similarity(concept.embedding, $query) > 0.8
RETURN concept, related
ORDER BY vector_similarity(concept.embedding, $query) DESC
LIMIT 10Build apps where user data stays on their device:
// All data stored locally in browser
const memories = await db.search('memories', currentContext, 10);
const response = await assistant.respond(userMessage, memories);
// Add new memory
await db.upsert('memories', [{
id: Date.now(),
vector: await embed(response),
payload: { conversation: userMessage, response }
}]);# Clone the repository
git clone https://github.com/Avarok-Cybersecurity/lattice-db.git
cd lattice-db
# Build release binary
cargo build --release -p lattice-server
# Run the server (Qdrant-compatible API)
cargo run --release -p lattice-serverfrom qdrant_client import QdrantClient
from qdrant_client.models import Distance, VectorParams, PointStruct
# Connect to LatticeDB (Qdrant-compatible)
client = QdrantClient(host="localhost", port=6333)
# Create collection
client.create_collection(
collection_name="my_vectors",
vectors_config=VectorParams(size=128, distance=Distance.COSINE),
)
# Insert vectors
client.upsert(
collection_name="my_vectors",
points=[
PointStruct(id=1, vector=[0.1] * 128, payload={"category": "A"}),
PointStruct(id=2, vector=[0.2] * 128, payload={"category": "B"}),
]
)
# Search
results = client.query_points(
collection_name="my_vectors",
query=[0.15] * 128,
limit=10,
)import { LatticeDB } from 'lattice-db';
const db = await LatticeDB.init();
await db.createCollection('vectors', { dimension: 128 });
await db.upsert('vectors', [{ id: 1, vector: new Float32Array(128) }]);
const results = await db.search('vectors', queryVector, 10);// Create nodes with vectors
CREATE (p:Person {name: 'Alice', embedding: [0.1, 0.2, ...]})
CREATE (p:Person {name: 'Bob', embedding: [0.3, 0.4, ...]})
// Create relationships
MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'})
CREATE (a)-[:KNOWS {since: 2020}]->(b)
// Query with filters
MATCH (p:Person)-[:KNOWS]->(friend)
WHERE p.age > 25
RETURN p.name, friend.name
ORDER BY p.name
LIMIT 10
// Hybrid: vector similarity + graph traversal
MATCH (p:Person)-[:KNOWS*1..2]->(fof)
WHERE vector_similarity(p.embedding, $query) > 0.8
RETURN DISTINCT fof.namelattice-db/
βββ crates/
β βββ lattice-core/ # Core engine (HNSW, Cypher, SIMD)
β β βββ engine/ # Collection management
β β βββ index/ # HNSW, ScaNN, distance functions
β β βββ cypher/ # Cypher parser & executor
β β βββ types/ # Point, Query, Config types
β β
β βββ lattice-server/ # HTTP server & API
β β βββ handlers/ # REST endpoint handlers
β β βββ router.rs # Qdrant-compatible routing
β β
β βββ lattice-wasm/ # Browser WASM bindings
β βββ lib.rs # JavaScript API
Separation of Business Logic and I/O - Core engine never touches filesystem or network.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Transport Layer β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Axum HTTP β β Service β β WASM β β
β β Server β β Worker β β Browser β β
β ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ β
βββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LatticeDB Core Engine β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β HNSW β β Cypher β β Graph β β Filter β β
β β Index β β Parser β β Ops β β Engine β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Storage Layer β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Memory β β MMap β β IndexedDB β β
β β HashMap β β Files β β OPFS β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
LatticeDB supports durable, crash-safe storage via a Write-Ahead Log (WAL) and pluggable storage backends. Data integrity is not optional β it is built into the engine.
| Mode | Backend | Durability | Use Case |
|---|---|---|---|
| Ephemeral | In-memory only | None (process lifetime) | Browser/WASM, testing, caches |
| Durable | DiskStorage + WAL |
Full ACID | Server deployments, persistent data |
Every mutation is written to the WAL before it is applied to the main store. On crash or restart, the WAL replays uncommitted entries to restore consistent state.
Client Write
β
βΌ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Append to ββββββΊβ Apply to ββββββΊβ fsync() β
β WAL page β β in-memory β β storage β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β
βΌ (on restart)
βββββββββββββββ
β Replay WAL β
β entries β
βββββββββββββββ
Crash safety guarantee: if a write is acknowledged, it survives process crashes. If a crash occurs mid-write, recovery replays from the last known-good WAL state β orphaned page data is unreachable and overwritten on next rotation.
LatticeDB includes a dedicated ACID test suite (lattice-test-harness + integration tests) covering:
| Test Category | What It Verifies |
|---|---|
| Crash recovery | Data survives simulated process crashes at every WAL phase |
| Page rotation | WAL rotates pages without data loss under concurrent writes |
| I/O failures | Storage errors propagate correctly, never corrupt state |
| Engine lifecycle | Open β write β close β reopen β read back intact |
| Stress ordering | Concurrent upserts maintain consistency under contention |
# Run the full ACID test suite
cargo test --workspace -- aciduse lattice_storage::DiskStorage;
let storage = DiskStorage::with_defaults("/var/lib/lattice/my_collection".into());
storage.init().await?;
// Pass storage to the engine β WAL is enabled automaticallyFor browser deployments, LatticeDB runs in ephemeral mode (IndexedDB/OPFS persistence is handled separately by the WASM layer).
LatticeDB implements 8 state-of-the-art optimizations:
| Optimization | Technique | Impact |
|---|---|---|
| β‘ SIMD Distance | AVX2/NEON/SIMD128 | 4-8x faster cosine |
| π HNSW Shortcuts | VLDB 2025 paper | Skip redundant layers |
| π§΅ Thread-Local Scratch | Pre-allocated pools | 10-20% faster search |
| π¦ Product Quantization | ScaNN-style | 64x compression |
| πΎ Memory Mapping | Zero-copy access | Large dataset support |
| π Async Indexing | Background HNSW updates | Non-blocking upserts |
| π Batch Search | Parallel with rayon | High throughput |
| ποΈ Scalar Quantization | int8 vectors | 4x memory reduction |
| Endpoint | Method | Description |
|---|---|---|
/collections |
GET | List all collections |
/collections/{name} |
PUT | Create collection |
/collections/{name} |
GET | Get collection info |
/collections/{name} |
DELETE | Delete collection |
| Endpoint | Method | Description |
|---|---|---|
/collections/{name}/points |
PUT | Upsert points |
/collections/{name}/points |
POST | Get points by IDs |
/collections/{name}/points/delete |
POST | Delete points |
/collections/{name}/points/scroll |
POST | Paginate points |
| Endpoint | Method | Description |
|---|---|---|
/collections/{name}/points/search |
POST | Vector search |
/collections/{name}/points/query |
POST | Query (Qdrant v1.16+) |
/collections/{name}/points/search/batch |
POST | Batch search |
| Endpoint | Method | Description |
|---|---|---|
/collections/{name}/export |
GET | Export collection as binary |
/collections/{name}/import?mode={mode} |
POST | Import collection (create/replace/merge) |
| Endpoint | Method | Description |
|---|---|---|
/collections/{name}/graph/edges |
POST | Add edge between points |
/collections/{name}/graph/traverse |
POST | Traverse graph from point |
/collections/{name}/graph/query |
POST | Execute Cypher query |
- HNSW index with shortcuts (VLDB 2025)
- SIMD distance (AVX2, NEON, WASM SIMD128)
- Cypher query language
- Product Quantization (ScaNN-style)
- Qdrant API compatibility
- WASM browser support
- npm package (
lattice-db) - IndexedDB/OPFS persistence
- Hybrid vector+graph queries
- Data migrator tool (import from Qdrant/Neo4j)
- Payload & metadata encryption (AES-256)
- npm package improvements & documentation
| Feature | Impact |
|---|---|
| FP16 Quantization | 2x memory reduction |
| Binary Vectors | 48% faster Hamming |
| IVF-PQ Hybrid | Billion-scale support |
| DiskANN/Vamana | SSD-based indexing |
LatticeDB incorporates techniques from cutting-edge research:
| Paper/Project | Contribution |
|---|---|
| HNSW | Hierarchical graph index |
| ScaNN | Anisotropic quantization |
| VLDB 2025 Shortcuts | Layer skip optimization |
| SimSIMD | SIMD best practices |
π· I just want a graph database. Does LatticeDB support that?
Yes! LatticeDB is a fully-featured graph database with Cypher query support. You can use it purely as a graph DB without touching vectors:
// Create nodes
CREATE (alice:Person {name: 'Alice', age: 30})
CREATE (bob:Person {name: 'Bob', age: 25})
// Create relationships
MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'})
CREATE (a)-[:FRIENDS_WITH {since: 2020}]->(b)
// Query relationships
MATCH (p:Person)-[:FRIENDS_WITH]->(friend)
RETURN p.name, friend.nameThe vector field is optional - just don't include it and you have a lightweight graph database.
πΆ I just want a vector database. Can I use LatticeDB for that?
Also yes! LatticeDB implements the Qdrant REST API, so you can use it as a pure vector database:
from qdrant_client import QdrantClient
client = QdrantClient(host="localhost", port=6333)
client.create_collection("my_vectors", vectors_config={"size": 128, "distance": "Cosine"})
client.upsert("my_vectors", points=[...])
results = client.search("my_vectors", query_vector=[...], limit=10)The graph features (edges, Cypher) are optional - simply don't use them and you have a fast vector database.
π Can I use an existing Qdrant client to connect to LatticeDB?
Yes! LatticeDB implements the Qdrant REST API, so any Qdrant client works out of the box:
- β
Python:
qdrant-client - β
JavaScript/TypeScript:
@qdrant/js-client-rest - β
Go:
qdrant-go - β
Rust:
qdrant-client
Just point your client to LatticeDB instead of Qdrant:
# Instead of: QdrantClient(host="your-qdrant-server")
client = QdrantClient(host="localhost", port=6333) # LatticeDBSee the Quick Start section for a complete example.
π Do Cypher commands from Neo4j work with LatticeDB?
Yes! LatticeDB supports standard Cypher query language:
// All these work in LatticeDB
MATCH (n:Label) RETURN n
MATCH (a)-[r:RELATION]->(b) WHERE a.prop = 'value' RETURN a, b
CREATE (n:Person {name: 'Alice'})
MATCH (a), (b) WHERE a.id = 1 AND b.id = 2 CREATE (a)-[:KNOWS]->(b)
MATCH (n) WHERE n.age > 25 RETURN n ORDER BY n.name LIMIT 10LatticeDB's Cypher parser handles MATCH, WHERE, RETURN, CREATE, ORDER BY, LIMIT, and relationship traversals.
β‘ Why is LatticeDB faster than both Qdrant and Neo4j?
Several architectural advantages combine to make LatticeDB faster:
| Factor | Impact |
|---|---|
| No network overhead | In-browser/embedded = zero RTT latency |
| No JVM | Native Rust vs Neo4j's Java runtime |
| SIMD acceleration | AVX2/NEON/WASM SIMD128 for distance calculations |
| In-process execution | No serialization/deserialization between client and server |
| Optimized for small-medium data | Algorithms tuned for 1K-50K points |
| Zero-copy operations | Memory-mapped files, direct data access |
For browser deployments, eliminating the network round-trip alone provides 100x+ speedup compared to hosted databases.
π How can you possibly run a database in a browser?
100% Rust compiled to WebAssembly (WASM).
Rust Source Code
β
wasm-pack
β
WebAssembly Module (~500 KB gzipped)
β
Runs in Browser with near-native speed
Key technologies that make this possible:
- Rust β WASM: The entire codebase compiles to WASM with zero JavaScript
- WASM SIMD128: Browser-native SIMD for fast vector operations
- IndexedDB/OPFS: Persistent storage APIs for durability
- Web Workers: Background indexing without blocking the UI
The same code runs natively (Linux/macOS/Windows) and in browsers - true write-once, run-anywhere.
π How do I migrate from Neo4j or Qdrant to LatticeDB?
We're working on a data migration tool! π§
The planned migrator will support:
- Qdrant β LatticeDB: Export collections and import via the compatible API
- Neo4j β LatticeDB: Export Cypher dumps and replay CREATE statements
For now, you can manually migrate by:
- Exporting data from your source database
- Using LatticeDB's API to import (Qdrant client for vectors, Cypher for graphs)
Stay tuned! Follow the GitHub repo for migration tool updates.
πΎ Where is data stored when running in the browser?
LatticeDB uses browser-native storage APIs:
| Storage | Use Case | Capacity |
|---|---|---|
| IndexedDB | Persistent key-value storage | ~50% of free disk |
| OPFS | File system API (faster) | ~50% of free disk |
| Memory | Temporary/ephemeral mode | Limited by browser |
Data persists across browser sessions and survives page refreshes. For OPFS, data is sandboxed per-origin (your domain only).
π΄ Does LatticeDB work offline?
Yes! LatticeDB is designed for offline-first applications:
- β All operations run locally - no server required
- β Data persists in IndexedDB/OPFS
- β Perfect for PWAs (Progressive Web Apps)
- β Works on airplane mode, spotty connections, etc.
Once the WASM module and your data are loaded, LatticeDB requires zero network connectivity.
π₯οΈ Can I host LatticeDB on a centralized server?
Absolutely! LatticeDB has blazing-fast native support for server deployments:
# Run as a server (Qdrant-compatible API)
cargo run --release -p lattice-server
# Listening on http://localhost:6333This is perfect for:
- π Multi-user real-time sync - All clients connect to the same server
- π’ Enterprise deployments - Central data management and access control
- π Larger datasets - Server has more memory than browser tabs
- π Sensitive data - Keep vectors and payloads on infrastructure you control
You get the same API whether running in-browser (WASM) or on a server (native) - same code, same queries, flexible deployment.
β οΈ When should I NOT use LatticeDB?
Consider alternatives when:
| Scenario | Why | Alternative |
|---|---|---|
| Massive datasets (>100K vectors) | Browser memory limits, indexing time | Hosted Qdrant, Pinecone |
| Strict data centralization | LatticeDB runs on client devices | Traditional server DB |
| Sensitive IP in vectors | Data lives on user's device | Server-side vector DB |
However, many "centralized" use cases still work great:
// App downloads latest embeddings from your server on startup
const latestData = await fetch('/api/knowledge-base');
await db.import('knowledge', latestData);
// Now queries run locally - fast & free!This pattern gives you centralized data synchronicity without paying for compute - clients do all the heavy lifting. Great for knowledge bases, documentation, product catalogs, etc.
π Does LatticeDB have at-rest encryption?
Not yet, but it's coming soon!
We're working on encryption support for:
- π Payload encryption - Encrypt the metadata stored with each point
- π Metadata encryption - Encrypt collection and point metadata
Note: Vector encryption is not planned - vectors must remain unencrypted for similarity search to work. If your embeddings contain sensitive information, consider using privacy-preserving embedding techniques.
For now, if you need encryption, consider:
- Encrypting sensitive payload fields before inserting
- Using the browser's Web Crypto API for client-side encryption
- Running in a secure context (HTTPS only)
Stay tuned! Payload encryption is on the roadmap.
π€ Why hasn't anyone built this before?
Great question! Here's our totally scientific analysis:
graph TD
A[π€ Want a browser database?] --> B{Just use SQLite?}
B -->|But I need vectors| C{Use a hosted DB?}
C -->|But latency...| D{Build it yourself?}
D -->|In Rust?| E{Compile to WASM?}
E -->|With SIMD?| F{And graph support?}
F -->|Yes to all| G[π You built LatticeDB!]
B -->|OK fine| H[π΄ Normal Developer]
C -->|Sure| H
D -->|Nope| H
E -->|Too hard| H
F -->|Why bother| H
style G fill:#90EE90
style H fill:#FFB6C1
Real talk: it required several technologies to mature simultaneously:
- WASM SIMD - Only standardized in 2021
- OPFS - File system API for browsers, relatively new
- Rust ecosystem -
wasm-pack,wasm-bindgenneeded to mature - Someone crazy enough - To think "what if Neo4j but in a browser?" π€ͺ
We're just built different. (And by "different" we mean "slightly unhinged Rust developers who think everything should compile to WASM.")
We welcome contributions!
# Run tests
cargo test --all
# Run WASM tests (requires Chrome)
wasm-pack test --headless --chrome crates/lattice-core
# Run benchmarks
cargo bench -p lattice-benchπ Contributing guide
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Built with π¦ Rust for the AI-native future
The database that runs where your users are