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.zipInstalls 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.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
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_cachepara evitar lecturas redundantes al disco. - La función
build_prompt()enapp/prompts.pyensambla el prompt final concatenando:- Persona (prompt.md): Rol, tono y personalidad del agente agrícola.
- Conocimiento (knowledge.md): Base de datos de cultivos costeros tropicales.
- Dispositivos (devices.md): Inventario y protocolos de actuadores IoT.
- Reglas (rules.md): Restricciones de formato JSON y seguridad.
- 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_datadel 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 enapp/llm.py). - Generación asíncrona:
generate_raw_response()utilizaasynciopara 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_AGOTADAal router para respuesta HTTP adecuada.
4. Extracción de Datos Estructurados
- La respuesta del LLM incluye un bloque
```jsonconactionsyalerts. 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
- Nunca hardcodear prompts en los routers. Siempre usar
build_prompt(). - Mantener knowledge.md actualizado con datos agronómicos relevantes a la zona.
- Evitar llamadas innecesarias a Gemini — el filtro de anomalías reduce el consumo de cuota en ~70%.
- Siempre incluir chat_history en solicitudes humanas para mantener coherencia conversacional.
When not to use it
- →General purpose LLM tasks
Prerequisites
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| gemini-ai-agent (this skill) | 0 | 4mo | No flags | Advanced |
| llama-cpp | 21 | 8mo | Review | Intermediate |
| langchain | 26 | 8mo | Review | Intermediate |
| llama-factory | 15 | 8mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by LNieto-V
View all by LNieto-V →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.
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.
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
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.
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.
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.