pycognition: A Dual-Process Cognitive Architecture Integrating Deterministic Procedural Execution and Deliberative LLM Synthesis

pycognition is an open-source neurosymbolic framework formalizing psychological Dual-Process Theory for autonomous software agents. Contemporary agent architectures (e.g., ReAct, AutoGen) uniformly route deterministic and repetitive sub-tasks through stochastic foundation model APIs, incurring substantial latency, financial token overhead, and execution drift. pycognition addresses this efficiency gap via a segregated execution topology: an ultra-fast procedural tier (System 1, executing validated Python scripts at sub-millisecond latencies with zero API token consumption) and a deliberative reasoning tier (System 2, orchestrating frontier LLM inference). The Skill Crystallization pipeline compiles verified reasoning traces into strongly typed procedural modules, fortified by Abstract Syntax Tree (AST) safety inspection and sandboxed unit testing via pytest prior to dynamic memory ingestion. Key Empirical Findings (N = 100 heterogeneous benchmark tasks): Marginal Procedural Speedup: Compiled System 1 routines achieve a mean latency of 0.292 ms vs. 3,307.41 ms for algorithmic LLM calls (11,326.7x marginal speedup) and 5,580.36 ms for aggregate System 2 deliberation (19,103.9x). Realistic Break-Even Dynamics: Explicitly accounting for autonomous script development latency (mean 7,192.20 ms / cold-start 10,499.60 ms), the per-skill break-even point is reached at k = 4 calls under ideal synthesis and k = 5 calls accounting for the 36.2% sandbox rejection rate. Workload Execution Time: Asynchronous task response time across 85 algorithmic tasks decreased by 44.7% (155.46 s vs. 281.13 s baseline). Full synchronous cluster break-even is reached at N* ≈ 207 tasks. Token Amortization: Cumulative token expenditure dropped by 38.0% (53,978 vs. 87,061 tokens), scaling to 71.4% procedural coverage in the steady-state final quartile. Defensive Sandboxing: The verification harness filtered 17 flawed candidate modules (36.2%), preventing silent runtime regressions and guaranteeing 100% execution fidelity across all System 1 invocations. Package Contents: pycognition_preprint_en.pdf: Full English preprint (canonical academic version) pycognition_preprint_de.pdf: Vollständiger wissenschaftlicher Preprint in deutscher Sprache. pycognition_preprint_ru.pdf: Полная академическая версия статьи на русском языке. pycognition_preprint_trilingual.html: Monolithic standalone HTML manuscript with native MathML equations. metrics_100_deepseek.csv: Raw benchmark execution telemetry and latency measurements.

Authors

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-05
DOI
https://doi.org/10.5281/zenodo.23979551
Primary Topic
AI-based Problem Solving and Planning
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

pycognition: A Dual-Process Cognitive Architecture Integrating Deterministic Procedural Execution and Deliberative LLM Synthesis

Oleh Riabtsev
Zenodo (CERN European Organization for Nuclear Research)
AI-based Problem Solving and Planning
preprint

pycognition: A Dual-Process Cognitive Architecture Integrating Deterministic Procedural Execution and Deliberative LLM Synthesis

Oleh Riabtsev
preprint en

Abstract

pycognition is an open-source neurosymbolic framework formalizing psychological Dual-Process Theory for autonomous software agents. Contemporary agent architectures (e.g., ReAct, AutoGen) uniformly route deterministic and repetitive sub-tasks through stochastic foundation model APIs, incurring substantial latency, financial token overhead, and execution drift. pycognition addresses this efficiency gap via a segregated execution topology: an ultra-fast procedural tier (System 1, executing validated Python scripts at sub-millisecond latencies with zero API token consumption) and a deliberative reasoning tier (System 2, orchestrating frontier LLM inference). The Skill Crystallization pipeline compiles verified reasoning traces into strongly typed procedural modules, fortified by Abstract Syntax Tree (AST) safety inspection and sandboxed unit testing via pytest prior to dynamic memory ingestion. Key Empirical Findings (N = 100 heterogeneous benchmark tasks): Marginal Procedural Speedup: Compiled System 1 routines achieve a mean latency of 0.292 ms vs. 3,307.41 ms for algorithmic LLM calls (11,326.7x marginal speedup) and 5,580.36 ms for aggregate System 2 deliberation (19,103.9x). Realistic Break-Even Dynamics: Explicitly accounting for autonomous script development latency (mean 7,192.20 ms / cold-start 10,499.60 ms), the per-skill break-even point is reached at k = 4 calls under ideal synthesis and k = 5 calls accounting for the 36.2% sandbox rejection rate. Workload Execution Time: Asynchronous task response time across 85 algorithmic tasks decreased by 44.7% (155.46 s vs. 281.13 s baseline). Full synchronous cluster break-even is reached at N* ≈ 207 tasks. Token Amortization: Cumulative token expenditure dropped by 38.0% (53,978 vs. 87,061 tokens), scaling to 71.4% procedural coverage in the steady-state final quartile. Defensive Sandboxing: The verification harness filtered 17 flawed candidate modules (36.2%), preventing silent runtime regressions and guaranteeing 100% execution fidelity across all System 1 invocations. Package Contents: pycognition_preprint_en.pdf: Full English preprint (canonical academic version) pycognition_preprint_de.pdf: Vollständiger wissenschaftlicher Preprint in deutscher Sprache. pycognition_preprint_ru.pdf: Полная академическая версия статьи на русском языке. pycognition_preprint_trilingual.html: Monolithic standalone HTML manuscript with native MathML equations. metrics_100_deepseek.csv: Raw benchmark execution telemetry and latency measurements.

Zenodo (CERN European Organization for Nuclear Research)
University of Vechta (DE)
AI-based Problem Solving and Planning
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon