OpenClaw Livestock Assistant
Expert livestock management assistant for Spanish-speaking farmers. Responds
always in Spanish. Combines AI chat with a REST API for herd record-keeping.
Capabilities
- - Herd management — register and track animals (bovine, ovine, caprine, porcine, equine, poultry)
- Animal health — vaccination schedules, disease identification, treatment guidance
- Reproduction — heat detection, pregnancy tracking, birth records, genetics
- Nutrition — ration formulation, forage selection, supplementation
- Breed advice — selection by aptitude (meat / milk / wool / dual-purpose)
- REST API — persistent record-keeping via Express server on INLINECODE0
Starting the API Server
Before using any REST API endpoint, start the server:
CODEBLOCK0
The server exposes /health, /api/animals, and /api/assistant — see
references/api.md for the full endpoint reference.
AI Provider Configuration
The assistant supports OpenAI, Anthropic (Claude), and Google (Gemini).
Set at least one API key; the assistant auto-selects the provider.
| Provider | API key env var | Default model |
|---|
| OpenAI | INLINECODE4 | INLINECODE5 |
| Anthropic |
ANTHROPIC_API_KEY |
claude-opus-4-6 |
| Google |
GOOGLE_GENERATIVE_AI_API_KEY |
gemini-2.5-pro |
Override explicitly via:
- -
AI_PROVIDER=openai|anthropic|google — force a specific provider - INLINECODE11 — override the model ID for the chosen provider
AI Chat
Every interaction should be in Spanish. Use the system prompt embedded in
src/assistant/systemPrompt.ts as the agent's knowledge baseline.
Create a session before sending messages:
CODEBLOCK1
Domain References
Load these files when you need detailed reference data:
User reports symptoms, asks about prevention or treatment |
|
references/nutrition.md | User asks about feeding, rations, forages, or supplementation |
|
references/api.md | User wants to register animals or retrieve herd data |
Animal Status Reference
| Field | Allowed values |
|---|
| INLINECODE13 | INLINECODE14 ovine caprine porcine equine INLINECODE19 |
| INLINECODE20 |
male female |
|
status |
active sold dead quarantine |
|
healthStatus |
healthy sick in_treatment recovered |
|
reproductiveStatus |
open pregnant lactating in_heat served not_applicable |
Safety Guidelines
- - Never diagnose diseases definitively — always recommend a veterinarian for emergencies.
- Zoonotic diseases (e.g., Brucelosis) must be flagged immediately.
- Urgency levels:
low → medium → high → emergency. Escalate accordingly.
OpenClaw 畜牧助手
专为西班牙语农民设计的畜牧管理专家助手。始终使用西班牙语回复。将AI聊天与用于畜群记录保存的REST API相结合。
功能
- - 畜群管理 — 登记和追踪动物(牛、羊、山羊、猪、马、家禽)
- 动物健康 — 疫苗接种计划、疾病识别、治疗指导
- 繁殖 — 发情检测、妊娠追踪、出生记录、遗传学
- 营养 — 饲料配方、牧草选择、补充喂养
- 品种建议 — 按用途选择(肉用/奶用/毛用/双用途)
- REST API — 通过Express服务器在http://localhost:3000上持久保存记录
启动API服务器
在使用任何REST API端点之前,请启动服务器:
bash
bash scripts/start.sh
服务器暴露了/health、/api/animals和/api/assistant端点——完整端点参考请参见references/api.md。
AI提供商配置
助手支持OpenAI、Anthropic (Claude)和Google (Gemini)。请设置至少一个API密钥;助手会自动选择提供商。
| 提供商 | API密钥环境变量 | 默认模型 |
|---|
| OpenAI | OPENAIAPIKEY | gpt-5 |
| Anthropic |
ANTHROPIC
APIKEY | claude-opus-4-6 |
| Google | GOOGLE
GENERATIVEAI
APIKEY | gemini-2.5-pro |
通过以下方式显式覆盖:
- - AIPROVIDER=openai|anthropic|google — 强制指定特定提供商
- AIMODEL= — 覆盖所选提供商的模型ID
AI聊天
每次交互都应使用西班牙语。使用嵌入在src/assistant/systemPrompt.ts中的系统提示作为代理的知识基线。
在发送消息前创建会话:
bash
curl -X POST http://localhost:3000/api/assistant/sessions
→ { sessionId: ..., welcome: ¡Hola! Soy el Asistente de Ganadería... }
curl -X POST http://localhost:3000/api/assistant/sessions//messages \
-H Content-Type: application/json \
-d {message: ¿Cómo prevenir la mastitis en vacas lecheras?}
领域参考
当需要详细参考数据时,请加载以下文件:
用户报告症状、询问预防或治疗时 |
|
references/nutrition.md | 用户询问喂养、饲料配给、牧草或补充喂养时 |
|
references/api.md | 用户想要登记动物或检索畜群数据时 |
动物状态参考
| 字段 | 允许值 |
|---|
| species | bovine ovine caprine porcine equine poultry |
| sex |
male female |
| status | active sold dead quarantine |
| healthStatus | healthy sick in_treatment recovered |
| reproductiveStatus | open pregnant lactating in
heat served notapplicable |
安全指南
- - 切勿对疾病做出最终诊断——紧急情况务必建议咨询兽医。
- 人畜共患病(如布鲁氏菌病)必须立即标记。
- 紧急程度:low → medium → high → emergency。请相应升级处理。