Abstract In-sensor optoelectronic computing offers a compelling route toward low-latency and energy-efficient machine vision, yet its expansion into the infrared spectrum remains fundamentally constrained by the absence of scalable and highly sensitive infrared kernel primitives (IKPs), which limits the application particularly under ultralow-light and complex conditions. Here we report highly efficient IKPs enabled by an ambipolar photoresponsive infrared photodetector consisting of an ambipolar field-effect transistor (AFET) and a heterojunction according to an optoelectrically decoupled architecture. Taking advantage of the symmetric ambipolar transport in Schottky-barrier (SB) carbon nanotube FET, the heterojunction-gated ambipolar FET (HGAFET) converts a directed photovoltage from the heterojunction gate into a positive photocurrent (PPC) or negative photocurrent (NPC) through adjusting the bottom gate voltage. The IKPs exhibit symmetric and sensitive ambipolar photoresponses, with both specific detectivities exceeding 10 13 Jones, to broad spectrum light from visible-to-shortwave infrared (vis-SWIR), and then have been demonstrated in-sensor multiply-accumulate operations and analog-domain interframe difference computations. The proposed in-sensor computing system based on these IKPs enables efficient feature recognition and motion awareness, achieving recognition accuracies above 90% under low-light conditions while reducing inference latency and computational cost by factors of 16.2× and 73.0×, respectively, and can act as a hardware-level strategy for all-weather infrared edge vision.