Pick an agent, classify, and write, in one step.
There is no classifier and then a writer waiting on it. One call, a fixed schema, and the message already knows who owns it and whether it can go out alone.
Conext classification is not a label for a report. It is the door that decides whether someone on the team has to look.
The model does not invent the shape of the answer.
Gemini has to call a function with the agent, the category (`automatico` or `pendiente`), whether it can auto-send, and the text. There is no free paragraph to parse afterwards: if it does not fit, there is no classification.
`automatico` is for what the catalog and the hours can resolve. `pendiente` is what needs a person’s judgment. `canAutoSend` is stricter: only if the reply is complete and safe. The agent’s switch can force it to false even if the model said yes.
The context is your business, not a generic one.
The prompt carries products with price and stock, hours, agents, and the recent thread. That is why it can say “yes, we have size M” or “we close at 6 today” without a tree you had to build.
If the same Meta message arrives twice (they retry if you are slow), the CRM ignores the second: the message id is already there. And if they write after hours, the away notice goes first, with a cap so it is not sent every five minutes.
In practice
- 1
The text comes in
History, catalog, and the list of agents are assembled.
- 2
The model fills the schema
Agent, category, whether it can send, and the reply already in WhatsApp format.
- 3
The CRM applies the rules
Open day, hours, the agent’s ceiling. Only then it sends or stays a draft.
Classification is not a label for a report. It is the door that decides whether a person has to look.
Want to see it with your own threads?
Essential includes one channel, 500 AI conversations per month, and one active agent.