{
"class_name": "SequentialWorkFlowGraph",
"goal": "Answer user questions accurately and concisely by decomposing the problem into analysis and generate.",
"tasks": [
{
"name": "generate_answer",
"description": "Draft an answer using the retrieved context.",
"inputs": [
{
"name": "question",
"type": "str",
"description": "The original question from the user.",
"required": true
}
],
"outputs": [
{
"name": "draft_answer",
"type": "str",
"description": "A concise, direct answer to the question.",
"required": true
}
],
"prompt": "\"\"\"\nYou can search and integrate the context to generate answers. Begin by analyzing the question `{question}` to identify its key components and potential complexities. Provide a draft answer that addresses these components. After generating the draft answer, critically evaluate it for accuracy, clarity, and completeness. Identify any issues and suggest improvements. Refine the draft answer based on the critique, ensuring that it effectively addresses the user's needs. Finally, validate the refined answer against the original question `{question}` to ensure it is accurate and reliable. Format your final answer in {final_answer}.\n\"\"\"",
"prompt_template": {
"class_name": "StringTemplate",
"instruction": "You can search and integrate the context to generate answers. You should provide the final answer (Yes or No) in the 'answer' field. Format your answer in xxx."
},
"system_prompt": "You are a helpful and highly intelligent assistant.",
"parse_mode": "xml",
"parse_func": null,
"parse_title": null,
"tool_names": null
},
{
"name": "critique_answer",
"description": "Check the drafted answer for correctness, faithfulness to the context, and alignment with the question.",
"inputs": [
{
"name": "question",
"type": "str",
"description": "The original question from the user.",
"required": true
},
{
"name": "draft_answer",
"type": "str",
"description": "The answer proposed by generate_answer.",
"required": true
}
],
"outputs": [
{
"name": "is_valid",
"type": "bool",
"description": "Whether the draft answer is correct and well-supported by the context.",
"required": true
},
{
"name": "issues",
"type": "list[str]",
"description": "List of detected issues (e.g., hallucination, missing details, ambiguity).",
"required": false
},
{
"name": "suggested_improvements",
"type": "str",
"description": "Textual suggestions on how to improve the answer, if needed.",
"required": false
}
],
"prompt": "\"\"\"\nYou are an Answer Critique Agent.\nCompare the {draft_answer} to the context and {question}.\n1) Assess whether the {draft_answer} is fully supported and correctly addresses the {question} based on clear criteria such as relevance, accuracy, completeness, and the complexity of the inquiry.\n2) If the {draft_answer} is not valid, identify specific issues and suggest actionable improvements that directly relate to the identified problems, ensuring that the suggestions are clear and feasible.\n3) If the {question} is ambiguous or unclear, note this and recommend seeking clarification to ensure a more accurate response.\n4) Prioritize the identified issues based on their impact on the validity of the answer, indicating which issues are most critical to address.\nReturn XML with , (items as ), and .\n\"\"\"",
"prompt_template": {
"class_name": "StringTemplate",
"instruction": "You are an Answer Critique Agent.\nCompare the draft answer to the context and question.\n1) Mark if the answer is fully supported and correctly addresses the question.\n2) If not valid, list concrete issues and suggest how to fix them.\nReturn XML with , (items as ), and ."
},
"system_prompt": "You are a helpful and highly intelligent assistant.",
"parse_mode": "xml",
"parse_func": null,
"parse_title": null,
"tool_names": null
},
{
"name": "validate_answer5329",
"description": "Task to validate_answer5329. Takes question, draft_answer, is_valid, issues as input. Produces validation_result as output.",
"inputs": [
{
"name": "question",
"type": "str",
"description": "Input parameter question for validate_answer5329",
"required": false
},
{
"name": "draft_answer",
"type": "str",
"description": "Input parameter draft_answer for validate_answer5329",
"required": false
},
{
"name": "is_valid",
"type": "str",
"description": "Input parameter is_valid for validate_answer5329",
"required": false
},
{
"name": "issues",
"type": "str",
"description": "Input parameter issues for validate_answer5329",
"required": false
}
],
"outputs": [
{
"name": "validation_result",
"type": "str",
"description": "Output parameter validation_result from validate_answer5329",
"required": true
}
],
"prompt": "\"\"\"\nThink step by step to answer the question based on the context provided in {question}. Carefully analyze the components of the question to identify any ambiguities or complexities that may require nuanced responses. If the reasoning leads to unclear conclusions, acknowledge the uncertainty and outline the factors contributing to it. Additionally, consider any conflicting evidence or insufficient context that may impact the final answer. Explain your thought process clearly in the field, ensuring that all relevant aspects are addressed. Provide the final answer in the field, making sure it is as accurate and concise as possible given the information available.\n\"\"\"",
"prompt_template": {
"class_name": "StringTemplate",
"instruction": "Think step by step to answer the question based on the question context. You should integrate context for answering. You should explain your thinking process in the 'thought' field, and provide the final answer in the 'answer' field.\nFormat your output in xml format, such as xxx and xxx."
},
"system_prompt": "You are a helpful and highly intelligent assistant.",
"parse_mode": "xml",
"parse_func": null,
"parse_title": null,
"tool_names": null
},
{
"name": "refine_answer",
"description": "Refine or rewrite the answer based on critique, preserving factual alignment with the context.",
"inputs": [
{
"name": "question",
"type": "str",
"description": "The original question from the user.",
"required": true
},
{
"name": "draft_answer",
"type": "str",
"description": "The initial answer to be refined.",
"required": true
},
{
"name": "is_valid",
"type": "bool",
"description": "Validation flag from critique_answer.",
"required": true
},
{
"name": "suggested_improvements",
"type": "str",
"description": "Guidance from the critique_answer step on how to improve the answer.",
"required": false
}
],
"outputs": [
{
"name": "answer",
"type": "str",
"description": "Final, concise, and validated answer ready to return to the user.",
"required": true
}
],
"prompt": "\"\"\"\nYou are an Answer Refinement Agent.\nIf {is_valid} is true, lightly polish the {draft_answer} for clarity and brevity, ensuring it accurately addresses the {question} and incorporates any relevant details.\nIf {is_valid} is false, utilize the {suggested_improvements} and context to rewrite the {draft_answer} so that it is correct, fully supported, and concise (1\u20133 sentences), while ensuring it aligns with the nuances of the {question} and addresses any conflicting evidence or ambiguities.\nProvide the final answer (Yes or No) in the 'answer' field, formatted as {answer}, based on the clarity, accuracy, and relevance of the refined answer to the {question}, ensuring that it meets the criteria for correctness and completeness.\n\"\"\"",
"prompt_template": {
"class_name": "StringTemplate",
"instruction": "You are an Answer Refinement Agent.\nIf is_valid is true, you may lightly polish the draft answer for clarity and brevity.\nIf is_valid is false, use the suggested improvements and context to rewrite the answer so that it is correct, fully supported, and concise (1\u20133 sentences).\nYou should provide the final answer (Yes or No) in the 'answer' field. Format your answer in xxx."
},
"system_prompt": "You are a helpful and highly intelligent assistant.",
"parse_mode": "xml",
"parse_func": null,
"parse_title": null,
"tool_names": null
},
{
"name": "validate_answer882",
"description": "Task to validate_answer882. Takes question, answer as input. Produces final_answer as output.",
"inputs": [
{
"name": "question",
"type": "str",
"description": "Input parameter question for validate_answer882",
"required": false
},
{
"name": "answer",
"type": "str",
"description": "Input parameter answer for validate_answer882",
"required": false
}
],
"outputs": [
{
"name": "final_answer",
"type": "str",
"description": "Output parameter final_answer from validate_answer882",
"required": true
}
],
"prompt": "```\n\"\"\"\nThink step by step to answer the question based on the context provided in {question}. You should integrate relevant context and clarify any assumptions made during the reasoning process. In the 'thought' field, explain your reasoning, including how you addressed any complexities or nuances in the question. If the question is ambiguous or complex, outline the different interpretations and how they affect the answer. Provide the final answer in the 'answer' field, ensuring it directly addresses {question}. Format your output in XML format, such as {thought} and {answer}. Additionally, validate the final answer against the criteria of relevance, accuracy, and clarity to ensure it meets the expectations set by {question}. If evidence contradicts the initial predictions, explain how this impacts the reasoning process and the final answer.\n\"\"\"\n```",
"prompt_template": {
"class_name": "StringTemplate",
"instruction": "Think step by step to answer the question based on the question context. You should integrate context for answering. You should explain your thinking process in the 'thought' field, and provide the final answer in the 'answer' field.\nFormat your output in xml format, such as xxx and xxx."
},
"system_prompt": "You are a helpful and highly intelligent assistant.",
"parse_mode": "xml",
"parse_func": null,
"parse_title": null,
"tool_names": null
}
]
}