uni-db 1.0.0

Embedded graph database with OpenCypher queries, vector search, and columnar storage
Documentation

Uni - Embedded Graph Database

Crates.io Documentation License

Uni is an embedded, multimodal database that combines Property Graph (OpenCypher), Vector Search, and Columnar Storage (Lance) into a single engine. It is designed for high-performance, local-first applications with object storage durability (S3/GCS).

Part of The Rustic Initiative by Dragonscale Industries Inc.

Features

  • Embedded: Runs in-process with your application (no sidecar required).
  • Multimodal: Graph + Vector + Columnar in one engine.
  • OpenCypher: Execute complex graph pattern matching queries.
  • Vector Search: Native support for vector embeddings and KNN search.
  • Hybrid Storage: Fast local WAL/ID allocation with bulk data + catalog metadata in S3/GCS.
  • Graph Algorithms: Built-in PageRank, WCC, ShortestPath, and more.

Installation

Add uni to your Cargo.toml:

[dependencies]
uni = "0.1.0"
tokio = { version = "1", features = ["full"] }

Quick Start

1. Open Database

use uni_db::Uni;

#[tokio::main]
async fn main() -> Result<(), uni_db::UniError> {
    // Open (or create) a local database
    let db = Uni::open("./my_graph_db")
        .build()
        .await?;
    
    // Define Schema
    db.schema()
        .label("Person")
            .property("name", uni_db::DataType::String)
            .property("age", uni_db::DataType::Integer)
            .vector("embedding", 384) // Vector index
        .apply()
        .await?;

    Ok(())
}

2. Insert Data

You can insert data using Cypher queries or the builder API.

// Using Cypher
db.query("CREATE (p:Person {name: 'Alice', age: 30})").await?;

// Using Builder (faster for bulk)
use uni_db::PropertiesBuilder;
// ... (Bulk API usage if available or via loops)

3. Query Data

let results = db.query("MATCH (p:Person) WHERE p.age > 25 RETURN p.name, p.age").await?;

for row in results {
    let name: String = row.get("p.name")?;
    let age: i64 = row.get("p.age")?;
    println!("Found: {} ({})", name, age);
}

4. Vector Search

// Find similar nodes
let query_vec = vec![0.1, 0.2, ...]; // 384 dims
let results = db.query_builder()
    .knn("Person", "embedding", query_vec)
    .k(5)
    .execute()
    .await?;

Storage Backends

Uni supports local filesystem and object storage (S3, GCS, Azure).

Hybrid Mode (Recommended for Cloud)

Keep WAL and ID allocation on fast local disk (SSD), while storing bulk data and catalog metadata in S3.

let db = Uni::open("./local_meta")
    .hybrid("./local_meta", "s3://my-bucket/graph-data")
    .build()
    .await?;

Documentation

License

Apache 2.0 - see LICENSE for details.


Developed by Dragonscale Industries Inc. as part of The Rustic Initiative.