We present Context, the intelligence layer of the Magarshak Architecture, which replaces reactive query-response chatbots with proactive goal-directed agents that advance shared tasks without waiting for user prompts. The architecture rests on three mutually reinforcing mechanisms. Write-time context assembly precomputes enriched typed attributes via Groker agents, assembling interaction context as a deterministic pure function of graph state; context blocks are byte-identical across turns between semantic changes, enabling near-100% KV-cache reuse. Composable sandboxed wisdom programs form a governed library of LM-generated imperative programs declaratively wired to goal types via typed stream relations, composed via phase ordering, and executed at interaction time without further LM calls. Proactive goal stream state machines drive conversations toward terminal states by inspecting graph state and emitting structured interaction content (option arrays, governance affordances, clarification prompts) without awaiting user input. We prove six formal results: the Context Stability Theorem, bounding per-turn LM cost as a function of semantic change rate; a Program Composition Correctness Theorem; a Declarative Wiring Soundness Theorem; the Proactive Dominance Theorem, proving proactive agents weakly dominate reactive agents on expected turns-to-terminal-state; Coordination Overhead Elimination and Quality Preservation, establishing Pareto improvements in multi-participant goal chats; and a Cross-Platform Vote Consistency Theorem. Implemented in the open-source Qbix / Safebox / Safebots stack.
翻译:本文提出Context架构,作为Magarshak架构的智能层。该架构以主动目标导向智能体取代被动问答式聊天机器人,无需等待用户提示即可推进协作任务。其核心机制包含三个相互强化的组件:首先,在写入时通过Groker智能体预计算上下文组装,将交互上下文构建为图状态的确定性纯函数,生成的语义变更间上下文块实现字节级一致性,使得键值缓存利用率接近100%;其次,可组合沙盒智慧程序形成治理化的LM生成命令程序库,通过类型化流关系声明式布线至目标类型,经相位排序组合后在交互时执行且无需额外调用LM;最后,主动目标流状态机通过检测图状态并生成结构化交互内容(选项数组、治理权限、澄清提示)驱动对话向终止状态演进,无需等待用户输入。我们证明了六项形式化结果:上下文稳定性定理(界定每次LM调用成本与语义变更率的函数关系)、程序组合正确性定理、声明式布线完备性定理、主动优势定理(证明主动智能体在期望收敛步数上弱占优被动智能体)、协作开销消除与质量保持定理(建立多方目标对话的帕累托改进),以及跨平台投票一致性定理。该架构已在开源Qbix/Safebox/Safebots技术栈中实现。