"""Report writing task — synthesize findings into investment memo.""" from __future__ import annotations from crewai import Agent, Task def build_report_task( report_writer: Agent, company_name: str, output_dir: str, context_tasks: list | None = None, ) -> Task: return Task( description=f""" You are writing the final investment memo for **{company_name}**. You have access to research findings and financial analysis from previous agents. ## Memo Structure (Required) Write a comprehensive investment memo in Markdown with exactly these sections: ```markdown # Investment Memo: {{Company Name}} **Date:** {{today}} **Analyst Team:** DealFlow AI **Status:** For Investment Committee Review --- ## Executive Summary [2-3 paragraphs: what the company does, why it's interesting, recommendation] ## Company Overview - **Company:** ... - **Founded:** ... - **Stage:** ... - **Ask:** ... - **Use of Funds:** ... - **Website:** ... ## Problem & Solution [Describe the problem being solved and the startup's solution] ## Market Opportunity | Metric | Value | Source | |--------|-------|--------| | TAM | $XB | ... | | SAM | $XB | ... | | SOM | $XM | ... | [Market dynamics, tailwinds, headwinds] ## Product & Technology [Product description, tech stack, moat/defensibility] ## Business Model [Revenue model, pricing, unit economics] ## Traction & Financials [Current revenue, growth metrics, projections, burn rate] [Reference any generated charts here] ## Team | Name | Role | Background | |------|------|-----------| ... ## Competitive Landscape [Top competitors, differentiation, competitive advantages] ## Risk Assessment | Risk | Severity | Mitigation | |------|----------|-----------| ... ## Investment Recommendation **Recommendation:** [PASS / SOFT PASS / WATCH / INVEST] **Rationale:** [Clear, 3-5 sentence rationale] **Key Investment Thesis Points:** 1. ... 2. ... 3. ... **Key Risks:** 1. ... 2. ... 3. ... **Due Diligence Priorities (if moving forward):** 1. ... 2. ... 3. ... --- *Generated by DealFlow AI — Multi-Agent Investment Due Diligence System* *Powered by AMD MI300X + CrewAI* ``` After writing the memo, use the memo_writer tool to save it: ```json {{ "company_name": "{company_name}", "memo_content": "...the full markdown memo...", "output_dir": "{output_dir}" }} ``` """, expected_output=( "A complete, professional investment memo in Markdown format " "covering all required sections with clear investment recommendation, " "and the file path where the memo was saved." ), agent=report_writer, context=context_tasks or [], )