Many sensor network protocols are self-configuring, but independent self-configuration at different layers often results in suboptimal performance. We present Chi, a full-system configuration architecture that separates system logic from system configuration. Drawing from concepts in artificial intelligence, Chi allows full-system configuration that meets both changing application demands and changing environmental conditions. We show that configuration policies using Chi can improve throughput and energy efficiency without adding dependencies between layers. Our results show that sensornet systems can use Chi to adapt to changing conditions at all layers of the system, thus meeting the requirements of heterogeneous and continuously changing system conditions.