This paper presents a novel four-layer framework, the Algorithmic State Architecture (ASA), that conceptualizes an integrated system in which digital public infrastructure, policy data, algorithmic government/governance, and GovTech interact to provide effective services for AI-based government systems. Unlike existing approaches that treat these elements as parallel developments, the ASA positions them as interdependent layers and emphasizes specific interrelationships and feedback mechanisms. Through comparative analysis of cases from Estonia, Singapore, India, and the United Kingdom, it shows how the underlying digital infrastructure enables systematic data collection, which in turn enhances algorithmic decision-making processes and ultimately results in user-centered services. The results of the analysis reveal that successful implementation requires balanced development of all layers and special attention to integration mechanisms across layers. This framework contributes to both theory and practice by connecting previously unconnected areas of digital government research, revealing important dependencies that affect implementation success, and providing a structural approach to analyzing the maturity and development trajectories of AI-based government systems.