{
"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": null,
"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": null,
"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": "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": null,
"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
}
]
}