deepagents: keep the numbers in tools, the agent only orchestrates
A working pattern for LangChain deepagents (0.7.x) in a numeric domain: create_deep_agent with one orchestrator and narrow subagents, each given only its own tool list; every calculation is a plain Python function wrapped as a StructuredTool, and the prompt forbids arithmetic, with a post-check that rejects any number in the narrative not found in a tool result. Human-in-the-loop uses a tool that calls langgraph interrupt() plus a checkpointer and a stable thread_id, resumed with Command(resume={...}) (a bare resume=None breaks). Add TodoListMiddleware explicitly if you want a visible plan. Wrap tools in your own runtime for a per-run lock (models issue parallel tool calls that race on shared files), memoisation keyed on tool, args and state files, and a fallback that builds the final artifact if the agent ends without it. InMemorySaver loses paused runs on restart.