Documentation

ChatPilot

Architecture Overview

Understand the ChatPilot webhook, queue, orchestration, and database architecture.

![System architecture](/img/architecture-overview.svg)

Inbound traffic flows from Meta Cloud API to the FastAPI webhook, then into Inngest pipelines before durable writes and provider calls complete.

| Subsystem | Responsibility |

|---|---|

| Webhook ingress | Verify challenges, validate signatures, and persist raw events. |

| Message processing | Normalize contacts, conversations, and messages. |

| AI orchestration | Classify, retrieve tenant content, reply, and request handoff. |

| Campaign automation | Resolve segments, send templates, and schedule follow-ups. |

| Commerce and payments | Create orders, initiate STK Push, and process callbacks. |

Key constraints: sub-5-second 200 OK, idempotent processing, and tenant isolation on every query.