Appearance
AI Agents Center
The Panel exposes an AI Agents Center at /ai-agents where agencies can list active/paused agents, create new agents, edit existing agents, and perform activate/deactivate actions.
AI Gateway catalog (platform only)
The same route /ai-agents renders two experiences: in org mode, the agent center (this page). In platform view, the panel shows only the Catálogo AI Gateway (TanStack Table, sync, status polling, etc.) via AiAgentsRoute — navigation is gated by platform mode, not an extra CASL check on this screen. The Sincronizar control stays disabled unless the user has manage on platform.ai-model (POST /ai/models/refresh). List/status/model APIs still enforce their server-side policies. Model provider icons use https://models.dev/logos/<owner>.svg (same base as the Cerebro step).
Listing View
- Agentes Activos — Grid of active agent cards with metadata (model, stats), performance placeholders, and actions (Gestionar, Desactivar). "Gestionar" opens the edit dialog.
- Agentes Pausados — List of disabled agents with "Editar" and "Activar" actions.
- Crear Nuevo Agente — Banner that opens the create-agent dialog.
Create / Edit Agent Dialog
The same multi-step dialog is reused for both creating and editing agents. When editing, the form is pre-filled from the selected agent and submits to PUT /ai/agent/:id instead of POST /ai/agent.
A multi-step dialog (similar to Create Plan) guides users through agent configuration:
| Step | Label | Description |
|---|---|---|
| 1 | Identidad | Name, role, description, avatar, internal ID, visibility |
| 2 | Cerebro | Primary/fallback model (from /ai/models), languages |
| 3 | Conocimiento | RAG + documentos: activar RAG, Almacenamiento, listado de archivos, confirmación de envío, polling, reintentar y eliminar. Sin parámetros de fragmentación / umbral (eso solo en Configuración → RAG Avanzado). |
| 4 | Memoria | Placeholder (próximamente) |
| 5 | Configuración | Parámetros del modelo tab: limits (images, documents, requests/min, token caps, execution-limit action). RAG Avanzado tab: solo Habilitar RAG más parámetros de fragmentación / umbral / resultados (sin almacén ni listado de documentos; eso está en el paso Conocimiento). |
| 6 | Instrucciones | System prompt, greeting message, personality, writing style |
| 7 | Herramientas | Two tabs: Servidores MCP (default, existing MCP workspace unchanged) and Herramientas Internas (toggle Operations tools per agent). See Agent Internal Tools UI. |
- Create: Submits payload to
POST /ai/agentper Agent Management. Footer primary action is Siguiente until the last step, then Guardar Cambios (full form validation via the form schema before submit). - Edit: Submits partial payload to
PUT /ai/agent/:idwith identity, brain, and instructions. The Config step collects UI values for limits; both create and edit use the same steps. The header only shows Cerrar (X); Cancelar stays in the footer. While editing, the primary footer action is always Guardar on every step: it validates the entire form (Zod + RHF) and saves only when all fields pass validation.
Knowledge documents (RAG)
- After
POST /ai/agent/:agentId/knowledge/documentswith storage document IDs, the UI pollsGET /ai/agent/:agentId/knowledge/documentsevery 1s while any row ispendingorprocessing. If at least one row isprocessing, polling continues with no 15s cap until every row is terminal or the tab is hidden. Pending-only rows still respect the 15s window started after add/retry. - Reintentar calls
POST /ai/agent/:agentId/knowledge/documents/:docId/retryand starts the same polling window again. - Eliminar uses
DELETE /ai/agent/:agentId/knowledge/documents/:docId?deleteFromStorage=false(removes from knowledge/index only in the current UI).
API Usage
GET /ai/agent— List agentsPOST /ai/agent— Create agentPUT /ai/agent/:id— Update agent (e.g. isEnabled for activate/deactivate)GET /ai/models— List available models for Cerebro step (DB)GET /ai/models/catalog— Live Vercel AI Gateway catalog (readplatform.ai-model); used by the platform IA Agents tablePOST /ai/models/refresh— Platform: start catalog sync (requiresmanageplatform.ai-model)GET /ai/models/refresh/status— Platform: sync job status (requiresreadplatform.ai-model)GET /ai/agent/:id/knowledge/documents— List knowledge index rows for an agentPOST /ai/agent/:id/knowledge/documents— Attach storage documents to knowledge (async processing)POST /ai/agent/:id/knowledge/documents/:docId/retry— Retry failed indexingDELETE /ai/agent/:id/knowledge/documents/:docId— Remove knowledge document (deleteFromStoragequery flag)GET /ai/agents/:agentId/internal-tools/catalog— Fetch static tool catalog + currently enabled toolsPUT /ai/agents/:agentId/internal-tools— Bulk upsert enabled tools for the agent