Classroom¶
This world was built for the tutorial "Lifelong Learning in Peer-to-Peer Communities of Human and AI Agents" (Stefano Melacci, Tommaso Guidi, Christian Di Maio) at CoLLAs 2026. It runs a class-incremental learning setup as a community. New classes appear two at a time while the students are already learning. AI students and people take part in the same way. Its code is in unaiverse-examples/worlds/collas_tutorial. The folder tutorial_steps/ next to it builds the same world in six runnable steps (skeleton, streams, behaviors, the full classroom, people as peers and statistics).
What happens¶
The teacher runs a loop with three activities:
- Lectures. Each of the three lectures streams pictures of two new categories at the rate of one picture and its name every 7 seconds. After three lectures the students know six classes.
- Exam. The teacher streams six pictures that the students never saw and collects their predictions. It scores each student and updates a quality index per student.
- Help. The teacher asks for labels of two pictures that nobody labeled. When students with a quality index of at least 0.6 agree on a class, the picture joins the material of the next lecture.
Roles and code¶
collas_tutorial/
├── run_world.py the world node, CoLLAsTutorial
├── run_teacher.py the teacher, world master (proc=None, owns the image streams)
├── run_student1.py an AI student: frozen ResNet-50 and a head of continual neural units
├── run_student2.py
└── src/
├── world.py assign_role and the two behaviors
├── teacher.py the actions of the teacher
├── student.py the actions of a student
└── stats.py the statistics of the world
assign_role makes the world master the teacher and every other agent a student. The world recognizes the teacher by the node name CoLLAsTeacher in world_masters_node_names of run_world.py. world.py builds both behaviors with add_state and add_transit and writes them to teacher.json and student.json. When an agent joins, the world ships the code of its role to that agent.
The teacher has no processor. It creates its streams in accept_new_role with Stream.create: per lecture an ImageFileStream of pictures and a StringStream of class names (both private and not pubsub, with delta=7.0) plus the same pair with delta=10.0 for the exam and for the help round. Its actions use Agent.send for everything they ask of the students:
await self.send(action_name="learn",
from_state="in_class",
forced_uuid=f"lecture{self.current_lecture_num}_uuid",
target=self.get_agents_by_role("student"),
streams={"stdin": [f"images@lecture{self.current_lecture_num}"],
"stdtar": [f"class_names@lecture{self.current_lecture_num}"]},
num_steps=self.LECTURE_SAMPLES,
num_samples_to_stream=self.LECTURE_SAMPLES,
timeout=self.LECTURE_MAX_DURATION,
callback="mark_lecture_as_finished")
streams binds the pictures of the lecture to the input of the processor of each student (stdin) and the class names to its target (stdtar). num_steps asks each student to run learn six times with one sample per step. callback names the action that counts the students who finished. Announcements to the class go as send(action_name="print", action_kwargs={"msg": ...}, volatile=True). A volatile request asks for no completion status in return.
An AI student is an ordinary Agent with a processor and proc_opts (an optimizer and a loss). It joins the class with run(join_world="CoLLAsTutorial"). Its learn action runs the processor on each sample and updates it with that optimizer and loss. The student therefore learns while the stream goes on.
People in the class¶
A person joins CoLLAsTutorial from the webapp or from a terminal with python lonewolves/run_human.py --world CoLLAsTutorial in the root of unaiverse-examples. The person receives the same lectures and answers the exam and the help round through forms.
Its own view¶
The webapp shows a world as a chat by default. The owner of this world replaced that chat with a view built only with the GUI kit. The view is published at https://unaiverse.io/gui/collas-tutorial/. The view turns the stream of notes, pictures and forms into a field guide that the person fills while the class goes on. It has a title page with the plan of the class, plates that fill up during the lectures, the exam next to the identification key of the guide and the final score with an estimate of the quality index that follows the formula of the teacher.

A view for your world explains what a world must expose for a view like this one.
Run it¶
cd unaiverse-examples/worlds/collas_tutorial
python run_world.py
python run_teacher.py
python run_student1.py
python run_student2.py
Start each node in its own terminal in this order and wait until it is up before you start the next one. In the terminal of the teacher the space bar pauses the class at the end of the current activity and a second press resumes it. If you run the world yourself, rename the nodes for your account and make sure that the entry CoLLAsTeacher in world_masters_node_names matches the node name of your teacher. Because the world ships the code at join time, every edit in src/ needs a restart of run_world.py and then of the other nodes.