How protofy-xyz/protofy works
The Protofy project is a large-scale, monorepo-based platform that automates control over physical devices using an AI “autopilot” loop. Its core purpose is to monitor sensor states, process them with a large language model (LLM), decide on rules, and trigger actuators in smart or industrial IoT devices (including ESP32-powered modules). The repository contains multiple apps (such as adminpanel, next, api, core, launcher, python, etc.) and many packages that segment the business logic (agents, protobase, protodevice, protoflow, protofy, protolib, protonode, protopy, ui, visualui, etc.).
• Frontend / Node-Based UI – For example, the “adminpanel”, “next”, “nextra”, and “visualui” apps offer the user interface (the node/flow-editor and dashboards). These components provide a visual environment where operators can fine-tune system behavior, onboard devices, and configure rules.
• API and Core Services – The “api” and “core” apps, along with packages such as “protolib”, “protobase”, and “protofy” (which include protocol implementations, device management, and automation logic) form the central backend. They manage the continuous decision loop that reads sensor data and interacts with the LLM and external device logic.
• IoT Device Integration – The “protodevice” package (and related scripts, docker files for IoT deployments) provides support for physical devices (ESP32-based systems via ESPHome, etc.). This module encapsulates device drivers, MQTT communication (as seen in multiple device modules and its MQTT files), and the necessary protocols for deploying code to these devices.
• Automation and Rule Processing – Embedded in the system are modules for rule evaluation, context transfer for the LLM, and automation triggers (for instance, through the “protoflow” package and flow/state machine modules in “protolib”, and state machine packages). They represent the “autopilot” decision loop.
• Infrastructure, Containerization, and Deployment – Notice the many Dockerfiles (docker, docker-compose files in apps and packages) and CI/CD configuration files (GitHub workflows) that suggest containerized microservices that can be deployed in different environments.
• Supporting Infrastructure – Additional packages such as “agents”, “config”, “protonode”, and even “protopy” and “ui” show integration layers (protocol adapters, authentication/authorization, cross-service communication, etc.) that support the overall system.
Incorporate Architectural Patterns & Technologies
• Message Bus / MQTT Integration – Emphasize the communication channels dedicated to IoT devices (protocols such as MQTT appear in multiple modules).
• Node-Based Visual Interface – Highlight the “protoflow” and “visualui” components that let users visually engineer the automation rules.
• LLM Integration – Represent the AI-assisted decision part of the loop that takes in sensor inputs, contextual data, and outputs actuator instructions.
Detailed Elements
• Infrastructure: Separate sections for deployment artifacts (Docker, CI/CD workflows, pm2 monitoring).