33 lines
1.4 KiB
Python
33 lines
1.4 KiB
Python
"""Reflection tool for strategic decision-making."""
|
|
|
|
from langchain_core.tools import tool
|
|
|
|
|
|
@tool(parse_docstring=True)
|
|
def think_tool(reflection: str) -> str:
|
|
"""Tool for strategic reflection on research progress and decision-making.
|
|
|
|
Use this tool after each search to analyze results and plan next steps systematically.
|
|
This creates a deliberate pause in the research workflow for quality decision-making.
|
|
|
|
When to use:
|
|
- After receiving search results: What key information did I find?
|
|
- Before deciding next steps: Do I have enough to answer comprehensively?
|
|
- When assessing research gaps: What specific information am I still missing?
|
|
- Before concluding research: Can I provide a complete answer now?
|
|
|
|
Reflection should address:
|
|
1. Analysis of current findings - What concrete information have I gathered?
|
|
2. Gap assessment - What crucial information is still missing?
|
|
3. Quality evaluation - Do I have sufficient evidence/examples for a good answer?
|
|
4. Strategic decision - Should I continue searching or provide my answer?
|
|
5. Skill leverage - Is there a relevant local skill to load that can accelerate this work?
|
|
|
|
Args:
|
|
reflection: Your detailed reflection on research progress, findings, gaps, and next steps
|
|
|
|
Returns:
|
|
Confirmation that reflection was recorded for decision-making
|
|
"""
|
|
return f"Reflection recorded: {reflection}"
|