Skip to content

Conversation

@marioToribi0
Copy link
Contributor

Description here... Help the reviewer by:

🐞 Observed Behavior (Current Limitation)
In the current beta API for multi-agent systems, when an orchestrator agent invokes a sub-agent (or a nested agent), the model specified in the sub-agent's configuration is ignored. The model used for the sub-agent's execution is always inherited from the parent/orchestrator agent's execution context.

  • The model is explicitly defined on the sub-agent using the model property within ai.definePrompt, as shown below:
export const agent = ai.definePrompt({
  name: 'triageAgent',
  description: 'Triage Agent',
  model: "googleai/gemini-2.5-flash", // <- This model keeps for all the subagents
  tools: [catalogAgent, paymentAgent, representativeAgent],
  system: `You are an AI customer service agent for TechStore Computer Shop.
    Greet the user and ask them how you can help. Route them to the appropriate specialist agent:
    - Use catalogAgent for browsing products, searching items, or getting product information
    - Use paymentAgent for payment processing
    - Use representativeAgent for providing store information
    If you cannot help the customer with the available tools, politely explain so.`,
});
export const paymentAgent = ai.definePrompt({
    name: 'paymentAgent',
    model: "googleai/gemini-2.5-flash-lite", // <-- This model is currently being overwritten
    description:
      'Payment Agent can help process payments',
    tools: [processPaymentTool],
    system: `You are a payment agent for TechStore Computer Shop.
      Help customers process payments.
      Always confirm payment details before processing and provide clear transaction information.`,
  });
  • With this improvement, each agent (orchestrator and sub-agents) should respect its own configured model property. If the model is not defined on the sub-agent, it should inherit from the parent agent, or fall back to the project default.
  • Also, I add it a test app to test this project and futures features for multi-agent systems.

Checklist (if applicable):

@google-cla
Copy link

google-cla bot commented Nov 8, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added docs Improvements or additions to documentation js config labels Nov 8, 2025
@pavelgj
Copy link
Collaborator

pavelgj commented Nov 12, 2025

thanks for the PR. It looks good. Could you please run pnpm format to fix the formatter check.

@pavelgj pavelgj enabled auto-merge (squash) November 12, 2025 15:18
@pavelgj pavelgj merged commit ed71be8 into firebase:main Nov 12, 2025
5 checks passed
cabljac pushed a commit to invertase/genkit that referenced this pull request Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config docs Improvements or additions to documentation js

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants