Skip to content

Limit tool calling recursion in agent and address unclear questions#292

Merged
kdid merged 1 commit intodeploy/prototypefrom
5434-vague
Mar 11, 2025
Merged

Limit tool calling recursion in agent and address unclear questions#292
kdid merged 1 commit intodeploy/prototypefrom
5434-vague

Conversation

@kdid
Copy link
Copy Markdown
Contributor

@kdid kdid commented Mar 7, 2025

Summary

  • Limit the number of tools the agent uses in a turn
  • Prompt the agent to ask for clarification on vague questions

Caveats:

  • recursion limit is not the number of tool calls per se, it is the number of supersets: https://langchain-ai.github.io/langgraph/how-tos/recursion-limit/, so a limit of 10 equates to roughly 4-5 searches. (not sure if I should set this lower?)
  • When the recursion limit is reached, the last 5 messages are retrieved from the checkpointer, summarized and sent as an "answer" to the user. Then the final message is sent.

Steps to test

@kdid kdid requested review from bmquinn, charlesLoder and mbklein March 7, 2025 22:19
@kdid kdid self-assigned this Mar 7, 2025
Copy link
Copy Markdown
Member

@mbklein mbklein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kdid kdid merged commit e530be9 into deploy/prototype Mar 11, 2025
1 check passed
@kdid kdid deleted the 5434-vague branch March 11, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants