The Reply Agent generates user-facing responses that summarize completed work, present the hypothesis, and propose next steps. It adapts its output based on mode (chat vs deep research).
const replyText = await generateChatReply( question, { completedTasks, hypothesis, nextPlan: [], // No next plan in chat mode keyInsights, discoveries, methodology, currentObjective, uploadedDatasets }, { maxTokens: 1024, messageId, usageType: "chat" });// Example output:// "Based on literature search, rapamycin extends lifespan in mice by up to 60% // through mTOR pathway inhibition (Harrison et al., 2009). The mechanism involves..."
Detailed response with next steps and user feedback request:
const result = await replyAgent({ conversationState, message, completedMaxTasks, hypothesis, nextPlan, isFinal: true});// Example output:// "I completed literature search on mTOR and aging. Key findings:// // 1. mTOR inhibition extends lifespan across species// 2. Rapamycin is the primary mTOR inhibitor studied// // Current hypothesis: mTOR-dependent translation control regulates aging.// // Next steps:// - ANALYSIS: Analyze gene expression data for mTOR targets// - LITERATURE: Search for mTOR downstream effectors// // Does this plan look good? Feel free to modify or add tasks."