Projects

Vision-Enabled Dialogue

This project started in November 2023, when commercial language models had just started to accept image input. A quick implementation took frames from the Furhat robot camera, and weave them into the conversation. I made a short algorithm to control the amount of images and information in the prompt, with the objective of balancing response quality and speed. The work was eventually published at HRI 2025 as a late-breaking report, and extended to include additional features and support for ROS 2.

The library separates the conversation history from response generation, so the dialogue flow and the model can be changed independently. Camera frames, user turns, and robot turns are stored in the same history. To keep the prompt short, growth strategies run in the background and summarise or hide older parts: for instance, a series of old frames can become a text description, or the beginning of a long conversation can be condensed. At each turn, a lightweight model can choose whether the answer needs the vision model or a text-only one is enough. Responses are streamed sentence by sentence, so the robot starts speaking before generation is over, and if the user interrupts, the history records what was actually said. Extra instructions can also be added for a single turn or persistently, to steer the robot during the conversation. It works with OpenAI models or with local ones through Ollama (the example uses Gemma 3 27B and a webcam).

Expressive Furhat

The Furhat robot has a very expressive face, but when paired with a language model and a realistic voice, its predefined expressions can’t keep up. This project generates facial expressions and head movements in real time from the conversation, and was presented at HRI 2026 as a late-breaking report.

The library is a drop-in replacement for the existing furhat-remote-api and adds two behaviours. The first is gaze aversion: while speaking, the robot every now and then looks away with its eyes, as people do when they talk, and then returns to the closest user. The second is a multi-stage LLM pipeline for gestures. When the user speaks, it checks whether the last message drastically changes the mood of the conversation; if it does, previously generated gestures are discarded and a fast model produces an immediate reaction. In parallel, another model reasons about how the robot should behave and streams a series of gestures into a cache, from which a background thread keeps playing them, favouring the most recent ones, until a mood change is detected again. Gestures are built directly from Furhat’s parameters (mouth, eyebrows, eyes, …), so there is no fixed set to choose from.

It works with OpenAI models or with local ones through Ollama. In addition, gaze aversion, background gestures, and gesture generation can each be used on their own.

Value Steering

Can a prompt actually push a language model towards a specific preference, and how well? Fine-tuning is the usual answer to alignment, but it is static. Maybe we could fine-tune a model for every culture, but surely not for every individual. And even so, fine-tuning does not fit everyday situations, where values and preferences change from one moment to the next. This project contains a procedure to test prompts without touching the model, presented it at VALE 2025.

The code is built around two interchangeable pieces. A strategy pairs a prompt template with a model: there are base, simple, and advanced prompts for OpenAI’s chat models and for Wizard-Vicuna 13B, running locally with llama.cpp. An evaluator wraps a classifier that detects values in text: Schwartz’s basic human values through DeBERTa or a dedicated classifier, or Moral Foundations through MoralBERT. For each dialogue, the procedure detects the values already present, asks the model for a reply aligned with each target value, and classifies that reply. Each value then counts as a gain, a retain, a loss, or a neutral, and these counts become a score to compare prompts.

The notebook walks through the whole thing on 1,000 dialogues from Commonsense-Dialogues, comparing a baseline prompt with a value-conditioned one. The idea is to provide a starting point from which the procedure can be adapted to each specific situation, dataset, model. And of course, there is a devcontainer.

Multimodal Conversational Toolkit (MCTK-TINI)

The work of MMCC was generalised in my Master’s thesis and turned into a multimodal conversational toolkit, MCTK; the core idea remained the same: a developer can define a process and the framework guides the user through it regardless of the input type, supporting text and interface elements like buttons. This work was then presented at the 2022 International Conference on Advanced Visual Interfaces .

Wanting to support more languages, I abandoned RASA in favour of NLP.js, which had also the advantage of running client-side in the browser. I also added multimodal output, so that not only the inputs can come from text or interface elements, but the interface can be altered according to the chatbot output. This work was presented at Conversations 2022.

I forgot what TINI stands for officially, but in my mind it always meant “This Is Not an Issue”, which is something a certain professor would always say when we were discussing another project I was working on, and at the same time it was a reference to the fact that this was a small component that could run in a browser.

DiDisplay

The tagline was “Effortless Real-Time Dialogue Display for Eye-Catching Demos”; it started as a quick bug fix. Working with the Pepper robot, a colleague of mine needed to display some text on the robot’s tablet, but the text was not static: it was generated by a Python script running on a laptop, and it needed to be updated in real time. On top of that, if the webpage was locally hosted, the robot would not display it, it needed a proper domain name and a valid SSL certificate. In the first version, this app did just that: receive a string, display it (sanitisation nightmares aside).

