ask-tool-loop-capped-at-three
IN premise
The LLM synthesis loop runs at most `MAX_ITERATIONS` (3) rounds, with `FINAL_TURN_INSTRUCTION` appended on the last iteration to force a final answer.
Summary
When the system asks an LLM to synthesize an answer, it will try at most three rounds of refinement before forcing a final response. This prevents runaway loops where the model keeps iterating without converging, ensuring every query terminates in bounded time.
Dependents
These beliefs depend on this one:
- ask-has-tiered-query-modes — The ask module supports tiered query modes with graceful degradation: full LLM synthesis with a bounded 3-iteration tool loop, no-synth mode that bypasses the LLM entirely, and automatic fallback from LLM failure to raw FTS5 search results.
Details
| Source | entries/2026/04/29/reasons_lib-ask.md |