nx nodex
Search docs v0.1.0 GitHub

Version 0.1.0

Nodex

Fast, minimal, decorator-first LangGraph agents. Nodex gives Python agent builders the same kind of obvious starting path that Express gave Node developers.

terminal

$ pip install nodex-ai
$ nodex new my-agent
$ cd my-agent
$ nodex dev agent:app
from nodex import Agent

app = Agent(name="hello-agent")

@app.node(next="writer")
def research(state):
    return {"notes": f"Research: {state.get('query')}"}

@app.node(next="end")
def writer(state):
    return {"final": state.get("notes").upper()}

app.run({"query": "agent frameworks"})

Why Nodex

LangGraph power, Express simplicity

Nodex does not replace LangGraph. It removes the boilerplate around it so you can focus on agent logic, not wiring.

@

Decorator-first nodes

Register graph steps with @app.node. Routing, retries, and timeouts live right on the decorator — no separate edge wiring.

One middleware chain

Attach logging, auth checks, metrics, and shared policy once with @app.middleware. Middleware runs in registration order, wrapping every node.

Node-level retries

Set retry=2 and on_fail="fallback" directly on the decorator. No extra exception handlers, no global policy files.

Conditional routing

Use @app.route(condition, if_true, if_false) to branch the graph on state without building a custom router function.

Terminal execution trace

Every run prints a coloured summary: node name, status, duration, token usage, and cost. No extra setup required.

Built-in testing helpers

Test individual nodes in isolation with test_node() and assert_node_output() — no mock graph needed.

58+ Tests passing
0 Vendor lock-in
Python 3.11+ Requirement
MIT License