How an AI messaging agent was added to WhatsApp and CRM so customers can be greeted, answered from a knowledge base, and handed to CRM actions or a human agent in one live WhatsApp conversation, in English or Hebrew.
Sales, support, and operations teams often need to answer inbound WhatsApp messages when agents are busy, after hours, or when the request is a short qualification, FAQ, booking, or ticket. Leaving chats unread, forcing rigid bot menus, or copying data into CRM by hand loses context and time.
WhatsApp AI Agents brings a configurable AI chat agent into WhatsApp and vTiger CRM. An administrator defines what the agent is allowed to say and do. When a customer messages an assigned WhatsApp number, the webhook receives the message, builds the agent prompt with knowledge and live context, and replies through OpenAI, Grok, or Gemini.
The conversation stays on one open chat session, so a follow-up such as a preferred time or a transfer request continues the same history. The reply language follows the agent instructions and the customer’s language. Appointments, tickets, contacts, and handoffs follow only the actions the administrator enabled.
Inbound customers need an answer while they are in WhatsApp, not after a long wait for a free human agent or after navigating a fixed chatbot tree.
Customers ask about product, pricing, or support hours; Qualify a lead and capture name, Company, or need; create a ticket or appointment from the chat; Transfer to a human when the customer asks for one; or close the conversation politely when the request is complete.
Doing this only with human agents means missed chats, slow first replies, and inconsistent scripts. A separate chatbot outside CRM does not see WhatsApp history, does not sit on the CRM conversation, and does not know which CRM actions or team members the business approved.
The business requirement was to let the customer write naturally, and to let the WhatsApp agent answer from knowledge, run allowed CRM actions, and report what happened — all on the same live chat.
WhatsApp AI Agents was built as an administrator-configured messaging agent for WhatsApp and vTiger CRM.
WhatsApp AI Agent Workflow :
Administrators OpenAI Agents settings and create an agent. They choose the provider and model, write the main instructions, attach knowledge and rules, assign WhatsApp numbers, and turn on only the actions the business wants.
When a message arrives on an OpenAI chat, the receiver loads the agent, builds the system prompt (including live appointment availability when booking is enabled), calls the configured LLM, sends one customer-facing WhatsApp reply, and executes any returned CRM actions.
A follow-up message uses the same conversation history, so the CRM and the AI agent keep that chat. This is separate from the CRM web login session.
The objective was not to let the model change the CRM without a result the customer and the business can trust.
The objective was to turn a WhatsApp message into a short, natural reply, and — when configured — into a CRM search or create, a team assignment, an appointment, or a handoff to a human or flow chatbot.
Answer from the agent prompt, knowledge files and websites, and action rules.
Greet the customer, keep replies clear for chat, and continue multi-turn history.
Close the conversation or assign a human when the guidelines say so.
Create or update a contact, create or search a ticket, add an event or a task when those actions are enabled.
Book appointments only for selected CRM users, using live availability and working-day rules.
Ask only when a value cannot be decided from the conversation.
| Capability | What it does |
|---|---|
| Live Reply | Answers the inbound WhatsApp message on an OpenAI chat |
| Knowledge Reply | Uses admin prompt, knowledge sources, and rules as the source of facts |
| Close Conversation | Closes the chat session when the customer is done |
| Assign User / Team | Hands the chat to a CRM user or team (round-robin) and stops AI |
| Assign Chatbot | Hands the chat to a Flow Builder bot when needed |
| Create / Update Record | Creates or updates a contact (or selected module) from the chat |
| Ticket Actions | Creates or searches support tickets |
| Appointment / Task | Adds an event or task with working hours, slots, and selected bookable users |
| One Conversation | Chat history and turn count stay on the open conversation |
| Result on WhatsApp | The customer reads the answer; the CRM receives the action outcome |
Creates the agent, selects OpenAI, Grok or Gemini, writes instructions, attaches knowledge, assigns WhatsApp numbers, enables actions, and (for appointments) selects bookable CRM users.
The webhook receives messages.upsert, saves the inbound message, and resolves the open chat / conversation.
It loads the active agent for that number, builds the system prompt, appends recent conversation history, and (if appointments are on) injects fresh APPOINTMENT_AVAILABILITY.
The LLM returns a structured response: customer message + optional actions. The system sends exactly one WhatsApp reply for that turn.
If the model returns add_event, create_ticket, assign_team, close_conversation, etc., PHP executes only enabled actions with validation. Otherwise the chat stays open for the next customer message.
The customer asks about pricing or product fit. The agent replies only from the knowledge base and prompt, keeps the answer short, and asks one clarifying question when needed.
The customer inquires about package pricing or specific product features.
The agent references the knowledge files and instructions, avoiding fabricated claims.
“The license range is about 63 to 289 shekels per user per month, depending on the package. How many users do you expect?”
The customer asks for a person. The agent sends a brief handoff message, then returns assign_user / assign_team. The CRM assigns the chat, stops AI, and can email the assigned agent.
Customer requests a human representative or specialist.
The agent sends a brief handoff confirmation directly on WhatsApp.
Returns assign_user / assign_team. CRM assigns chat, stops AI turns, and notifies assigned staff.
The customer asks for a time with a selected bookable user (for example Tamir). The agent uses live slots from the snapshot. If they ask for someone not configured (for example Amit), the agent says that person is not available and offers bookable users instead — without silently booking someone else.
Customer asks to schedule with a team member or requests an open slot.
Agent checks live availability slots injected for authorized bookable CRM users.
Schedules the appointment or offers valid alternatives without misrouting.
The customer reports an issue. With Create Ticket enabled, the agent gathers missing details across turns, creates the HelpDesk ticket, and tells the customer the outcome.
Customer sends an issue description or requests technical support.
With Create Ticket enabled, the agent gathers missing details across turns.
Executes create_ticket in CRM and provides the ticket confirmation back in the chat.
Chat is open and AI is allowed to reply — run agent, send reply, execute actions.
Waiting for the next WhatsApp message — keep conversation history.
Chat handed to a CRM user/team — stop AI; agent works in inbox.
Conversation ended — close session; no further AI turns.
The system always tracks:
system_prompt — built each turn from agent, knowledge, rules, and live availability, history — recent user and assistant turns for the LLM, actions — create contact, ticket, event, assign, close, etc, bookable users — only selected appointment users can receive bookings
In simple terms: the customer talks on WhatsApp, the CRM stores records and action rules, and WhatsApp remains the channel that carries the live chat.
Put AI agents on your WhatsApp business numbers to answer customers day and night. Build agents with plain-English instructions, connect websites and documents as knowledge sources, manage CRM actions during chats, and handle live WhatsApp conversations with natural, friendly replies.
Put an AI agent on your WhatsApp business numbers and let it answer customers day and night. Manage all your agents from one screen in CRM Settings. See each agent's model, numbers and knowledge sources at a glance, and switch an agent on or off in one click, with features such as:
Build a WhatsApp agent without code. Write its instructions in plain English and connect your website and documents as its knowledge. Then choose exactly what it may do in your CRM during a chat, from opening service tickets to handing the chat to your team, with features such as:
Customers message your WhatsApp number and chat with your AI agent as they would with a person. The agent recognises returning customers by their number, answers from your knowledge sources, and updates your CRM while the chat continues. Every action appears on the customer's record, with features such as:
API keys stay on the server with the CRM agent record. The WhatsApp gateway does not receive the provider key. The same chat behavior is used whichever provider is selected.
Provider/API errors (for example quota exhausted) are stored as internal system notes for staff — not sent as technical messages to the customer.
Messages sit unread or delayed when human agents are busy or offline.
Replies immediately on OpenAI chats instead of waiting for a free agent.
Human staff repeatedly type answers and manually open forms to qualify prospects.
Answers from knowledge without opening a desktop form.
Rigid bot menus trap users or require manually searching for an available agent.
Assigns a CRM user/team when the customer asks for a person.
Copying contact, ticket, appointment, and task details into CRM by hand.
Creates contacts, tickets, events or tasks from chat when enabled.
Missed inbound leads and unanswered inquiries outside office hours.
Keeps a consistent script and language without staffing every minute.
Context is lost when the customer replies later, forcing repeated questions.
History stays on the conversation so the next message continues the request.
Disconnected communication, delayed responses, and lost customer opportunities.
The customer reads the answer; the business sees the CRM outcome.
Customers get a first reply without waiting for every FAQ or booking request.
Qualification and booking can continue when human agents are busy or offline.
The agent can ask for a missing detail and finish the same request on the next message.
Administrators write the instructions, knowledge, and rules that shape every reply.
Only enabled actions run, and appointments go only to selected bookable users.
Create, update, assign, close, or continue — every turn ends with a clear next step.
The agent runs only for chats that are open and AI-enabled on a configured WhatsApp number. CRM actions follow the agent configuration.
API keys are stored with the agent and are not exposed to the customer or the WhatsApp gateway.
Administrators control:
The same pattern can grow without changing how WhatsApp carries the live chat.
Richer CRM updates from a follow-up message on the same conversation.
More modules, using the same action framework.
Deeper analytics for reply time, booking rate, and handoff rate.
Richer post-chat summaries saved to the CRM.
Stronger multi-language templates per industry.
If something necessary is still missing, the agent asks, the customer replies on the same chat, and the original request continues.
The agent does not silently invent a person, company, ticket, or appointment that was never allowed. It asks — or refuses when rules say so.
It does decide the values a chat agent would expect it to decide:
The customer still sees the result. The administrator still decides which actions exist.