It was then updated for FTI 2023 with a better Vue frontend, and the ability to display full conversation history. It could also be configured with logos, and had some animations and exaggerated decorations to catch the public’s attention. All packaged in a Docker container with health check endpoints.

Screen recording of DiDisplay app, loading and displaying two messages.

WebSocket Bridge

I needed to connect two websockets, neither of which had a fixed address. This express server acts as a bridge between the two, forwarding messages from one to the other and vice versa. It can work for multiple connections: just connect one to /ws/<foo>/<bar> and the other to /ws/<bar>/<foo>, and they will be connected. I packaged it in Docker with a nice health check, so it can be deployed easily.

Devcontainer for PYNAOQI 2.5.5

Since I discovered devcontainers, I cant stop using them. When I needed to develop for NAO and Pepper robots, the setup was particularly annoying, so I created a devcontainer for it.

MrPenn

I needed an app to keep track of my expenses. I had been using a sort of journal for some years, then I moved to a spreadsheet, but I wanted something faster to use especially on my phone. I developed MrPenn between 2020 and 2023 in Flutter.

The first functionality I implemented was a CRUD for expenses; each with a title, amount, source and destination accounts, and a date. Then, I added a view with the totals by account and category, a view with the list of expenses with filtering by text, and sorting by transaction or insertion date. I was wise enough to then give priority to the SQLite database export, which saved me more than once. Always plan an exit strategy.

The feature I loved the most and the most useful was the ability to flag expenses, and then view them in a separate list. I used this to keep track of expenses that I wanted to check later, like money lent or borrowed. Still haven’t found a substitute for this feature in other apps.

I spent a bit of time on the UI, with a curved bottom navigation bar, and some animations.

Screen recording of MrPenn app

The name MrPenn is because at the time I was watching Gotham, a TV series withing the Batman universe, and the Penguin’s accountant was called Arthur Penn. I used MrPenn until 2025, when I finally started looking for an alternative with more features, and I switched to Cashew.

TimedPool

I needed a dictionary with a maximum size and whose elements are deleted after a delay, so I made this TimedPool package. It works like a normal dictionary, but if full, it raises an exception when trying to add a new element. Elements can expire after a certain time, and expired elements are permanently removed from the dictionary.

MultiModal Chatbot Creator (MMCC)

With two student colleagues, we worked on MMCC for the Advanced User Interfaces and Multidisciplinary Project courses at Politecnico di Milano in 2021. Starting from a preprint titled “A Conceptual Framework for Multi-modal Process-driven Conversational Agents”, we implemented a framework that, if kept updated with the inputs from the user, guides him through an appropriately defined process, regardless of the input type. The idea was that the developer could define a process, like a shopping experience, and use our components in their web page. The system would then provide a RASA-powered backend that would handle the user input and guide them through the process, regardless of whether they were using text or interface elements like buttons, sliders, or images. The framework was designed to be easily extendable and adaptable to different use cases.

I focused on the core, implementing the logic that guides the user through a process, and calls appropriate callbacks when necessary. It could be used as a standalone library (with TKinter for example), or with the web components developed by my colleagues. This is an example of how the framework could be used in a web page:

from mmcc_framework import Framework, RasaNlu

# Suppose that the nlu is trained with, among the others, the intent "insert_name" with a entity "name".
# Initialize the adapter
my_adapter = RasaNlu()
my_framework = Framework(..., nlu=my_adapter)

# Suppose that it is time to insert the name.

# If it is necessary to insert it as text use:
my_framework.handle_text_input("Mark")
# The callback corresponding to the current activity will receive (if the intent is recognized):
data = {"intent": "insert_name", "name": "Mark"}

# If it is necessary to insert the name as data use:
my_framework.handle_data_input(RasaNlu.dict("insert_name", {"name": "Mark"}))
# This will pass to the callback the same structure as above.

While working on MMCC, I taught myself Python best practices, notions about RASA NLU, and how to use Docker for development and deployment. Looking back, what I handed in was very polished for a student project, with some testing, two examples and proper documentation. I even published it as a Python package on PyPI.

BarbequeRTRM Log Viewer

I developed this Qt plugin for BarbequeRTRM in 2020, for a university course at Politecnico di Milano. The requirements were simple: open a log file, filter for text, log level, source module, and specific date ranges. I added a button to quickly remove all filters, and everything was customisable, including date display format and log level colours. After a few weeks of development, I presented the plugin to the professor and the supervisor of the course, and they seemed satisfied with the result. I was happy I got to learn about Qt and C++ in the process.