Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/diarpicu2022-commits/frontend-AgroPulse/llms.txt

Use this file to discover all available pages before exploring further.

AgroPulse includes a built-in agronomic AI assistant that answers questions about your greenhouse in real time. The assistant knows the identity “AgroPulse IA”, responds exclusively in Spanish, and grounds every answer in actual sensor readings when they are available. A separate Machine Learning tab uses the same provider chain to predict the next six hours of sensor values, with trend indicators and recommended actions.

How the AI works

The assistant sends your prompt together with a system context to whichever AI provider is active. The system prompt tells the model:
“Eres un experto agrónomo e ingeniero de invernaderos. Tu nombre es AgroPulse IA. Respondes en español, de forma concisa y práctica. Siempre das recomendaciones basadas en datos reales de sensores cuando están disponibles.”
Current sensor readings are appended to the system context automatically so answers reflect the state of your greenhouse at the moment you ask.

AI providers and fallback order

AgroPulse tries providers in order and falls back to the next one if the previous call fails or the key is missing.
Model: llama-3.1-8b-instantGroq provides the fastest inference. It is tried first whenever VITE_GROQ_KEY or the agropulse_groq_key localStorage value is present.
Key prefix: gsk_...
localStorage key: agropulse_groq_key
Env variable: VITE_GROQ_KEY
If no provider key is configured, the assistant displays: “No hay servicio de IA disponible. Configura Groq, GitHub o Gemma en Configuración.” You must add at least one key to use AI features.

Quick action prompts

The AI page offers three one-click prompts so you don’t have to write a query from scratch.

Recommendation

Asks the AI to evaluate current temperature, humidity, and light and suggest concrete crop optimisation steps.

Prediction

Requests a forecast of which actuators are likely to be needed in the coming hours based on current sensor trends.

Analysis

Produces a three-part report: overall greenhouse state, detected problems, and a prioritised list of recommended actions.
You can also type any free-form question in the Pregunta personalizada text area and send it directly to the active AI provider.

Machine Learning — 6-hour sensor prediction

The Machine Learning page uses the same provider chain to generate a structured prediction for the next six hours. When you click Predecir próximas 6 horas, the assistant receives the recent sensor history and returns:
  • Estimated values for each sensor at one-hour intervals
  • A trend indicator for each reading (rising, falling, or stable)
  • Recommended actions for any sensor expected to leave its safe range
The prediction is presented as formatted text and is labeled with the provider that generated it (e.g., Groq · LLaMA 3.1).

Configure AI keys

Only users with the Admin role can save AI keys in Settings. Operators can use the AI assistant if keys have already been configured by an admin.
1

Open Settings

In the sidebar, navigate to Configuración. The AI Keys section is visible only to admins.
2

Enter your API key

Paste the key for the provider you want to activate. You can add keys for multiple providers — AgroPulse will use them in the fallback order described above.
ProviderWhere to get the key
Groqconsole.groq.com → API Keys
GitHub ModelsGitHub → Settings → Developer settings → Personal access tokens (Classic)
Google Gemmaaistudio.google.com → Get API key
3

Save and verify

Click Guardar todas las claves. The Settings page stores each non-empty key in localStorage under its provider key name. Return to the IA page — you should see a green status chip confirming the provider is active.
The status bar at the top of the AI page shows a green chip for every active provider: Groq activa, GitHub AI activa, or Gemma activa. If none are active, a yellow chip reads “Sin IA configurada — ve a Configuración”.
For production deployments, set VITE_GROQ_KEY, VITE_GITHUB_TOKEN, or VITE_GEMMA_KEY as environment variables (e.g., in Vercel). The app reads localStorage first and then falls back to the build-time env variable, so per-user overrides are still possible.

Build docs developers (and LLMs) love