> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyx.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture & Engines

> How the Anyx WorkOS is built for autonomous execution.

## The Tri-Engine Architecture

To enable autonomous delegation via WhatsApp, Anyx utilizes a highly complex, multi-layered architecture known as the **Tri-Engine**.

Traditional chatbots use a single Large Language Model (LLM) loop. The Anyx Tri-Engine decouples memory, decision-making, and execution into three distinct services.

<Frame>
  <img src="https://mintcdn.com/anyx/wybNzP_hOmPmq_qv/images/anyx_agents.jpeg?fit=max&auto=format&n=wybNzP_hOmPmq_qv&q=85&s=b370dea8bab64f9565107c94378e7bcc" alt="Anyx Tri-Engine Architecture" width="812" height="537" data-path="images/anyx_agents.jpeg" />
</Frame>

### 1. The Interaction Engine (Agentic Loop)

This is the "Brain" you speak to (RawBot/Groopy). It leverages the most advanced and latest LLMs from OpenAI, Anthropic (Claude), and Google (Gemini) to perform Natural Language Processing on your WhatsApp messages.

* It determines **intent** (Is this a chat? A task? A background rule?).
* It plans the execution steps and fires API calls to the connected Integration Hub.

### 2. The Stateful Memory Engine (Mem0 & Dynamic States)

A standard LLM loses context immediately. Anyx maintains persistent state mapping.

* **Mem0:** Extracts unstructured facts from your conversation ("My wife's name is Sarah") and stores it in encrypted vector databases for semantic retrieval months later.
* **Dynamic States:** Maintains structured JSON objects representing long-running tasks. If you ask RawBot to "Buy plane tickets," the Dynamic State tracks the status from `flight_search` to `awaiting_approval` to `booked`, even if the conversation spans multiple days.

### 3. The Proactive Lifecycle Engine (Bizy & Cron)

This engine runs entirely behind the scenes. It manages the `processor-proactive.ts` queue.
When you ask for a recurring task, the Interaction Engine communicates with the Proactive Engine to register a cron job. The Proactive Engine wakes up on schedule, boots an isolated LLM context, executes the checks, and only contacts you if the conditions are met.

***

## The OpenClaw Gateway

WhatsApp does not natively support complex agentic workflows or rapid API polling. To bridge this gap, we built **OpenClaw**.

OpenClaw is an open-source (internally managed) Node.js/Baileys gateway that maintains stable WebSocket connections to WhatsApp devices.

* It translates raw WhatsApp binary buffers into clean JSON.
* It manages session multi-device syncing.
* It intercepts backend commands to render the "FILE GENERATION ILLUSION". When RawBot outputs structured CSV data, OpenClaw intercepts the payload, compiles a physical `.csv` file in memory, and transmits it as a native WhatsApp document attachment.
