nxnodex
Search docs v0.1.0 GitHub

Getting started

Install Nodex and create an agent

Python 3.11+ LangGraph 0.2+

Nodex should feel copy-paste simple. Install the package, scaffold an agent, then run it in dev mode while you edit.

quickstart

$ pip install nodex-ai
$ nodex new research-agent
$ cd research-agent
$ nodex dev agent:app --input '{"query":"AI trends"}'
1. InstallGet the package and CLI into your Python environment.
2. ScaffoldCreate an agent file, env file, and runnable project.
3. RunUse watch mode while building and nodex run for one-shot execution.

Install

Python 3.11 and one package

Start from a virtual environment, install Nodex, then add any LLM provider package your agent needs.

Tip Provider packages stay separate so Nodex does not force one model vendor. Use google-generativeai, openai, anthropic, or any other.

install

$ python --version
Python 3.11+

$ python -m venv .venv
$ source .venv/bin/activate  # Windows: .venv\Scripts\activate

$ pip install nodex-ai

$ # Add your LLM provider separately:
$ pip install google-generativeai

Hello world

The smallest useful Nodex agent

Two nodes, one state key, one run call. This is all you need to get Nodex working.

from nodex import Agent

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

@app.node(next="writer", retry=2)
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": "LangGraph boilerplate"})

Run it and you'll see a trace like this in your terminal:

output

>  nodex running - first-agent
--------------------------------------------------
OK  research       ->  0.001s  |  tokens: 0  |  $0.0000
OK  writer         ->  0.001s  |  tokens: 0  |  $0.0000
--------------------------------------------------
OK  Completed  |  0.002s  |  $0.0000  |  2 nodes  |  0 failed  |  tokens: 0

Troubleshooting

Common first-run issues

No nodes registeredCreate an Agent and decorate at least one function with @app.node before calling app.run().
Node returned empty outputEvery node must return a non-empty dictionary. return {} or return None raises NodexStateError.
Invalid JSON inputCLI --input must be valid JSON, e.g. --input '{"query":"hello"}'.
Provider key missingNodex does not choose an LLM provider. Set the API key required by your model package (e.g. GOOGLE_API_KEY).
nodex command not foundMake sure your virtual environment is activated and you installed nodex-ai inside it.

Next

Where to go from here

Guide Learn nodes, state, middleware, retries, conditional routing, and tracing in depth.
API reference Every parameter, return value, and exception documented in one place.