Chat y asistente

En la sección Chat puedes hablar con el asistente y, si está configurado, gestionar conversaciones de WhatsApp.

Vista del asistente

Cuando abres el chat del asistente (sin elegir un cliente concreto), la conversación es unificada: los mensajes que ves son los mismos que los de la sesión en terminal.

Para desarrolladores o usuarios avanzados: esa sesión corresponde al mismo contexto que usa el comando Artisan:

php artisan chat:simulate

Así puedes interactuar con el asistente desde la web y, si ejecutas el comando en terminal, verás la misma conversación. También al revés: los mensajes enviados desde terminal aparecen en la vista del asistente al recargar.

Chat con un cliente

Si eliges un cliente o contacto en la lista del chat, la conversación es para ese destinatario (p. ej. WhatsApp). El asistente puede sugerir respuestas; puedes activar o desactivar esto con el interruptor del robot junto al cuadro de mensaje.

Team flow prompts and routing

The Humano Assistant can merge extra instructions from per-team prompts (module prompts). Each prompt has a module (optional), a stable section key, a section label, and the instruction text for the model.

  • Routing key: if the prompt has a module, the key is «module_key:section_key» (e.g. «chat:onboarding»). Without a module, the routing key is just «section_key».
  • Manage prompts from the prompts list in the app (authenticated users). Path: /prompt/list
  • Para ver los párrafos exactos de «ayuda» que se añaden al prompt del sistema del asistente desde la configuración (web y WhatsApp), consultá Textos de ayuda del asistente (referencia).
Chat sidebar: Settings (AJUSTES)

Admins (admin / root) can change team-wide chat assistant options from the left sidebar in Chat.

ToggleMeaning
Humano Assistant replies / Assistant auto-respond Controls automatic assistant behaviour where that setting applies (e.g. inbound auto-replies).
Predefined test responses / Stub When on, uses canned test replies instead of the real model (development only).
Flujo por defecto When on, keyword routing to flows is off: the model picks flows using discovery and the commit-flow tool. Mutually exclusive with the keyword toggle below (same team setting, inverted in the UI).
Enrutado por palabras clave When on, attaches a team flow from the message using deterministic scoring (no extra LLM call for routing). See the next section.
Bloquear botón IA del asistente Team-level block for the assistant AI button in the chat UI.
Keyword routing vs AI discovery

Keyword routing on — The system scores global «intents» from configuration (phrases/words such as catalog, billing, etc.) and scores each active team prompt using:

  • The section key: hyphens/underscores are treated like spaces; a strong match is when the normalized phrase appears in the message, plus per-word matches with word boundaries.
  • The section label (additional signal): if the label is at least 12 characters after normalizing punctuation, the same scoring runs on the label text. Use the label for natural phrases users might type, while keeping the section key stable for APIs and routing keys.

The best global intent score and the best team-prompt score are compared; whichever side has the higher score wins. If both sides tie, the global intent wins. This is still literal text matching, not semantic «intent» from an embedding or a second model.

Keyword routing off (default flow / AI discovery) — No automatic attachment from keywords. The model sees available routing keys and can commit a flow when appropriate. Better for paraphrasing and vague user messages, at the cost of the model sometimes skipping a flow.

Textos de ayuda del asistente (referencia)

Estos párrafos se cargan desde la configuración y se añaden a las instrucciones del sistema del asistente cuando las herramientas están activas (web y WhatsApp). Esta página es la referencia pública de ese texto (la misma fuente que en producción).

Archivo de configuración: config/humano_interactive_guide.php

Asistente web (web_help_hint)
Help & Humano overview: If the user asks how Humano works, how to get started, training, "qué es Humano", or similar, give a short overview (contacts/CRM, projects, tasks, WhatsApp chat, AI assistant, billing if their team uses it) and point them to **Help / Documentation** and the **user manual** in the web app. Do **not** mention SSH, Artisan, terminal commands, or server-side tooling for these questions.

