Skip to content

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:

StepLabelDescription
1IdentidadName, role, description, avatar, internal ID, visibility
2CerebroPrimary/fallback model (from /ai/models), languages
3ConocimientoRAG + 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).
4MemoriaPlaceholder (próximamente)
5ConfiguraciónPará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).
6InstruccionesSystem prompt, greeting message, personality, writing style
7HerramientasTwo 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/agent per 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/:id with 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/documents with storage document IDs, the UI polls GET /ai/agent/:agentId/knowledge/documents every 1s while any row is pending or processing. If at least one row is processing, 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/retry and 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 agents
  • POST /ai/agent — Create agent
  • PUT /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 (read platform.ai-model); used by the platform IA Agents table
  • POST /ai/models/refresh — Platform: start catalog sync (requires manage platform.ai-model)
  • GET /ai/models/refresh/status — Platform: sync job status (requires read platform.ai-model)
  • GET /ai/agent/:id/knowledge/documents — List knowledge index rows for an agent
  • POST /ai/agent/:id/knowledge/documents — Attach storage documents to knowledge (async processing)
  • POST /ai/agent/:id/knowledge/documents/:docId/retry — Retry failed indexing
  • DELETE /ai/agent/:id/knowledge/documents/:docId — Remove knowledge document (deleteFromStorage query flag)
  • GET /ai/agents/:agentId/internal-tools/catalog — Fetch static tool catalog + currently enabled tools
  • PUT /ai/agents/:agentId/internal-tools — Bulk upsert enabled tools for the agent