Expert livestock management assistant for Spanish-speaking farmers. Responds always in Spanish. Combines AI chat with a REST API for herd record-keeping.
http://localhost:3000Before using any REST API endpoint, start the server:
bash
bash scripts/start.sh
The server exposes /health, /api/animals, and /api/assistant — see
references/api.md for the full endpoint reference.
The assistant supports OpenAI, Anthropic (Claude), and Google (Gemini). Set at least one API key; the assistant auto-selects the provider.
ProviderAPI key env varDefault modelOpenAIOPENAI_API_KEY``gpt-5AnthropicANTHROPIC_API_KEY``claude-opus-4-6GoogleGOOGLE_GENERATIVE_AI_API_KEY``gemini-2.5-pro
Override explicitly via:
AI_PROVIDER=openai|anthropic|google — force a specific providerAI_MODEL=<model-id> — override the model ID for the chosen providerEvery 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:
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/<sessionId>/messages \
-H "Content-Type: application/json" \
-d '{"message": "¿Cómo prevenir la mastitis en vacas lecheras?"}'
Load these files when you need detailed reference data:
ReferenceWhen to readreferences/breeds.mdUser asks about breeds, selection, or characteristicsreferences/diseases.mdUser reports symptoms, asks about prevention or treatmentreferences/nutrition.mdUser asks about feeding, rations, forages, or supplementationreferences/api.mdUser wants to register animals or retrieve herd data
FieldAllowed valuesspecies``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 not_applicable
low → medium → high → emergency. Escalate accordingly.