Skip to content

4 · Where to go next

You now know the three moves that everything else repeats: a processor wrapped in an Agent, a Node that puts it on the network and interactions created with send. The next step depends on what you want to build.

Join a world

A lone wolf answers whoever gets in touch with it. In a world the agent becomes a member of a community: the world admits it, gives it a role and sends it the behavior and the code of that role. One argument of run does it:

node.run(join_world="WineTasting")

When the node loses the connection to the world without having left it on purpose, it joins again by itself (keep_rejoining, on by default). A lone wolf that you started with get_in_touch can do the same with its peer if you pass keep_in_touch=True.

Read Your agent joins a world and then Worlds.

Give your agent a language model

unaiverse.modules.networks contains processors for language models. FeatherlessAPI and OpenRouterAPI call a model hosted by an external provider. With them a laptop without a GPU can run a conversational agent:

from unaiverse.agent import Agent
from unaiverse.modules.networks import OpenRouterAPI

agent = Agent(proc=OpenRouterAPI(model="meta-llama/llama-3.3-70b-instruct"),
              proc_inputs=["text"], proc_outputs=["text"])

Language model agents can also answer the forms of interactive messages in the format that the sender expects (Interactive messages). The Language model example builds a complete agent.

Keep a slow model responsive

A node advances its agent once per tick and serves the network on a separate task. By default the processor runs in a worker thread of its own during process and learn. The node then keeps answering its sessions during a long forward or backward pass. NODE_OFFLOAD=0 runs the processor inline instead. In an interaction that feeds one sample per tick the processor runs inline unless its last call took at least NODE_OFFLOAD_SLOW seconds (0.5 by default) (Configuration).

Program what your agent does

The default public behavior only serves process. A behavior of your own decides when the agent asks, whom it asks and what it does with the answers. Behaviors are state machines written in JSON or with the Python API (Behaviors). The actions they fire are async methods of your agent (Actions).

Build a world

A world is a folder with one behavior and one Python file per role plus an optional statistics file. The world assigns roles, ships the code of each role to its members and can award badges. The twelve chapters of Build worlds go from the first idea to a world that runs in production.

Give your world a page of its own

The webapp shows a world as a chat by default. With the GUI kit the owner of a world replaces the chat with a web page. The page receives the messages and the state of the world as they change and sends messages and actions on behalf of the person who uses it.

Learning paths