Nucleus Client
The typed database client that lives in every Neutron SDK. All 14 data models through one API — SQL, KV, Vector, Graph, Time-series, and nine more — idiomatic in whichever language you reach for.
All 14 models. Every language. One API shape.
One mental model, seven runtimes.
Nucleus speaks the PostgreSQL wire protocol, which means you can connect with any Postgres client ever written. The Nucleus Client goes further: a hand-crafted, typed surface for each SDK language that gives you accessors for every non-SQL model too — client.kv(), client.vector(), client.graph(), client.stream(), client.cdc() — idiomatic to the language you're in.
import { nucleus } from "@neutron-build/data";
const db = nucleus(process.env.DATABASE_URL!);
const hits = await db.vector("docs").search(embedding).k(10).execute();
await db.kv("sessions").set(sid, user, { ttl: 3600 });
await db.graph().shortestPath(a, b).limit(5).execute();use neutron_nucleus::NucleusClient;
let db = NucleusClient::connect(&env::var("DATABASE_URL")?).await?;
let hits = db.vector().search("docs", &embedding).k(10).execute().await?;
db.kv().set("sessions", &sid, &user, Some(3600)).await?;
db.graph().shortest_path(a, b).limit(5).execute().await?;import "github.com/neutron-dev/neutron-go/nucleus"
db := nucleus.Connect(os.Getenv("DATABASE_URL"))
hits, _ := db.Vector("docs").Search(emb).K(10).Do(ctx)
db.KV("sessions").Set(ctx, sid, user, nucleus.TTL(3600))
db.Graph().ShortestPath(a, b).Limit(5).Do(ctx)from neutron_py import nucleus
db = await nucleus.connect(os.environ["DATABASE_URL"])
hits = await db.vector("docs").search(embedding).k(10).execute()
await db.kv("sessions").set(sid, user, ttl=3600)
await db.graph().shortest_path(a, b).limit(5).execute()Multi-model atomically.
This is the thing a row-only ORM can't do. Start a transaction, touch four different storage engines inside it, commit — or roll it all back. No two-phase-commit dance between separate services.
let mut tx = db.begin().await?;
let id: i64 = tx.sql()
.query_one("INSERT INTO articles (title) VALUES ($1) RETURNING id", &[&title])
.await?;
tx.vector().insert("articles", id, &embed(&body)).await?;
tx.fts().index("articles", id, &body).await?;
tx.cdc().emit("articles.created", &json!({ "id": id })).await?;
tx.commit().await?; // all four writes land, or noneWhat it's for
Any app that reads or writes to Nucleus. In practice that's every Neutron app, because the SDKs are designed around this client. You can also pull it in standalone — drop @neutron-build/data into a non-Neutron Node app and get typed access to a Nucleus cluster without buying into the framework.
Client vs. ORM
The Client gives you typed accessors and query builders — you're still writing queries by hand, just safely. The ORM (planned) sits on top and generates schema types, handles migrations, and lets you join across models with a fluent surface. Use the Client today; drop in the ORM when it ships.
Part of a bigger system
The Client is Nucleus's front door. Every Neutron SDK wraps it. Every MCP tool in Studio speaks through it. Every migration the CLI runs lands through it. If you're touching a Neutron app, you're touching this API.