Skip to content

Optimize LLM tool call execution and multi-repo searches#114

Merged
ishaanxgupta merged 2 commits intomainfrom
bolt-optimize-pipeline-tool-calls-16276008160634690662
Apr 13, 2026
Merged

Optimize LLM tool call execution and multi-repo searches#114
ishaanxgupta merged 2 commits intomainfrom
bolt-optimize-pipeline-tool-calls-16276008160634690662

Conversation

@ishaanxgupta
Copy link
Copy Markdown
Member

💡 What: Optimized the execution of LLM tool calls and multi-repository searches in the CodeRetrievalPipeline and RetrievalPipeline. Replaced sequential for loops with concurrent execution via asyncio.gather, while carefully preserving the required sequential processing of the gathered results to avoid race conditions on shared lists (sources, tool_messages).

🎯 Why: When the LLM decided to invoke multiple tools (e.g., retrieving different files simultaneously) or when a query targeted multiple repositories, the pipeline previously awaited each I/O-bound operation sequentially. This created a significant bottleneck where independent network/database requests were waiting on each other.

📊 Impact: Reduces latency significantly during multi-tool execution and global searches. For example, executing 5 tool calls that take 200ms each will now take ~200ms in total instead of ~1000ms.

🔬 Measurement: Measure the total execution time of the run method in RetrievalPipeline and CodeRetrievalPipeline when the LLM makes multiple tool calls in a single turn, or when searching across multiple repositories without specifying a repo. Observe the timing logs to verify concurrent execution.


PR created automatically by Jules for task 16276008160634690662 started by @ishaanxgupta

… asyncio.gather

Replaced sequential loops over `ai_response.tool_calls` in `CodeRetrievalPipeline` and `RetrievalPipeline` with concurrent execution using `asyncio.gather`. Also optimized multi-repository searches in `_search_symbols` and `_search_files` by gathering tasks concurrently. Added an entry to the journal documenting the performance pattern.
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@ishaanxgupta ishaanxgupta marked this pull request as ready for review April 13, 2026 04:27
@ishaanxgupta ishaanxgupta changed the title ⚡ Bolt: Optimize LLM tool call execution and multi-repo searches Optimize LLM tool call execution and multi-repo searches Apr 13, 2026
@ishaanxgupta ishaanxgupta merged commit 925f50b into main Apr 13, 2026
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.

1 participant