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
Start here (recommended path)
- Read the overview to get the big picture
- Architecture & concepts: LeClerk Architecture
- Understand how LeClerk is invoked
- Message webhook (customer messages): Message Webhook
- Event webhook (system events): Event Webhook
- Learn how the LLM is steered
- XML tags, parsing, guardrails: Message Processing
- See what the agent can do
- Complete tool catalog and usage rules: All Tools Reference
- Study the most important flows
- Address validation and location selection: Check Address
- Order building and validation pipeline: Update Order Draft
- Chain and location routing: Multi‑location Management
- Browse the data models
- Catalog types (products, SKUs, options, deals): Catalog Types
- Run useful local commands
- Developer commands and utilities: Commands
Quick links
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.