Agente de Gestión y Normalización(Supabase)
Este flujo actúa como una capa de validación y normalización inteligente entre el lenguaje natural del usuario y la estructura relacional de Supabase. El proceso garantiza que cada nuevo mueble insertado cumpla con la integridad de datos requerida, elimin
Agente de Gestión y Normalización (Supabase)
🧩 Overview
This workflow acts as an intelligent validation and normalization layer between natural language user input and the relational structure of a Supabase database. It automates the processing of new furniture inventory items, ensuring each record adheres to strict formatting rules and data integrity before being inserted. By handling the full CRUD lifecycle, it simplifies database management and guarantees technical consistency across all operations.
⚙️ Main Features
- Processes natural language requests to perform database operations (Create, Read, Update, Delete) on a furniture inventory table.
- Validates, cleans, and normalizes input data against predefined rules for categories, materials, and colors.
- Executes database actions in Supabase only when all mandatory information is complete and correctly formatted.
- Provides clear feedback to the user, confirming successful operations or requesting missing data.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Chat Input | Captures the user's natural language request (e.g., "create a product" or "delete that gamer chair"). | User Prompt | User Message |
| Agent | The central AI agent that interprets the user's intent, validates data, and orchestrates tool use. It follows a detailed system prompt for inventory management. | User Message, Language Model, Database Tools | Agent Response |
| Gemini Model | Provides the language model intelligence for the agent's decision-making and reasoning processes. | Model Configuration | Language Model Instance |
| Supabase (Get) | A tool that allows the agent to retrieve existing records from the database, useful for validation or finding items to update/delete. | Table Name, Optional Filters | Retrieved Data |
| Supabase (Delete) | A tool that allows the agent to remove records from the database based on specified filters. | Table Name, Filter Criteria | Operation Result |
| Supabase (Insert) | A tool that allows the agent to add new, validated furniture records to the database. | Table Name, Record Data (name, category, price, etc.) | Operation Result |
| Supabase (Update) | A tool that allows the agent to modify existing records in the database. | Table Name, Filter Criteria, New Field Values | Operation Result |
| Chat Output | Displays the agent's final response, confirmation, or request for additional information back to the user. | Agent Response | Formatted Message |
🧠 Notes
- The workflow is designed for a specific "Muebles" (Furniture) table with predefined columns (
nombre,categoria,material,precio_venta,stock,color). - The agent enforces strict formatting rules: categories must be from a fixed list, materials and multi-colors are separated by
/, and missing product names are generated from descriptions. - The process will halt and prompt the user if mandatory fields like price or stock are missing from the initial request.
- Successful operation requires valid Supabase credentials (URL and service key) to be configured for the database components.