| Drop a star to support Nu ⭐ | Join the Nu Discord community |
Build apps in one primitive that spans your whole stack — databases, UIs, AI agents, and services. No glue. 50x less code.
About • Quick Start • Ecosystem • Spec • Examples • Documentation • Community
Every app is a set of interactions between systems: a database, a UI, AI agents, services. Nu names those interactions directly:
- Ref names what you touch. A KV slot, a UI widget, an LLM endpoint, a memory slot, a remote object.
- Interaction describes what to do with it. Read, write, branch, iterate, compose.
- Fabric binds Refs to a real backend. Swap the Fabric, keep the tree.
Persistence, reactivity, atomicity, observability, and scalability are inherent, not bolted on.
They say a good example is worth 100 pages of API documentation, a million directives, or a thousand words.
Well, "they" probably lie... but here's an example anyway:
import nu
class Counter(nu.Shape):
value: nu.v.IntRef
class Dashboard(nu.ui.Page):
count: nu.ui.TextRef
class App(nu.ui.Index):
pages = nu.ui.Pages({"/": Dashboard})
app = nu.With(
nu.v.rocksdb_navigator(".dbcounter"),
nu.ui.server(
nu.v.auto_flow_atomic(
nu.ReactForever(
Counter.value.on_change(),
Dashboard.count.set(Counter.value),
),
),
),
body=nu.v.auto_flow_atomic(
nu.IfDo(Counter.value.missing(), Counter.value.set(0))
>> nu.ForeverDo(
Counter.value.inc() >> nu.Delay(1.0),
)
),
)
if __name__ == "__main__":
import asyncio
asyncio.run(nu.arun(app))A dashboard on a live counter that persists across restarts. One Nu tree, two Fabrics. Kill it, run again, it picks up where it left off.
Python 3.12+.
pip install "nustack-py[all]"For lean installs and source builds see nustack.dev/docs/how-to/install.
Save the snippet above as app.py, then:
python app.pyOpen the browser tab that pops up — the counter ticks once a second, the dashboard mirrors it live.
More in examples/. Full walkthrough at nustack.dev/docs.
Each fabric binds Refs to a real backend and unlocks a new capability.
| Fabric | What |
|---|---|
nu.mem |
In-memory state fabric. Perfect for cache, hot state, and in-process coordination. |
nu.v |
Persistent state fabric. Refs over a KV backend (RocksDB, LMDB); transactions, snapshots, and change notifications, built in. |
nu.ui |
Web UI fabric. Same fabric shape as the others, but the Refs are widgets — text, buttons, tables — rendered in the browser and live-updated as your state changes. |
nu.invisibles |
Network fabric. Puts other fabrics on the network — bind a fabric in one process, use it from another; same Refs, same interactions, over TCP or Unix socket. |
nu.ray |
Cluster compute fabric. Teleport a Nu tree to any worker in your Ray cluster; it runs there and returns the result. |
End-user tools written as Nu programs.
| Repo | What |
|---|---|
| nustackdev/nulog | Pure-Python, serverless logger and metrics store. Log and observe metrics from any Python code; entries persist to an embedded KV store and scale to billions, in-process. One line boots a live viewer. |
Nu is a reference implementation of the interaction model — a language-agnostic specification of what an interaction is, how Refs name locations, and how Interactions compose into programs.
TODO.
Add a Nu badge to your README if you're building on Nu:
[](https://github.com/nustackdev/nu)
Considering contributing to Nu? Start by opening an issue or a PR — the codebase is small and readable, and the model is stable enough to build on.
Apache-2.0