01
Install NxAgent
Create a virtual environment, then install the package into your project.
python -m venv .venv
source .venv/bin/activate
pip install nx-agent
Follow the shortest path from install to a running workflow.
Create a virtual environment, then install the package into your project.
python -m venv .venv
source .venv/bin/activate
pip install nx-agent
Start with one focused worker. Give it a role and goal that describe the output you want.
from nx_agent import Agent
agent = Agent(
role="Researcher",
goal="Answer clearly in one paragraph",
)
result = agent.run("What is NxAgent?")
print(result)
Decorate a normal Python function with @tool. Type hints and docstrings become the tool schema.
from nx_agent import Agent, tool
@tool
def web_search(query: str) -> str:
"""Search the web for current information."""
... # your implementation
researcher = Agent(
role="Research Analyst",
goal="Find accurate source material",
tools=[web_search],
)
Add another agent when the job naturally splits into stages, such as research and writing.
from nx_agent import Agent, Workflow, tool
@tool
def web_search(query: str) -> str:
"""Search the web for current information."""
... # your implementation
researcher = Agent(
role="Research Analyst",
goal="Collect accurate source material",
tools=[web_search],
)
writer = Agent(
role="Technical Writer",
goal="Turn findings into a clear brief",
)
workflow = Workflow(agents=[researcher, writer])
Run the workflow with a plain task. Use the result object to read final output and inspect traceable steps.
result = workflow.run("Create a short brief on agent observability.")
print(result.output)
print(result.steps)
Once the first run works, move into the docs for configuration, streaming, tool design, and multi-agent workflow patterns.
| Next | Use it for |
|---|---|
| Tool design | Typed arguments, docstrings, and clean return values. |
| Workflows | Sequential, parallel, and dynamic multi-agent patterns. |
| Configuration | Model providers, API keys, logging, and tracing. |
| API reference | The core public objects: Agent, Workflow, and @tool. |