Skip to main content
LeClerk is our AI-powered WhatsApp assistant for restaurants. It understands customer intent, calls backend tools (address check, order updates, etc.), and replies with friendly, contextual messages via WhatsApp.

What you’ll learn here

  • The high-level architecture and where LeClerk fits in the platform
  • How customer messages and system events are processed
  • The internal XML structure used to guide the LLM
  • The tools the agent can call and when to use them
  • The key flows: address validation, order-draft updates, multi‑location routing
  1. Read the overview to get the big picture
  2. Understand how LeClerk is invoked
  3. Learn how the LLM is steered
  4. See what the agent can do
  5. Study the most important flows
  6. Browse the data models
  7. Run useful local commands
    • Developer commands and utilities: Commands

Architecture

High‑level map of components, flows, and integrations

Message Webhook

How customer WhatsApp messages reach LeClerk and are processed

Event Webhook

How backend events (payments, delivery, status) trigger proactive messages

Message Processing

XML tags, tool cycles, parsing, and response extraction

All Tools Reference

Full list of agent tools with parameters and when to use them

Check Address

Validate address, pick best location, compute fees/eligibility

Update Order Draft

The order pipeline (items/deals, validation, fees, timing, payment state)

Multi‑location

Organization mode, effective location, switching logic

Catalog Types

DTOs the LLM sees: products, SKUs, options, deals, restrictions

API Reference

Endpoints backing the chatbot flows (OpenAPI)

How it works (in one minute)

  • WhatsApp messages and system events hit the server; the server calls LeClerk via secured webhooks (Bearer token).
  • LeClerk builds a prompt with context, lets the LLM decide, and executes safe tool calls when needed.
  • Results are validated by the backend (business rules), then LeClerk sends a final response via the server to WhatsApp.
New to the codebase? Read the overview first, then follow the recommended path above. Keep the Tools Reference and API Reference open while developing.