Projects
work · 2024
Internal Agentic Framework
Solo design + build
An internal framework for building agentic systems, in which an agent is described as a behaviour tree via a small Python DSL. That description is then compiled into a JSON intermediate representation and then finally into code which actually runs. The tree is mirrored by nested classes, so that the structure of the code mirrors the abstraction, which makes it easier to follow. Typed and scoped variables specify what a node needs, alongside the inputs and structured outputs of the LLM calls made by that node.
Behaviour trees are an abstraction used mainly in robotics and in video games, both because they offer latency guarantees when it comes to real time event handling and because they are very modular, offering many benefits for long term maintainability and understandability. The source is not public, so this is as much of it as can be described.
work · 2024
Retail Logistics — ML Automation
Consultant
A consulting project for a retail client in which the distribution logistics process that had been run by hand was rebuilt as a classical machine learning pipeline (feature engineering, clustering and regression). The workflow was containerised and later translated to Apache Spark in conjunction with Databricks for industrial grade scaling.
The biggest challenge was the data rather than the models, since a logistics dataset is small, dirty and full of exceptions and unwritten rules, so most of the work went into managing the exceptions rather than into the algorithms.
work · 2024
Industrial Conversational System
R&D + delivery
A conversational system for an industrial client in the maritime sector, where the answers were based on the client's own unstructured material. My biggest contributions were to the creation of an ingestion pipeline for video content, the indexing of the results and its retrieval system, alongside the agentic integrations written in LangGraph.
Retrieval from material that is technical, partly internal and partly inconsistent is a different problem from answering about the world, since most of the failures were about which source the system chose to trust rather than about the language model itself. The people using it were operators rather than engineers, so what mattered was whether an answer was fast and usable in the moment.
university · 2024
Egocentric Vision — Transfer & Multimodal Learning
Research + implementation
A deep learning course project on egocentric action recognition, the classification of what a person is doing from a camera worn on the head. The task was heavily budget constrained, so training a video model from scratch was obviously out of the question. Working as a group of three, we built on top of I3D, a video model whose inflated 3D convolutions were used only in order to extract feature vectors from short clips. Said feature vectors were then used to train different variants of small neural network architectures. Alongside videos, there was a second modality source, EMG, the electrical activity of the forearm recorded over sixteen channels. This was then turned into a bank of per channel spectrograms and used as a secondary modality to be tested standalone and mixed with video.
EMG on its own was inconclusive; both readings plateaued at the same ≈17% accuracy. Once fused with the visual features the outcome depended entirely on the classifier, the transformer gaining roughly 30% over its unimodal baseline while the multilayer perceptron and the LSTM were actively hurt by the extra dimensions. Everything ran on subsets of the data, on basic architectures and with no tuning at all. The experiments concluded with an analysis of the trade-off between the information a new modality adds and the dimensionality it brings with it, especially in the context of shallower neural networks with less specialized architectures.
university · 2024
SICK Filter Extension — Learning What to Inject
Research + implementation
The original SICK paper (COLING 2022) is about abstractive summarising of dialogue samples. A conversation leaves most of its meaning unsaid since the participants share a background they never bother to state. This makes dialogues harder to summarise than a document. The authors' answer is to generate a set of commonsense inferences from each sentence with an external knowledge model and to inject the most similar inference to the original sentence into the input, in order to give the summariser the context the speakers took for granted.
The extension we were interested in was that of selecting the inference based on the golden summary (ground truth) instead of on the sentence. The golden summary is, however, obviously unavailable at inference time, therefore a shallow predictor was used to learn the similarity between each of the 25 candidate inferences and the unavailable summary. Everything ran on roughly 13% of the training set, because of heavy budgetary constraints, and for 5 epochs against the original authors' 25, hence the scores were low and showed no preference for any weighting between the two signals, and drawing the assertion at random came out about three times better. This lends to the hypothesis that assertions that are less similar to the original sentence might be a better fit for the task since they carry more information not directly present in the sentence itself.
university · 2021
Unix University — Taxicab Game
Systems programming
The assignment for this project, written in C, was to simulate a grid of holes and sources served by taxis running in parallel as separate Linux processes, rather than as threads, which means the state had to be shared through the System V primitives rather than through local variables. The map is a matrix in shared memory, each cell carrying whether it is a hole or a source and how many taxis are inside it at any given moment. The ride requests travel through a single pipe, written by every source and read by a master process which wakes a free taxi with a signal.
The hardest part was the printing, because the map is redrawn once a second by a timer and a print is not atomic, so a taxi could move halfway through it and leave the screen describing a state that never existed. The fix came from two semaphores requested in a single call, one letting the taxis act at all and one counting how many were doing so at that moment, so that the master could pause the world, print and resume it. The limiter on how many taxis may reposition at once was tuned by trial and error.
university · 2021
Algorithms — Benchmarking & DP
A university lab sequence we did as a pair, consisting of four exercises, two in C and two in Java, each with its own report and its own unit tests.
The first was a hybrid of Merge Sort and Insertion Sort, the insertion part locating its place by binary search below a given threshold, on the expectation that the quadratic asymptotic behaviour of Insertion Sort should pay off on small sub-arrays. Varying the threshold over the provided records left the time flat and then rising, and once the measurement was brought down to the resolution of the clock pure Merge Sort and the "enhanced" version were at best identical, so plain Merge Sort was the efficient one.
The second exercise was edit distance, the distance between a text to be corrected and a dictionary of words. The plain recursive version ran for hours on long words because equal substrings were compared again and again. A hash table of past comparisons came down to about eight minutes, and a two dimensional matrix indexed by the lengths of the two words brought it to roughly two. The last improvement came from abandoning a comparison as soon as it was already worse than the best found so far, which cut the recursion in place.
The third was the implementation of the union find structure, a disjoint set forest in Java where the find operation rewrites the pointer it has just walked, tested with JUnit and packaged as a jar in order to be reused by the fourth exercise.
The fourth used the union find in a minimum spanning tree over a distance graph of Italian places, Kruskal over an adjacency list chosen for sparse data. Undirected edges come from inserting both directions and marking one of the two as a copy rather than from a second structure. Run over the provided CSV, it came to roughly 89 million metres.
university · 2021
SAS — CatERing Use-Case Specs
A design and software architecture project focused on designing a catering platform. The deliverables were a pair of use case specifications in the style the course asked for. Each one stated its scope, primary actor, stakeholders, preconditions and success guarantees before walking the steps in pairs of actor and system. The interesting part was the exceptions rather than the main flow, a step such as adding a task to a menu having several branches depending on whether the task already existed or whether the dish belonged to a service which had not been assigned yet. Based on the use cases, we then designed the platform architecture using common OOP design patterns.
The code that followed was a Java implementation of the same two use cases, organised into business logic, persistence, interface and tests under a single facade over the managers for menus, recipes, users, events, turns and kitchen tasks.
university · 2022
Database Design — COVID Vaccination Campaign
A database design project for writing the ER schema of a national vaccination campaign, delivered as a design rather than as a working application. The requirements came first, then a glossary, then the same requirements restructured into groups of phrases, then the model with its business rules, and only after that the tables. The volumes assumed were those of a country the size of Italy, sixty million citizens and fifty million vaccine requests, and the operations were a daily load of half a million new requests, three hundred thousand vaccinations and four hundred thousand reads of the doses still available in a centre. The final model contains eighteen relations and about two dozen referential constraints.
university · 2023
Time Series — Forecasting
A course project in two notebooks, the first taking the total cost of studying at Harvard from 1985 to 2016 and asking for the cost of the years that follow. The models that were used for this assignment and compared were Linear regression, a hybrid of regression and ARIMA and plain ARIMA.
The second notebook is that of a Bayesian model of ten companies whose server uptimes are exponential under a rate drawn from a common population, so the rates have to be estimated alongside the population itself. Two of the update rules follow from the maths and the third does not, which leaves a sampling step inside an otherwise exact procedure. The worked exercise is composed of the worked out mathematical solution and the implementation of the sampling via an implementation of the Metropolis-Hastings algorithm.
university · 2023
Motorcycle PCA Analysis
A homework for the computational linear algebra course composed of the principal component analysis of thirty-eight thousand motorcycles. The first exercise was to make the data messier on purpose in order to simulate a real world problem. A third of the rows were kept by taking the years sharing a random remainder, and two features were dropped out of six candidates at random. It is a cheap way of breaking a tidy file and seeing how much of the analysis survives it.
The scaling mattered, since the same analysis was run once over standardised columns and once over columns squashed into a unit interval, and the two sets of components were not the same. What is worth looking at are the motorcycles at either end of a component, collected as photographs. The first component runs from small displacement to large and the second from new cross machines to old long range ones, which a table of loadings says far less quickly. The fifth was left without an interpretation, because it did not have one.
university · 2020
Java Email Server/Client
A university project we built as a pair, an email system with a protocol of its own, spoken over plain sockets between a server and a client, each with a window of its own. We implemented a handmade protocol with a few verbs (send, get all, check and two kinds of delete), a few replies (okay, cancelled, abort) and two kinds of error (malformed request and one for anything unexpected).
The storage took the longest, because a mailbox was implemented as a file holding a serialised list of messages and several threads would want it at once. The server keeps a map of read-write locks keyed by file path, which lets two reads share a mailbox while a write stays exclusive to the thread holding it. The client polls every five seconds and the server answers only with what is newer than the last message the client already has.
university · 2021
Lessons Booking Website
Working as a group of four, we built a site for booking private lessons, named Noodle as a play on Moodle, the learning platform the whole thing was meant to imitate in miniature. The backend is Java packaged as a war, with twelve servlets answering in JSON, and the frontend is Vue. Authorization sits in a single base class that every servlet after it extends in order to use it as common middleware.
The booking table is keyed by course, teacher, user and slot, with a check keeping the day inside the five working days and the hour inside the four slots of a day. A double booking is therefore impossible at the level of the database rather than in the code which would try to prevent it. Nothing is ever deleted, because every table carries a removal flag and every query asks for the rows where it is false, which keeps a booking readable long after the course it refers to has been withdrawn at the cost of a condition that has to be remembered everywhere.
university · 2021
Lessons Booking App (Android)
An Android client written in Java for a lesson booking system, the mobile half of a group project of four with the same theme. It is a set of screens, lists and a binding layer which makes a booking readable by the layout without the screen carrying the notification.
The problem worth noting is the session, since the server authenticates through one and a phone that logs in has to behave as a browser would. It is solved with two network interceptors, one putting the session identifier on the way out and one reading it back from the answer and keeping it.
university · 2020
Pattern Matcher
An exercise in building a graphical interface in Python, written as a group of three with Tkinter as the only real dependency. The window holds a three by three grid one can click in order to draw a pattern, beside a twenty by twenty field of random cells to search for it in, and the point of the exercise was the interface rather than the search.
The scan is the obvious one, starting at every cell of the field and comparing the pattern cell by cell, and the same scan runs four times, once over each rotation of the pattern, so a match counts however the pattern is turned. The matches are then coloured on the field and stepped through with two arrows.
freelance · 2021
Web Scraper
A personal project for finding cheap cars. It is one scraper for each of the three major Italian listing sites behind a shared base class and a small function picking the right one from the url of an ad. A daemon runs three processes at a time, one per site, every ten minutes, and each ad it finds is measured against a hard coded rule. The daemon stops once it encounters a page it has already seen. A candidate posting triggers a Telegram message and there is also a small Vue visualisation page where all the postings can be viewed and filtered. Webscraping projects tend to have short shelf lives, so the code is probably not functional anymore.