Tech Setup Overview
Agent Backend
• Built using LangGraph’s create_react_agent, currently configured as TaskAgent — integrates multiple tools (mostly other agents).
• Hosted on the LangGraph platform.
Frontend (UI)
• Powered by LangChain’s open-source Agent Chat UI.
• Deployed on Google Cloud Run.
Auth & Routing
• UI secured with Google Cloud IAP.
• UI ↔️ Agent communication routed via proxy (Next.js api). LangGraph API is not directly exposed to users.
Usage
• ~10 daily active users
⸻
Agent Initialization Code
def create_task_agent():
“”“Create the TaskAgent. Call this function to initialize the agent.”“”
reasoning_cfg = {“effort”: “high”, “summary”: “auto”} # optional
llm = ChatOpenAI(
model=“o3”, # any Responses-ready model (o4-mini, gpt-4o, …)
use_responses_api=True, # forces the new endpoint
output_version=“responses/v1”, # keeps block format stable
reasoning=reasoning_cfg, # returns reasoning summaries
store=True,
)
# Create the LangGraph agent
return create_react_agent(
name="agent", # Agent name in LangGraph
model=llm,
tools=[
tool1,
tool2,
tool3,
tool4,
# ...
{
"type": "web_search_preview",
"user_location": {"type": "approximate"},
"search_context_size": "medium"
}
],
prompt=task_agent_react_sys_prompt,
)
agent = create_task_agent()
⸻
Current Issues
1. Recursion Limit Exceeded
→ Hitting the default recursion limit (seems to be 25).
Any tips on how to increase this safely in LangGraph?
2. Frequent Task Cancellations (Critical)
→ Getting repeated task cancellation errors — hard to debug.
Need a permanent fix or robust mitigation strategy.
⸻