from crewai import Task def get_research_task(agent, topic): return Task( description=f"""Research the topic "{topic}" extensively using PMC and Google Scholar. Follow these steps: 1. First search PMC using the pmc_search tool (collect at least 15 articles) 2. Then search Google Scholar using the google_scholar_search tool (collect remaining articles to reach 20+) 3. If not enough articles found, try: - Different search terms related to the topic - Broader search terms - Related topics or subtopics 4. CONTINUE SEARCHING UNTIL YOU HAVE AT LEAST 20 UNIQUE, RELEVANT ARTICLES For each source, carefully extract and analyze: - Title - Authors (full names for APA citation) - Publication year - Journal name (for APA citation) - Volume/Issue (if available) - DOI or URL (if available) - Key findings from abstract - Methodology used - Outcomes reported Combine and synthesize the information: - Identify common themes - Note conflicting findings - Highlight strongest evidence Organize findings by: - Study type (RCT, cohort, etc.) - Sample size - Follow-up duration - Outcome measures Output Format: 1. Summary of search strategy 2. Overview of findings 3. Detailed analysis of key studies 4. Evidence synthesis 5. Knowledge gaps identified 6. Complete reference list with: - Numbered references [1], [2], etc. - APA format for each reference - Minimum of 20 references Format: [N] Author(s) (Year). Title. Journal, Volume(Issue), Pages. DOI/URL Example: [1] Smith, J. D., & Jones, M. R. (2023). Study findings. Journal of Medicine, 45(2), 123-145. https://doi.org/10.1000/med.2023""", agent=agent, expected_output="A comprehensive research summary with at least 20 numbered references in APA format." ) def get_writing_task(agent, topic): return Task( description=f"""Write a comprehensive scientific paper about "{topic}" based on the research provided. Paper Structure: 1. Introduction (500-750 words): - Current state of knowledge - Clinical significance - Research gaps - Clear objectives - MUST include at least 8 in-text citations with reference numbers [1], [2], etc. 2. Materials and Methods (500-750 words): - Search strategy - Inclusion criteria - Data extraction process - Quality assessment - MUST include at least 5 methodology citations with reference numbers 3. Results (MINIMUM 1000 words): - Study characteristics - Patient demographics - Primary outcomes - Secondary outcomes - Safety data - Meta-analysis if applicable - Include specific data from at least 10 studies - MUST cite EVERY finding with reference numbers [N] - MINIMUM 12 unique citations in this section 4. Discussion (MINIMUM 1000 words): - Summary of main findings - Comparison with existing literature - Clinical implications - Strengths and limitations - Future research directions - MUST include at least 15 in-text citations with reference numbers - Compare and contrast findings from different studies - Address conflicting results - Discuss potential mechanisms 5. Conclusion (250-500 words): - Key takeaways - Clinical recommendations - Research priorities - Include 2-3 key citations with reference numbers 6. References: - List ALL cited articles (MINIMUM 20) - Number each reference [1], [2], etc. - Use proper APA format - Include DOI/URL when available - Alphabetical order by first author's surname Format: [N] Author(s) (Year). Title. Journal, Volume(Issue), Pages. DOI/URL Citation Guidelines: - Use numbered citations [N] throughout the text - Single reference: [1] or [2] - Multiple references: [1,2] or [1-3] - EVERY paragraph must have at least two citations - EVERY major claim needs a citation - Cite the most relevant and recent studies - Distribute citations across ALL sections IMPORTANT REQUIREMENTS: - MINIMUM 20 unique references - EVERY section must have citations - Use numbered references [N] consistently - Include proper APA formatting - Check that all in-text citations have corresponding numbered references - Verify that reference numbers match between in-text citations and reference list""", agent=agent, expected_output="A well-structured scientific paper with comprehensive analysis, numbered citations throughout all sections, and at least 20 properly formatted references." )