Skip to main content

GitHub All-Stars #1: deepagents - Architecture of Deep Reasoning for Agentic AI

Picture of Artur Skowroński, Head of Java/Kotlin Space

Artur Skowroński

Head of Java/Kotlin Space
Aug 27, 2025|22 min read
blue_optical_fiber
elements_of_agent_system

1WRITE_TODOS_DESCRIPTION = """Use this tool to
2create and manage a structured task list for your current work session.
3This helps you track progress, organize complex tasks,
4and demonstrate thoroughness to the user.
5It also helps the user understand the progress of the task
6and overall progress of their requests.
7
8## When to Use This Tool
9Use this tool proactively in these scenarios:
10
111. Complex multi-step tasks -
12When a task requires 3 or more distinct steps or actions
132. Non-trivial and complex tasks -
14Tasks that require careful planning or multiple operations
153. User explicitly requests todo list -
16When the user directly asks you to use the todo list
174. User provides multiple tasks -
18When users provide a list of things to be done
19(numbered or comma-separated)
205. After receiving new instructions -
21Immediately capture user requirements as todos
226. When you start working on a task -
23Mark it as in_progress BEFORE beginning work.
24Ideally you should only have one todo as in_progress at a time
257. After completing a task -
26Mark it as completed and add any new follow-up tasks
27discovered during implementation
28
29## When NOT to Use This Tool
30(....)
meme_AI_infrastructure

1research_sub_agent = {
2 "name": "research-agent",
3 "description": "Used to research more in depth questions",
4 "prompt": "You are an expert researcher...",
5 "tools": ["tavily_search_results_json"]
6}
7
8agent = create_deep_agent(
9 tools=[...],
10 instructions="Your main goal is to...",
11 subagents=[research_sub_agent]
12)
meme_good_vs_evil

The Single Responsibility Principle's Worst Nightmare

1# Initialize agent with file in virtual file system
2
3result = agent.invoke({
4 "messages": [{"role": "user", "content": "Analyze the provided data."}],
5 "files": {"input.csv": "col1,col2\nval1,val2"}
6})
7
8# read file from temporary file system
9output_files = result["files"]
10print(output_files.get("analysis_summary.txt"))
LangGraph_blocks_explained

1def create_deep_agent(
2 tools: Sequence[Union[BaseTool, Callable, dict[str, Any]]],
3 instructions: str,
4 model: Optional[Union[str, LanguageModelLike]] = None,
5 subagents: list[SubAgent] = None,
6 state_schema: Optional[StateSchemaType] = None,
7):
meme_about_agile

Image Alt

Subscribe to our newsletter and never miss an article