Skip to content

Conversation

tzolov
Copy link
Contributor

@tzolov tzolov commented Oct 13, 2025

Add support for recursive (repetitive) advisor execution patterns, allowing advisors to re-invoke themselves or the remaining chain multiple times. This enables advanced patterns like retry logic, iterative refinement, and multi-pass processing.

  • Add AdvisorUtils.copyChainAfterAdvisor() utility to enable recursive chain invocation
  • Implement ToolCallAdvisor for recursive tool calling with configurable tool execution
  • Implement StructuredOutputValidationAdvisor for recursive output validation with retry logic
  • Add MCP JSON Jackson2 dependency for JSON schema validation
  • Add test suites for both new advisors and utility methods
  • Add documentation for recursive advisor patterns

Depends on: modelcontextprotocol/java-sdk#617

TODO: The ToolCallAdvisor doesn't implement streaming tool-calling model at the moment. Perhaps we can address this in a follow up issues along with auto-config integrations for the ToolCallAdvisor.

…-in advisors

Add support for recursive (repetitive) advisor execution patterns, allowing advisors to re-invoke
themselves or the remaining chain multiple times. This enables advanced patterns like retry logic,
iterative refinement, and multi-pass processing.

- Add AdvisorUtils.copyChainAfterAdvisor() utility to enable recursive chain invocation
- Implement ToolCallAdvisor for recursive tool calling with configurable tool execution
- Implement StructuredOutputValidationAdvisor for recursive output validation with retry logic
- Add MCP JSON Jackson2 dependency for JSON schema validation
- Add test suites for both new advisors and utility methods
- Add documentation for recursive advisor patterns

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
…idation feedback loop

Refactor retry logic to provide validation error feedback to LLM for self-correction.
Extract validation into separate method and augment prompts with error messages on retry.
Add comprehensive test coverage for various validation scenarios including nested objects,
lists, malformed JSON, and type mismatches.

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Implements return direct functionality allowing tools to bypass the LLM
and return results directly to clients. Adds null safety checks for
chatResponse and comprehensive test coverage.

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
@tzolov tzolov marked this pull request as ready for review October 14, 2025 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant