The AI Ranch provides a RESTful API for interacting with the self-evolving agent system.
http://localhost:3000/api/ranch
GET /api/ranch/speciesResponse:
{
"success": true,
"data": [
{
"name": "cattle",
"description": "Heavy reasoning agent for complex analysis",
"capabilities": ["reasoning", "analysis", "email-processing"],
"fitness": 0.75,
"generation": 2
}
],
"timestamp": "2024-01-15T10:30:00Z"
}GET /api/ranch/species?name=cattlePOST /api/ranch/species
Content-Type: application/json
{
"name": "cattle",
"updates": {
"fitness": 0.85
}
}GET /api/ranch/tasksGET /api/ranch/tasks?active=truePOST /api/ranch/tasks
Content-Type: application/json
{
"content": "Analyze this email and extract key action items",
"source": {
"type": "api",
"channelId": "default",
"userId": "user-123"
}
}Response:
{
"success": true,
"data": {
"id": "task_1705315800000_abc123",
"intent": {
"content": "Analyze this email...",
"source": { "type": "api", "channelId": "default", "userId": "user-123" }
},
"routing": {
"species": "cattle",
"confidence": 0.85,
"reasoning": "Matched keywords: analyze, email"
},
"status": "queued"
},
"timestamp": "2024-01-15T10:30:00Z"
}GET /api/ranch/evolutionGET /api/ranch/evolution?current=truePOST /api/ranch/evolution| Species | Description | Best For |
|---|---|---|
| cattle | Heavy reasoning | Analysis, email processing |
| duck | Network specialist | API calls, webhooks |
| goat | Navigation | Pathfinding, spatial reasoning |
| sheep | Consensus | Voting, mediation |
| horse | ETL specialist | Data pipelines, batch processing |
| falcon | Fast search | Quick lookups, reconnaissance |
| hog | Diagnostics | Logging, debugging |
| chicken | Monitoring | Alerts, health checks |
| Status | Description |
|---|---|
| queued | Task waiting in queue |
| routing | Collie determining species |
| processing | Species handling task |
| completed | Task finished successfully |
| failed | Task encountered error |
- Evaluate - Score species fitness
- Cull - Remove underperforming species
- Breed - Create offspring from top performers
- Distill - Cloud training for offspring
- Quarantine - Test offspring in sandbox
- Promote - Promote successful offspring
{
"success": false,
"error": "Species 'unknown' not found",
"timestamp": "2024-01-15T10:30:00Z"
}- Species endpoints: 100 req/min
- Task endpoints: 60 req/min
- Evolution endpoints: 10 req/min