polito.it
Politecnico di Torino (logo)

Automated Code Generation for IoT Edge Computing Solutions using AI

Salvatore Cabras

Automated Code Generation for IoT Edge Computing Solutions using AI.

Rel. Guido Albertengo. Politecnico di Torino, Corso di laurea magistrale in Ingegneria Informatica (Computer Engineering), 2025

[img] PDF (Tesi_di_laurea) - Tesi
Licenza: Creative Commons Attribution Non-commercial No Derivatives.

Download (4MB)
Abstract:

With the rapid expansion of IoT technologies, edge computing has become essential for processing data closer to the source, reducing latency, and improving efficiency. However, developing and maintaining code, including requirements and testing, for diverse IoT devices can be time-consuming and complex. This thesis explores AI-driven techniques for automating code generation in edge computing applications, focusing on requirements definition, code creation, and automated testing. The principal contribution of this work is the design and implementation of a multi-agent chat system using Microsoft’s AutoGen-AgentChat framework. This system allows collaborative interactions between different AI agents, where each agent is responsible for a specific assignment in the software development pipeline, such as requirements interpretation, project organization, code generation, testing, and fixing code. The agents operate in a coordinated chat session, simulating a task-oriented dialogue that iteratively refines and validates the solution according by user definitions. In the initial phase of code generation from scratch, the system employs a Retrieval-Augmented Generation (RAG) approach. RAG is a hybrid method that combines information retrieval with generative AI to ground the output in relevant documentation. An agent formulates queries based on the user's task description and retrieves useful content from a custom-built documentation database, including code snippets, which then serve as contextual input for code generation. Three main workflows were implemented: (i) the generation of an ESP-IDF project from scratch based on a user-defined IoT task, (ii) the modification of a previously AI-generated project to reflect updated requirements, and (iii) the adaptation of an existing, manually developed ESP-IDF project. For each workflow, there is an effective build step, where the system iteratively finds and fixes compilation or configuration errors iteratively until a successful build is achieved. This guarantees that the generated or modified code is not only syntactically correct, but also feasible and deployable on the target hardware. The system was implemented in Python and tested using ESP-IDF version 4.4.8 for the ESP32 platform. Through experimentation, the multi-agent, RAG enhanced approach showed clear potential for streamlining embedded software development at the edge. Each project given by the agent chat was tested on an externally programmed basic ESP32 board.

Relatori: Guido Albertengo
Anno accademico: 2024/25
Tipo di pubblicazione: Elettronica
Numero di pagine: 71
Soggetti:
Corso di laurea: Corso di laurea magistrale in Ingegneria Informatica (Computer Engineering)
Classe di laurea: Nuovo ordinamento > Laurea magistrale > LM-32 - INGEGNERIA INFORMATICA
Aziende collaboratrici: SANTER Reply S.p.a.
URI: http://webthesis.biblio.polito.it/id/eprint/36390
Modifica (riservato agli operatori) Modifica (riservato agli operatori)