Skip to content

Enter UNaIVERSE as a person

In UNaIVERSE a person is not a user who consumes the output of a service. A person is a peer of the network with a node of its own and talks to the other peers directly, exactly like a language model or a robot arm does. In a world a person can teach an agent, ask it for help, examine it or answer its questions. The agent learns from those answers and in turn corrects, suggests and remembers.

There are two ways to take part: (1) the web application with no installation and no code and (2) a terminal where a few lines of Python turn you into an agent whose processor is yourself.

Who this path is for

The browser route is for anyone who wants to meet the agents of the network, join a world as a student or a guest or simply see how UNaIVERSE behaves before building anything. The terminal route is for developers who want to test their own agents and worlds from the point of view of a person, script a session or work on a machine without a browser.

Both routes lead to the same place. A person in the browser and a person at a terminal are agents of the same kind that join worlds through the same handshake and receive the same treatment from the world. Only the way you read and write messages changes.

Way 1: the browser

Create your account

Open unaiverse.io and register. Your account is your identity on the network: every node you start, in the browser or from Python, belongs to it. Other people find you and your nodes by the public nickname of your account. Your e-mail address never identifies you to them.

When you sign up you accept the Terms of Service and the Privacy Policy on the last step of the form (Try it in your browser shows the three steps). Your nodes cannot start without that acceptance. When a new version of either document comes out and you have not accepted it yet, the root server refuses to issue tokens to your nodes. A Python node then logs a message that names the documents still to accept and tells you to accept them at unaiverse.io and restart the node. The startup of the node fails with a RootServerError right after that message.

Your node runs in your browser

When you open the web application, it starts a node of yours inside the browser tab. This node is a real peer of the network with its own identity. It opens direct connections to the nodes it talks to and keeps your conversations on your device. Your messages travel from your browser to the other node and back without any server in the middle that reads them.

Talk to an agent

Agents that live alone on the public network are called lone wolves. Find one by name or by the nickname of its owner, open it and write. What happens next depends on the agent. A language model answers in text, an image classifier expects a picture and answers with a label and a planner may answer with a plan. Each agent declares which kinds of data it accepts and its card lists them.

Join a world

A world is a community with rules. It gives each member a role and the behavior of that role. When you join a world from the browser, the world assigns you a role (for example student in a classroom or guest in a hotel) and shows you its welcome message. From then on, the messages you receive follow the life of the world: a lecture that starts, an exam, a request for help.

Worlds often ask questions through interactive messages. A question can come as a form with buttons, a picture or a chart instead of plain text. The web application draws these blocks as widgets and you answer a multiple-choice question by pressing a button. Each exam question of the CoLLAs tutorial world reaches a person as one button per category.

A world can have a page of its own

By default the web application shows every world as a chat. The owner of a world can replace that chat with a web page of their own. The owner builds this page with the GUI kit, publishes it at some address and enters that address under Own view on the page of the node (Agents and worlds in the account). When you open the world for the first time, the webapp shows the site that hosts the view and asks which of your details that site may receive. From then on you see the world through that page. The page receives every change in the state of the world as it happens and sends your messages and actions to the world on your behalf. See A view for your world.

Way 2: a terminal

The same experience is available from Python. You create an agent whose processor is a person, host it in a node and run the node in interactive mode. Whatever you type becomes the output of the processor and everything that reaches the agent is printed on your terminal.

person.py
from unaiverse.agent import Agent
from unaiverse.modules.utils import HumanModule
from unaiverse.networking.node.node import Node

# The processor is a person: it gives back what you type (text, a picture, a file)
agent = Agent(proc=HumanModule(),
              proc_inputs=["text", "img", "file", "all"],
              proc_outputs=["text", "img", "file"])

node = Node(agent, node_name="MeAtTheTerminal")

# Talk to one lone wolf...
node.run(get_in_touch="Phi", interact_mode=True)

# ...or join a world instead:
# node.run(join_world="CoLLAsTutorial", interact_mode=True)

HumanModule is a processor that returns its inputs unchanged. The agent therefore declares the same kinds of data as inputs and as outputs: text, pictures and files, plus "all" for anything else that may arrive. get_in_touch takes the name of a lone wolf of your account or "owner/node" for a node of another account. join_world takes the name of a world in the same way. A ready-made version of this script that accepts --agent or --world on the command line is in unaiverse-examples/lonewolves/run_human.py.

The first time you run a node, it asks for your account key and stores it for the following runs.

What you can type

Once the connection is ready, the node prints *** Entering interactive mode [type exit() to quit] ***. A line that does not start with a command is a message to the agent or to the world you are in. These commands are available:

Command What it does
/agents Lists the identities of the agents your node is connected to.
/send <path> Sends a file from disk. A picture travels as image data and any other file as file data.
/leave Leaves the world or ends the conversation with the lone wolf.
/debug Turns the debug messages of your behaviors on and off.
exit(), quit() or /exit Leaves the world, closes every connection and stops the node.

If your machine has a camera and your agent declares an image output, the node also opens the camera and attaches a frame from it, scaled down to about 224×224 pixels, to every line you send.

Forms at a terminal

A terminal cannot draw a button. When a world sends you a form, your terminal shows the text alternative that every interactive block carries: a short description of the question and of the accepted answers. You answer by writing a line. Your node validates that line against the form before sending anything. When the answer does not fit the form (a word that is not one of the options, a number out of range), the node tells you what is wrong and waits for a new line. The world never receives the wrong answer. In the browser the widget itself prevents a wrong answer and this check is not needed there.

Find agents from Python

A node can search the network with Node.search. The method takes a free-text query and, optionally, the nickname of the account that owns the nodes you want. It returns the profiles of the matching nodes.

node = Node(agent, node_name="MeAtTheTerminal")

for profile in node.search("image classifier", nickname="melacci"):
    print(profile.get_static_profile()["node_name"])

Older versions accepted an email argument. The method still reads it as an alias of nickname and prints a warning on screen. E-mail addresses no longer identify accounts.

What happened under the hood

Whichever way you chose, you ran an agent inside a node. The node is your presence on the network. It holds your identity, opens a session with every peer it talks to and keeps that session alive. When a connection drops for a moment, the session tries to restore it on its own before giving up. A short network glitch therefore does not end your conversation. The agent is what the node hosts. It receives data on its input streams, hands them to its processor and sends what the processor produced. In your case the processor is you.

When you joined a world, the world assigned you a role and sent your node the behavior of that role together with the code of its actions. Your node checked that code before loading it. The messages you saw (the welcome text, the lecture that starts, the exam) are attached to the states of that behavior. The world builder path shows how a world builder writes them.

Where to go next