Onboarding (first-time setup), when relevant: (1) Create an account at **/register**. (2) Complete **team / business details** where the app prompts (team settings, profile, billing or tax data if shown). (3) **Optional payment**: **/registration/billing** or Stripe checkout may appear only when paid registration is enabled for that deployment; if access is free or billing is skipped, say so — do not assume everyone must pay. (4) **WhatsApp**: with a **local** connector, an onboarding step often offers **/registration/onboarding/qr** to scan a QR code (WhatsApp → linked devices). With **Cloud/Twilio**, linking is usually from **Chat** and provider settings; a QR may not appear on that screen. Wording depends on environment configuration.
WhatsApp entrante al cliente (whatsapp_help_hint)
Help & onboarding (WhatsApp customer): If they ask how Humano works, how to use the platform, or training, answer briefly in their language: Humano is the CRM/operations tool their provider uses; they interact through the team (links, WhatsApp, email the provider gave them). Suggest checking the provider's website or email for documentation. Do **not** mention SSH, Artisan, or server commands.

If the sender is clearly the **account owner** asking how to **set up Humano for their business** (not a typical end-customer), you may outline: register on the web (**/register**), complete team/business details in the app, optional billing step only if their environment requires payment, then link WhatsApp (QR on **/registration/onboarding/qr** when local connector applies, otherwise follow Chat / provider instructions). Emphasize that payment and QR steps depend on configuration.

La guía en terminal usa otro bloque (instructions); ejecutá: php artisan humano:interactive-guide. Clave de configuración: humano_interactive_guide.instructions

Admin: proactive WhatsApp (demo / onboarding)

Users with roles admin or root can send a forced-flow WhatsApp opening in three ways: slash command in the web assistant (own thread), slash command on the team WhatsApp number, or Artisan on the server.

Slash commands (chat or WhatsApp)
  • /enviar-demo +34… or /send-demo +34… — keyword «demo» + destination number.
  • /enviar-onboarding +34… or /send-onboarding +34… — palabra clave «onboarding» + número de destino; requiere un prompt activo del módulo Chat con section_key onboarding.
  • /system-onboarding +34… or /send-system-onboarding +34… — fixed Humano reseller onboarding (text + static screenshots), independent of team prompts.
  • /enviar-flujo cobrar +34… or /send-flow cobrar +34… — another active team prompt + number (spaces in the number are allowed).
  • In chat: only in your own assistant thread (no client selected). On WhatsApp: the sender must be a user linked to that phone with admin/root; runs even if inbound assistant is off for that contact.
Artisan (server)
php artisan humano:send-demo "+34600111222" --team=YOUR_TEAM_ID
php artisan humano:send-demo "+34600111222" --team=YOUR_TEAM_ID --keyword=onboarding
php artisan humano:system-onboarding "+34600111222" --team=YOUR_TEAM_ID
  • Optional: --user=USER_ID (defaults to the team owner). The user must belong to the team and have admin or root.
  • Opcional: --keyword=cobrar o --keyword=onboarding (debe coincidir con un prompt activo del equipo: section key, clave de ruteo o etiqueta).
  • Requires WhatsApp configured for the team and the same assistant flow engine as inbound auto-replies.
  • Local demo prompts: run «php artisan db:seed --class=ChatAssistantProactiveDemoPromptsSeeder» (after ModuleSeeder) for sample flows.
Sticky flow and reset

When a tool flow is active, the routing key may stick across messages until the user clearly changes topic. Substrings configured under assistant_tool_intent_prompts (e.g. «cambiar de tema») clear the sticky key and re-evaluate routing for that message.

Environment

Global intent routing can be disabled with ASSISTANT_TOOL_INTENT_PROMPTS=false. Minimum match score can be tuned with ASSISTANT_TOOL_INTENT_PROMPTS_MIN_SCORE.