Skip to content

Commit b31900f

Browse files
authored
feat(augment): multi-agent improvements, limit removal, and routing fix (#2600)
* feat(augment): multi-agent improvements, limit removal, and routing fix Follow-up to #2555. Adds multi-agent orchestration improvements, removes artificial limits, and fixes multi-turn agent routing. Multi-agent orchestration: - ADK-based orchestrator with HITL approval mirroring, tool resolver, conversation state management, and agent handoffs - VectorStoreFacade lazy init and single-flight improvements - ResponsesApiService previous_response_id fix Limit removals (per design decision): - Remove MAX_TOOL_OUTPUT_CHARS, MAX_MCP_PROXY_RESPONSE_BYTES, MAX_RESPONSE_CHAIN_DEPTH, MAX_CONTINUATION_ITERATIONS, MAX_MESSAGE_CONTENT_LENGTH, and all truncation logic - Remove maxToolOutputChars and maxResponseChars config - Keep MAX_AUTO_REAPPROVALS (Llama Stack bug workaround), auth constants, timeouts, and cache limits Routing fix: - Upgrade @augment-adk/augment-adk from 0.1.11 to 0.1.12 - Restore createContinuationState and resumeState so follow-up messages resume from the active agent instead of restarting from the router Frontend enhancements: - ToggleSwitch component, selectMenuProps helper - Vector store UI and admin panel improvements Code quality: - McpAuthService double-map-lookup fix - TfIdfEmbedder sort simplification Documentation: - CONFIG_REFERENCE.md, TROUBLESHOOTING.md Tests: - Comprehensive coverage (162 suites, 2644 tests passing) - 6 resumeState continuity tests * fix(augment): address SonarCloud quality gate findings - Use localeCompare for string sorts (TfIdfEmbedder, BackendToolExecutor.test) - Fix Promise-in-boolean conditionals with !== undefined (McpAuthService, VectorStoreFacade) - Remove unnecessary non-null assertions (AdkOrchestrator, VectorStoreFacade) - Reduce cognitive complexity by extracting helpers: - AdkOrchestrator: resolveAgentContinuity(), mirrorPendingApprovals() - chatRoutes: resolveConversationId() - BackendToolExecutor: processDiscoveryResults(), preserveFailedServerTools(), etc. - Move makeMultiAgentSnapshot to outer describe scope (AdkOrchestrator.test) - Mark ToggleSwitch props as readonly * fix(augment): update API report and move test helper to module scope - Remove maxResponseChars from MCPServerConfig in report.api.md to match the source type (field was removed in limit-removal changes) - Move makeMultiAgentSnapshot to module scope (outside describe block) to satisfy SonarCloud's "no functions in nested scope" rule * fix(augment): use https in test mock URLs for SonarCloud security hotspots Replace http:// with https:// in test fixture data (mock baseUrl and serverUrl values) to clear SonarCloud security hotspot warnings about clear-text protocol usage.
1 parent 146e747 commit b31900f

52 files changed

Lines changed: 3406 additions & 584 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

workspaces/augment/README.md

Lines changed: 61 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,70 @@
22

33
This workspace contains the Augment plugin family for Red Hat Developer Hub.
44

5-
Augment is a configurable AI assistant with RAG, multi-agent orchestration, tool calling via MCP servers, and safety guardrails.
5+
Augment is a config-driven AI assistant built on [Llama Stack's OpenAI-compatible Responses API](https://developers.redhat.com/articles/2025/08/20/your-agent-your-rules-deep-dive-responses-api-llama-stack). It provides RAG-powered document search, multi-agent orchestration, tool calling via MCP servers, and safety guardrails — all running against open-source models on your own infrastructure.
6+
7+
## Architecture
8+
9+
Augment follows the same agent architecture as the [OpenAI Agents SDK](https://openai.github.io/openai-agents-python/multi_agent/): an agent is **not** a server-side resource — it is a client-side abstraction of `instructions + tools + model`, assembled into a `POST /v1/responses` call against Llama Stack.
10+
11+
```
12+
┌──────────────────────────────────────────────────────────┐
13+
│ Backstage Frontend (augment plugin) │
14+
│ Chat UI · Handoff visualization · Agent status panel │
15+
└──────────────────────┬───────────────────────────────────┘
16+
│ SSE / REST
17+
┌──────────────────────▼───────────────────────────────────┐
18+
│ Backstage Backend (augment-backend plugin) │
19+
│ │
20+
│ ┌─────────────────────────────────────────────────────┐ │
21+
│ │ ResponsesApiCoordinator (multi-agent orchestrator) │ │
22+
│ │ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │ │
23+
│ │ │ Router │→ │Specialist│→ │ Specialist │ │ │
24+
│ │ │ Agent │ │ Agent A │ │ Agent B │ │ │
25+
│ │ │ │ │ │ │ │ │ │
26+
│ │ │ tools: │ │ tools: │ │ tools: │ │ │
27+
│ │ │ transfer │ │ MCP svrs │ │ file_search, MCP │ │ │
28+
│ │ │ _to_* │ │ │ │ │ │ │
29+
│ │ └──────────┘ └──────────┘ └──────────────────┘ │ │
30+
│ └─────────────────────────────────────────────────────┘ │
31+
│ │
32+
│ DocumentService · ConversationManager · SafetyService │
33+
└──────────────────────┬───────────────────────────────────┘
34+
│ OpenAI-compatible REST
35+
┌──────────────────────▼───────────────────────────────────┐
36+
│ Llama Stack Server │
37+
│ /v1/responses · /v1/conversations · /v1/vector_stores │
38+
│ /v1/files · /v1/models · /v1/shields │
39+
└──────────────────────────────────────────────────────────┘
40+
```
41+
42+
### Multi-Agent Orchestration
43+
44+
Each agent in the YAML config becomes a unique `POST /v1/responses` call with its own `instructions`, `tools`, `temperature`, and `toolChoice`. Multi-agent routing uses the [OpenAI Agents SDK handoff pattern](https://openai.github.io/openai-agents-js/guides/handoffs/):
45+
46+
- **Handoffs** (`transfer_to_{agent}`): A router agent delegates to a specialist who takes over the conversation.
47+
- **Agents-as-tools** (`call_{agent}`): A manager agent calls specialists as tools and retains control of the response.
48+
49+
All agents share the same Llama Stack `conversation` ID for context continuity across handoffs.
50+
51+
### Key APIs Used
52+
53+
| Llama Stack API | Purpose |
54+
| ---------------------------- | ------------------------------------------------------------------ |
55+
| `POST /v1/responses` | All LLM inference — each agent config becomes a parameterized call |
56+
| `POST /v1/conversations` | Persistent conversation state across agent handoffs |
57+
| `POST /v1/vector_stores` | RAG document storage and retrieval |
58+
| `POST /v1/files` | Document upload for ingestion |
59+
| `GET /v1/models` | Model discovery and validation |
60+
| `POST /v1/safety/run-shield` | Input/output safety guardrails |
661

762
## Plugins
863

9-
| Plugin | Description |
10-
| ------------------------------------------------------------------------------------- | ---------------------------- |
11-
| [@red-hat-developer-hub/backstage-plugin-augment](./plugins/augment/) | Frontend plugin |
12-
| [@red-hat-developer-hub/backstage-plugin-augment-backend](./plugins/augment-backend/) | Backend plugin |
13-
| [@red-hat-developer-hub/backstage-plugin-augment-common](./plugins/augment-common/) | Shared types and permissions |
64+
| Plugin | Description |
65+
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
66+
| [@red-hat-developer-hub/backstage-plugin-augment](./plugins/augment/) | Frontend — chat UI, agent handoff visualization, admin panels |
67+
| [@red-hat-developer-hub/backstage-plugin-augment-backend](./plugins/augment-backend/) | Backend — multi-agent orchestrator, RAG ingestion, MCP integration |
68+
| [@red-hat-developer-hub/backstage-plugin-augment-common](./plugins/augment-common/) | Shared types, permissions, and security mode definitions |
1469

1570
## Development
1671

workspaces/augment/app-config.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,64 @@ augment:
3636
llamaStack:
3737
baseUrl: ${AUGMENT_LLAMA_STACK_URL:-http://localhost:8321}
3838
model: ${AUGMENT_MODEL:-meta-llama/Llama-3.3-70B-Instruct}
39+
40+
promptGroups:
41+
- id: getting-started
42+
title: Getting Started
43+
description: Common tasks to help you get up and running
44+
icon: rocket
45+
color: '#9333ea'
46+
order: 1
47+
cards:
48+
- title: Explore the Catalog
49+
description: Find components, APIs, and services
50+
prompt: What components and services are available in the Backstage catalog? Give me an overview.
51+
icon: search
52+
- title: Onboarding Guide
53+
description: New to the platform? Start here
54+
prompt: I'm new to this platform. Can you walk me through what's available and how to get started?
55+
icon: school
56+
- title: Check System Health
57+
description: Get a quick status overview
58+
prompt: Can you check the health and status of the platform services?
59+
icon: speed
60+
61+
- id: development
62+
title: Development
63+
description: Tools and helpers for your development workflow
64+
icon: code
65+
color: '#0ea5e9'
66+
order: 2
67+
cards:
68+
- title: Debug an Issue
69+
description: Troubleshoot errors and failures
70+
prompt: I'm running into an issue and need help debugging. Can you help me investigate?
71+
icon: bug
72+
- title: Review Logs
73+
description: Analyze recent logs for problems
74+
prompt: Can you help me review recent logs and identify any errors or warnings?
75+
icon: terminal
76+
- title: Code Review Help
77+
description: Get feedback on code changes
78+
prompt: I'd like help reviewing code changes. What best practices should I follow?
79+
icon: github
80+
81+
- id: operations
82+
title: Operations
83+
description: Manage deployments, infrastructure, and configurations
84+
icon: cloud
85+
color: '#10b981'
86+
order: 3
87+
cards:
88+
- title: Deployment Status
89+
description: Check current deployment state
90+
prompt: What is the current deployment status? Are there any recent deployments or rollouts in progress?
91+
icon: rocket
92+
- title: Infrastructure Overview
93+
description: Review cluster and resource usage
94+
prompt: Give me an overview of the infrastructure — cluster health, resource usage, and any alerts.
95+
icon: storage
96+
- title: Configuration Check
97+
description: Review and validate configurations
98+
prompt: Can you review the current configurations and flag any potential issues or misconfigurations?
99+
icon: settings

0 commit comments

Comments
 (0)