node-red-contrib-leafengines
v1.0.0
Published
Node-RED nodes for LeafEngines Agricultural Intelligence API - Soil analysis, weather, crop recommendations, carbon credits, and MCP integration
Maintainers
Readme
node-red-contrib-leafengines
Node-RED nodes for LeafEngines Agricultural Intelligence API. Connect your agricultural automation workflows to soil analysis, crop recommendations, weather data, carbon credit calculations, and more.
Features
- 20+ Agricultural Intelligence Endpoints - Soil, water, weather, crop, carbon, and AI analysis
- Tier-Based Access Control - Automatically respects Free, Starter, Pro, and Enterprise rate limits
- Offline-First Architecture - Built-in caching with formal uncertainty quantification
- MCP Protocol Support - Compatible with Claude Desktop and other MCP agents
- Visual Workflow Builder - Drag-and-drop agricultural intelligence automation
Installation
Method 1: Node-RED Palette Manager (Recommended)
- Open Node-RED (usually at http://localhost:1880)
- Go to Menu → Manage Palette
- Click Install tab
- Search for
node-red-contrib-leafengines - Click Install
Method 2: npm CLI
# Install globally for all Node-RED instances
npm install -g node-red-contrib-leafengines
# Or install locally to your Node-RED user directory
cd ~/.node-red
npm install node-red-contrib-leafenginesMethod 3: Manual Installation
cd ~/.node-red
npm install https://github.com/soilsidekickpro/node-red-contrib-leafengines.gitQuick Start
1. Get Your API Key
- Visit soilsidekickpro.com/podcast for podcast-exclusive access
- Request your sandbox API key (
ak_sandbox_*) - Receive key via email (typically within a few hours)
2. Configure LeafEngines
- Drag a LeafEngines Config node to your flow
- Double-click to configure:
- Name: Your configuration name
- API Key: Your
ak_sandbox_*key - API URL:
https://[project].supabase.co/functions/v1 - Tier: Select your subscription tier
3. Create Your First Soil Analysis Flow
[inject] → [LeafEngines Soil] → [debug]Configure the LeafEngines Soil node:
- Configuration: Select your config node
- County FIPS: Enter a 5-digit FIPS code (e.g.,
48453for Napa County, CA) - Output Format: Choose
Full Analysis,Summary Only, orMinimal Data
4. Deploy and Test
- Click Deploy
- Click the inject node button
- Check debug panel for soil analysis results
Available Nodes
Configuration Nodes
- LeafEngines Config - API key management and connection settings
Specialized Data Nodes
- LeafEngines Soil - USDA soil composition by county FIPS (Free tier)
- LeafEngines Weather - Live weather and soil fusion data (Starter tier)
- LeafEngines Water - EPA water quality monitoring and analytics (Starter tier)
- LeafEngines Crop - AI crop recommendations, planting calendars, and plant identification (Starter/Pro tier)
- LeafEngines Carbon - Carbon credit estimation with practice change analysis (Pro tier)
- LeafEngines Prescription - Variable-rate prescription generation (Pro tier)
Optimization Nodes
- LeafEngines Batch - Batch multiple API calls into single requests (optimizes rate limits)
- LeafEngines Query - Generic node for any LeafEngines endpoint
Coming Soon Nodes
- LeafEngines Environmental - Environmental impact scoring and risk assessment
- LeafEngines Satellite - Google Earth Engine satellite integration
- LeafEngines AI Chat - Advanced conversational AI (Enterprise tier)
- LeafEngines Visual - Visual crop analysis and diagnostics
Example Flows
1. Automated Soil Health Monitoring
// Flow: Daily soil analysis with alerting
[schedule: daily 8am] → [LeafEngines Soil] → [function: check thresholds] → [switch: alert if needed] → [email/sms alert]2. Irrigation Optimization
// Flow: Smart irrigation scheduling
[weather forecast] → [LeafEngines Soil] → [LeafEngines Water] → [function: calculate irrigation] → [sprinkler controller]3. Carbon Credit Reporting
// Flow: Automated carbon credit calculation
[field sensor data] → [LeafEngines Carbon] → [function: format report] → [Google Sheets] → [email report]4. Variable-Rate Application
// Flow: Real-time prescription generation
[GPS position] → [LeafEngines Soil] → [LeafEngines Prescription] → [function: format for equipment] → [sprayer controller]5. Batch-Optimized Field Analysis
// Flow: Comprehensive analysis with batch optimization
[field parameters] → [prepare batch requests] → [LeafEngines Batch] → [combine results] → [field health score] → [report]6. Carbon Credit Automation
// Flow: Automated carbon credit reporting
[field data] → [LeafEngines Carbon] → [practice change analysis] → [report generator] → [regulatory submission]API Endpoints by Tier
Free Tier (2 endpoints)
get-soil-data- USDA soil compositioncounty-lookup- Geographic resolution
Starter Tier ($149/mo, 8 endpoints)
- All Free tier endpoints plus:
territorial-water-quality- EPA water monitoringmulti-parameter-planting-calendar- Planting optimizationlive-agricultural-data- Weather/soil fusionenvironmental-impact-engine- Risk scoringsafe-identification- Plant ID with toxic lookalike warnings
Pro Tier ($499/mo, 7 endpoints)
- All Starter tier endpoints plus:
agricultural-intelligence- AI crop recommendationscarbon-credit-calculator- Carbon credit estimationgenerate-vrt-prescription- Variable-rate prescriptionsleafengines-query- Natural language interface
Enterprise Tier ($1,999/mo, 3 endpoints)
- All Pro tier endpoints plus:
gpt5-chat- Advanced conversational AIvisual-crop-analysis- Visual diagnosticsgeo-consumption-analytics- Geographic pattern analysis
Rate Limits & Batch Optimization
Standard Rate Limits
| Tier | Requests/Minute | Requests/Day | Concurrent | Batch Size | |------|----------------|--------------|------------|------------| | Free | 10 | 1,000 | 2 | 5 | | Starter | 30 | 5,000 | 5 | 10 | | Pro | 100 | 25,000 | 10 | 25 | | Enterprise | 500 | 100,000 | 25 | 50 |
Effective Rate Limits with Batching
| Tier | Individual Calls | With Batching (5 calls/batch) | Improvement | |------|------------------|--------------------------------|-------------| | Free | 10/min | 50/min | 5x | | Starter | 30/min | 150/min | 5x | | Pro | 100/min | 500/min | 5x | | Enterprise | 500/min | 2,500/min | 5x |
Batch Optimization Tip: A single POST containing multiple JSON-RPC calls counts as 1 rate-limited request. The LeafEngines Batch node automatically optimizes multiple API calls into single batch requests.
Batch Optimization Examples
- Soil + Water + Weather Analysis (3 calls) → 1 batch request (66% reduction)
- Multi-County Comparison (5 counties) → 1 batch request (80% reduction)
- Full Field Analysis (8 endpoints) → 2 batch requests (75% reduction)
See examples/batch-optimization.json for a complete implementation.
MCP Protocol Integration
LeafEngines implements the Model Context Protocol (MCP), enabling AI agents to discover and invoke agricultural intelligence tools natively.
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"leafengines": {
"transport": "streamable-http",
"url": "https://[project].supabase.co/functions/v1/mcp-server",
"headers": {
"x-api-key": "ak_sandbox_your_key_here"
}
}
}
}OpenClaw Integration
LeafEngines appears as a discoverable MCP server in OpenClaw. Agents can:
- Discover available tools via
tools/list - Invoke tools with typed parameters
- Batch multiple operations in single requests
Data Integrity Guarantees
LeafEngines provides formal data integrity guarantees:
- Provenance Tracking - Chain of custody from source to decision
- Formal Uncertainty - Calibrated confidence intervals on all outputs
- Cryptographic Integrity - SHA-256 validation of cached data
- Temporal Consistency - Data staleness bounds per data type
- Compliance-Ready Audit Trail - SOC 2-aligned logging
Performance Benchmarks
| Endpoint | P50 Latency | P95 Latency | Cache Hit Rate | |----------|-------------|-------------|----------------| | get-soil-data | 12ms | 45ms | 94% | | county-lookup | 8ms | 32ms | 97% | | territorial-water-quality | 85ms | 210ms | 78% | | carbon-credit-calculator | 45ms | 120ms | 85% |
Troubleshooting
Common Issues
"Invalid API key" error
- Verify your key starts with
ak_ - Check for typos or extra spaces
- Ensure you're using the correct tier configuration
- Verify your key starts with
"Network error: No response received"
- Check your internet connection
- Verify the API URL is correct
- Check firewall/network restrictions
Rate limit errors
- Check your tier's rate limits
- Implement batch operations for multiple calls
- Add delay nodes between calls if needed
"County FIPS must be 5 digits"
- Use 5-digit FIPS codes only
- Find codes at: EPA FIPS Code Search
Debug Mode
Enable detailed logging:
# Start Node-RED with debug logging
node-red --verbose
# Or set environment variable
export DEBUG=node-red-contrib-leafengines*
node-redContributing
We welcome contributions! The LeafEngines Contributor Program provides API access and recognition for developers who extend the platform.
Contribution Tracks
- Integration Developer - Build Node-RED nodes, n8n workflows, Zapier actions
- Data Connector - Add new data source adapters
- Domain Expert - Crop-specific model validation, regional calibration
- Security Researcher - Responsible disclosure, penetration testing
See CONTRIBUTING.md for details.
Support
- Technical Support: [email protected]
- Enterprise Sales: [email protected]
- Contributor Program: [email protected]
- API Documentation: soilsidekickpro.com/api-docs
- GitHub Issues: github.com/soilsidekickpro/node-red-contrib-leafengines/issues
License
MIT License - see LICENSE file for details.
Acknowledgments
- USDA Natural Resources Conservation Service for soil data
- EPA for water quality monitoring data
- Google Earth Engine for satellite imagery
- Anthropic for Model Context Protocol specification
- Node-RED community for the amazing low-code platform
Podcast Listeners: Visit soilsidekickpro.com/podcast for exclusive Founders Series API keys with lifetime preferential pricing.
