The Field2Fork AI Hub project (funded by the European program PoliRural Plus and developed by DARe Puglia and EXO) was created to break down barriers between small rural producers in the province of Foggia and urban consumers. It is not a traditional e-commerce platform, but a participatory digital ecosystem driven by Artificial Intelligence, co-designed directly with those who work the land. The current catalog, populated following meetings held with local agricultural producers, is the result of networking and the enhancement of local excellence, carried out by the project partners' team.
1. The Vision: The Virtual "Personal Farmer"
The goal is to transform the online shopping experience into an empathetic and competent dialogue, similar to the one you would have in a trusted local shop. The system overcomes the coldness of digital catalogs by introducing a conversational interface (Chatbot) that responds in natural language to complex user requests (e.g., menu proposals based on budget, dietary preferences, and seasonality), drawing exclusively from producers' real data to eliminate the risk of invented answers (AI "hallucinations").
2. Technical Architecture and Integration (Backend)
To operationalize this vision, an advanced hybrid architecture was developed to bridge an advanced Large Language Model (LLM) and the transactional core of PrestaShop:
● Backend (Python & LangChain): The AI's "brain" utilizes an execution graph that allows it to take action, querying the PrestaShop e-commerce platform's APIs in real time to search for products, analyze stock levels, and read descriptions.
● Short-Term Memory (Redis & Docker): It manages the conversation state at lightning speed, storing products added to the cart without causing slowdowns in the browser DOM or data loss.
● Secure Synchronization (Custom PHP): A customized script (restore_cart.php) acts as a cryptographic bridge between the AI and PrestaShop's security system, enabling a smooth and frictionless checkout for the end user.
3. Core Pillars of the Model and 0-Km Logistics (User Experience - Frontend)
Direct engagement with Foggia's producers made it possible to integrate four fundamental ethical and operational requirements directly into the software code:
● Corporate Storytelling: The system does not just manage transactions; it narrates the value behind the product (e.g., ancient grains, artisanal honey).
Logistics and Local Hubs: The AI integrates a geolocalized system to suggest the closest physical pickup points (Masserie/farms, agricultural companies) to the user, pre-selecting them at checkout to encourage sustainable and planned shopping, always from a short supply chain perspective.
● Ethical Cross-Selling and Anti-Waste: The AI suggests recipes to avoid leftovers and proactively proposes complementary products from the same farm, enhancing local biodiversity and increasing the producer's average order value.
● Algorithmic Fairness: Recommendation algorithms are designed to ensure fair visibility for all producers, preventing price from being the sole selection criterion.
The chat interface was conceived to blend the natural flow of a conversation with the power of a real e-commerce checkout through the Dynamic Sidebar (implementing a visual, responsive, and constantly updated sidebar so that every interaction with the AI—adding, removing, or changing quantities—is instantly reflected in the browser DOM).
There is also Visual and Financial Reliability, as critical data "amnesia" issues between the various tools have been resolved. The interface now displays real product images by pulling directly from PrestaShop's media, ensuring visual transparency.
4. Next Steps: Long-Term Memory
As the project enters its field-testing phase (combining GIS technology, AI, and social participation), the development team is implementing the Persistent Context (via LocalStorage and Redis). This evolution will focus on "memory," allowing the AI to recognize recurring users, remember their preferences, and their favorite pickup Hubs, thereby establishing an innovative, resilient, and replicable rural governance model.
Existing Comments