Global multi-service agent with intelligent service selection #31

Closed
opened 2026-04-10 02:04:51 +00:00 by timur · 1 comment
Owner

Problem

The current agent only works against a single service at a time (per-service tab). Many real-world tasks require coordinating multiple services.

Solution

Add a global agent accessible from the router dashboard (navbar button + main panel) that:

  1. Service selection step - LLM reads a compact catalog of all healthy services and their methods, determines which services the prompt needs
  2. Multi-service code generation - stages multiple Python clients, builds a combined system prompt with all selected interfaces, generates and executes a coordinated Python script
  3. Same retry/summarize pipeline as the per-service agent

Changes

  • agent.rs: Add run_global_agent() with build_service_catalog() and LLM-based service selection
  • routes.rs: Add POST /api/agent global endpoint
  • base.html: Add Agent button to navbar
  • index.html: Add global agent panel in main area
## Problem The current agent only works against a single service at a time (per-service tab). Many real-world tasks require coordinating multiple services. ## Solution Add a global agent accessible from the router dashboard (navbar button + main panel) that: 1. **Service selection step** - LLM reads a compact catalog of all healthy services and their methods, determines which services the prompt needs 2. **Multi-service code generation** - stages multiple Python clients, builds a combined system prompt with all selected interfaces, generates and executes a coordinated Python script 3. **Same retry/summarize pipeline** as the per-service agent ## Changes - agent.rs: Add run_global_agent() with build_service_catalog() and LLM-based service selection - routes.rs: Add POST /api/agent global endpoint - base.html: Add Agent button to navbar - index.html: Add global agent panel in main area
Author
Owner

Implemented on branch development_31 (commit 297b1f0):

Global Multi-Service Agent

A two-step AI agent pipeline that works across all registered services:

  1. Service Selection - LLM reads a compact catalog of all healthy services (name, description, methods) and determines which services the prompt needs. Returns a JSON array of service names.

  2. Multi-Service Code Generation - Stages all selected Python clients, builds a combined system prompt with all interfaces, generates and executes a coordinated Python script with retry loop.

Changes:

  • agent.rs: Added run_global_agent(), build_service_catalog(), GlobalAgentRequest, GlobalAgentResponse, summarize_global_result()
  • routes.rs: Added POST /api/agent route and global_agent_handler
  • base.html: Added Agent button to navbar with full agent panel (prompt, model selector, retries, result tabs showing answer/output/script, services badge showing which were selected)

API: POST /api/agent with {"prompt": "...", "model": "...", "max_retries": 3}

Returns AgentResponse + selected_services array.

All tests pass (7/7).

Implemented on branch development_31 (commit 297b1f0): **Global Multi-Service Agent** A two-step AI agent pipeline that works across all registered services: 1. **Service Selection** - LLM reads a compact catalog of all healthy services (name, description, methods) and determines which services the prompt needs. Returns a JSON array of service names. 2. **Multi-Service Code Generation** - Stages all selected Python clients, builds a combined system prompt with all interfaces, generates and executes a coordinated Python script with retry loop. **Changes:** - agent.rs: Added run_global_agent(), build_service_catalog(), GlobalAgentRequest, GlobalAgentResponse, summarize_global_result() - routes.rs: Added POST /api/agent route and global_agent_handler - base.html: Added Agent button to navbar with full agent panel (prompt, model selector, retries, result tabs showing answer/output/script, services badge showing which were selected) **API:** POST /api/agent with {"prompt": "...", "model": "...", "max_retries": 3} Returns AgentResponse + selected_services array. All tests pass (7/7).
timur closed this issue 2026-04-10 02:13:42 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_router#31
No description provided.