Rikesh Silwal commited on
Commit Β·
d0a5d90
1
Parent(s): 4d4556a
doc(futurework): docuemnt limitation, and future work to mitigate that limitation
Browse files31 unmodified lines323334353637383940414263 unmodified lines10610710810911011111211311411511631 unmodified lines## Architecture OverviewThe system consists of four layers:(1) a **Budget Enforcer** that wraps every LLM call and raises a hard `BudgetExceededError` the moment either the 10-call or $0.20 limit is hit, halting execution immediately;(2) a **ReAct Agent Loop** that cycles through Think β Act β Observe β Reflect steps, tracking progress and triggering replanning when stuck;(3) a **Tool Registry** with three tools (web search, code execution, CSV analysis), each with hard timeouts;(4) an **AgentState** dataclass passed through the whole loop that records every step, budget consumption, and the final answer or stop reason.```βββββββββββββββββββββββββββββββββββββββββββββββββββ63 unmodified linesThree distinct prompts serve three distinct purposes:**1. ReAct prompt (`REACT_SYSTEM_PROMPT`)** β tells the LLM its remaining call and cost budget explicitly in the system message every iteration, forces JSON-only output via `response_format={"type": "json_object"}`, lists the three tools with their signatures, and instructs the agent to try a different approach (not retry) when a tool errors. Budget awareness is baked in as a constraint at the top, not a suggestion.**2. Reflect prompt (`REFLECT_SYSTEM_PROMPT`)** β a lightweight single-purpose call that asks "did the last action move us forward?" and returns `{"made_progress": bool, "reason": "...", "suggestion": "..."}`. Keeping this separate from the main ReAct call means the main reasoning loop stays focused on planning, not self-evaluation.**3. Replan prompt (`REPLAN_SYSTEM_PROMPT`)** β Provides the full history and explicitly asks for a *completely different* strategy, preventing the agent from re-suggesting what already failed.---31 unmodified lines323334353637383940414263 unmodified lines10610710810911011111211311411511611711811931 unmodified lines## Architecture OverviewThe system consists of four layers:\(1) a **Budget Enforcer** that wraps every LLM call and raises a hard `BudgetExceededError` the moment either the 10-call or $0.20 limit is hit, halting execution immediately;\(2) a **ReAct Agent Loop** that cycles through Think β Act β Observe β Reflect steps, tracking progress and triggering replanning when stuck;\(3) a **Tool Registry** with three tools (web search, code execution, CSV analysis), each with hard timeouts;\(4) an **AgentState** dataclass passed through the whole loop that records every step, budget consumption, and the final answer or stop reason.\```βββββββββββββββββββββββββββββββββββββββββββββββββββ63 unmodified linesThree distinct prompts serve three distinct purposes:**1. ReAct prompt (`REACT_SYSTEM_PROMPT`)**- tells the LLM its remaining call and cost budget explicitly in the system message every iteration, forces JSON-only output via `response_format={"type": "json_object"}`, lists the three tools with their signatures, and instructs the agent to try a different approach (not retry) when a tool errors. Budget awareness is baked in as a constraint at the top, not a suggestion.**2. Reflect prompt (`REFLECT_SYSTEM_PROMPT`)**- a lightweight single-purpose call that asks "did the last action move us forward?" and returns `{"made_progress": bool, "reason": "...", "suggestion": "..."}`. Keeping this separate from the main ReAct call means the main reasoning loop stays focused on planning, not self-evaluation.**3. Replan prompt (`REPLAN_SYSTEM_PROMPT`)**- provides the full history and explicitly asks for a *completely different* strategy, preventing the agent from re-suggesting what already failed.---
README.md+11-8