File size: 2,681 Bytes
8dcf472
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
"""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 [],
    )