In this paper, we propose ERGO (edge architecture for Ag-IoT), an edge-computing architecture for infrastructureless smart agriculture environments. We also develop Ag-IoT application APIs and the associated microservice infrastructure. Our implementation and evaluations show that ERGO can operate independently of cloud-backed assistance, is highly scalable, modular, and affords composability benefits to Ag-IoT systems. We also demonstrate that ERGO outperforms traditional infrastructure in response latencies and transactional throughput, on average, by over 54% and 77%, respectively.