GE

gemini-ai-agent

A technical setup for Gemini-based agents, specifically designed for context-heavy applications like precision agriculture.

Install

mkdir -p .claude/skills/gemini-ai-agent && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9773" && unzip -o skill.zip -d .claude/skills/gemini-ai-agent && rm skill.zip

Installs to .claude/skills/gemini-ai-agent

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Skill para la orquestación del agente de IA con Google Gemini, incluyendo ingeniería de prompts modulares, inyección de contexto RAG en tiempo real y gestión de memoria conversacional para agricultura de precisión.
214 charsno explicit “when” trigger
Advanced

Key capabilities

  • Modular prompt assembly
  • Real-time sensor data injection
  • Conversational memory management
  • Structured data extraction

How it works

It assembles prompts from modular files, injects real-time context, and uses regex to extract structured control data from LLM responses.

Inputs & outputs

You give it
User query and sensor context
You get back
Structured JSON actions and alerts

When to use gemini-ai-agent

  • Building precision AI agents
  • Integrating sensor data with LLMs
  • Managing agent memory

About this skill

🤖 AgroNexus AI — Gemini Agent Skill

Este skill define cómo el agente de IA comprende, construye y optimiza las interacciones con el modelo Google Gemini dentro del ecosistema AgroNexus.

Capacidades

1. Ingeniería de Prompts Modulares

  • Sistema de prompts basado en archivos Markdown independientes (prompt.md, rules.md, knowledge.md, devices.md).
  • Cada archivo se carga con @lru_cache para evitar lecturas redundantes al disco.
  • La función build_prompt() en app/prompts.py ensambla el prompt final concatenando:
    1. Persona (prompt.md): Rol, tono y personalidad del agente agrícola.
    2. Conocimiento (knowledge.md): Base de datos de cultivos costeros tropicales.
    3. Dispositivos (devices.md): Inventario y protocolos de actuadores IoT.
    4. Reglas (rules.md): Restricciones de formato JSON y seguridad.
    5. Contexto dinámico: Sensores, historial, estado del sistema e historial del chat.

2. Inyección de Contexto RAG (Retrieval-Augmented Generation)

  • Datos de sensores en tiempo real: Últimos valores de sensor_data del usuario.
  • Historial de 24h: Tendencias de temperatura y humedad (hasta 20 registros).
  • Estado interno del backend: Modo del sistema (AUTO/MANUAL), salud de la bomba, alertas activas.
  • Memoria conversacional: Últimos 6 mensajes del chat para continuidad del diálogo.

3. Gestión del Modelo LLM

  • Modelo: gemini-2.0-flash (configurado en app/llm.py).
  • Generación asíncrona: generate_raw_response() utiliza asyncio para no bloquear el event loop de FastAPI.
  • Manejo de cuota: Detección de errores 429 (ResourceExhausted) con mensaje amigable al usuario.
  • Reintentos: El servicio propaga la excepción CUOTA_AGOTADA al router para respuesta HTTP adecuada.

4. Extracción de Datos Estructurados

  • La respuesta del LLM incluye un bloque ```json con actions y alerts.
  • extract_iot_data() usa regex para separar el texto humano del JSON de control.
  • Las acciones (FAN ON, IRRIGATION OFF) se envían de vuelta al hardware ESP32.

Flujo de Prompt (Diagrama)

┌───────────────────────────────────────┐
│          build_prompt()               │
├───────────────────────────────────────┤
│  1. prompt.md     → Persona           │
│  2. knowledge.md  → Cultivos          │
│  3. devices.md    → Actuadores        │
│  4. rules.md      → Formato/Seguridad │
│  5. sensor_data   → Tiempo Real       │
│  6. history       → Tendencias 24h    │
│  7. backend_state → Estado Interno    │
│  8. chat_history  → Memoria (6 msgs) │
│  9. message       → Input del Usuario │
└───────────────────────────────────────┘
              │
              ▼
    ┌──────────────────┐
    │  Gemini 2.0 Flash │
    └──────────────────┘
              │
              ▼
    ┌──────────────────┐
    │ extract_iot_data()│
    │  → text, actions, │
    │    alerts          │
    └──────────────────┘

Archivos Clave

  • app/prompts.py: Constructor modular de prompts.
  • app/llm.py: Cliente asíncrono de Google Gemini.
  • app/services/iot_service.py: Orquestador que conecta prompt → LLM → extracción.

Buenas Prácticas

  1. Nunca hardcodear prompts en los routers. Siempre usar build_prompt().
  2. Mantener knowledge.md actualizado con datos agronómicos relevantes a la zona.
  3. Evitar llamadas innecesarias a Gemini — el filtro de anomalías reduce el consumo de cuota en ~70%.
  4. Siempre incluir chat_history en solicitudes humanas para mantener coherencia conversacional.

When not to use it

  • General purpose LLM tasks

Prerequisites

Google GeminiFastAPI

Limitations

  • Dependent on Gemini 2.0 Flash

How it compares

It is specifically architected for IoT/AgroNexus control, ensuring structured output for hardware interaction.

Compared to similar skills

gemini-ai-agent side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
gemini-ai-agent (this skill)04moNo flagsAdvanced
llama-cpp218moReviewIntermediate
langchain268moReviewIntermediate
llama-factory158moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

llama-cpp

zechenzhangAGI

Runs LLM inference on CPU, Apple Silicon, and consumer GPUs without NVIDIA hardware. Use for edge deployment, M1/M2/M3 Macs, AMD/Intel GPUs, or when CUDA is unavailable. Supports GGUF quantization (1.5-8 bit) for reduced memory and 4-10× speedup vs PyTorch on CPU.

21471

langchain

zechenzhangAGI

Framework for building LLM-powered applications with agents, chains, and RAG. Supports multiple providers (OpenAI, Anthropic, Google), 500+ integrations, ReAct agents, tool calling, memory management, and vector store retrieval. Use for building chatbots, question-answering systems, autonomous agents, or RAG applications. Best for rapid prototyping and production deployments.

26138

llama-factory

zechenzhangAGI

Expert guidance for fine-tuning LLMs with LLaMA-Factory - WebUI no-code, 100+ models, 2/3/4/5/6/8-bit QLoRA, multimodal support

15112

langgraph

davila7

Expert in LangGraph - the production-grade framework for building stateful, multi-actor AI applications. Covers graph construction, state management, cycles and branches, persistence with checkpointers, human-in-the-loop patterns, and the ReAct agent pattern. Used in production at LinkedIn, Uber, and 400+ companies. This is LangChain's recommended approach for building agents. Use when: langgraph, langchain agent, stateful agent, agent graph, react agent.

1374

computer-use-agents

davila7

Build AI agents that interact with computers like humans do - viewing screens, moving cursors, clicking buttons, and typing text. Covers Anthropic's Computer Use, OpenAI's Operator/CUA, and open-source alternatives. Critical focus on sandboxing, security, and handling the unique challenges of vision-based control. Use when: computer use, desktop automation agent, screen control AI, vision-based agent, GUI automation.

1040

senior-prompt-engineer

davila7

World-class prompt engineering skill for LLM optimization, prompt patterns, structured outputs, and AI product development. Expertise in Claude, GPT-4, prompt design patterns, few-shot learning, chain-of-thought, and AI evaluation. Includes RAG optimization, agent design, and LLM system architecture. Use when building AI products, optimizing LLM performance, designing agentic systems, or implementing advanced prompting techniques.

743

Search skills

Search the agent skills registry