Sub topic 1
The marketing research and reporting workflow
Prerequisites
This chapter assumes you know basic marketing metrics (impressions, clicks, conversions, spend), can read simple Python, and have a general idea of what a large language model is. Later chapters use JSON and simple APIs. This chapter uses neither.
Why start with the workflow
An agent is only useful if you know which work it should take on. Before choosing tools or prompts, map the manual process. Then decide stage by stage what an agent can do, what plain code should do, and what a person must keep.
The stages
Most marketing research and reporting follows the same path, whether the output is a weekly performance summary or a competitor review.
- Define the question. For example: "Which channels drove cost-efficient conversions last month?"
- Collect data. Export or query ad platforms, web analytics, a CRM, and public web pages.
- Calculate metrics. Compute click-through rate, cost per click, cost per acquisition, and period-over-period changes.
- Interpret results. Explain what changed and propose reasons.
- Draft the report. Turn findings into sections a reader can scan.
- Verify. Check that every number and claim traces back to a source.
- Review and publish. A person approves the report and decides what to do with it.
Which stages suit an agent
An agent is a language model that can call tools in a loop. It is strong at open-ended, text-heavy steps and weak at exact arithmetic and at knowing what is true. That split decides who does each stage.
| Stage | Best handled by | Reason |
|---|---|---|
| Define the question | Person | It sets priorities and scope. |
| Collect data | Agent calling tools | The steps are repetitive and well defined. |
| Calculate metrics | Deterministic code | Arithmetic must be exact and repeatable. |
| Interpret results | Agent, with a person checking | The model can propose explanations, but it can also invent them. |
| Draft the report | Agent | Summarizing and structuring text is a core strength. |
| Verify | Code plus a person | Checks need a source of truth outside the model. |
| Review and publish | Person | Someone must be accountable for what is released. |
The pattern is that the agent coordinates and writes, code computes, and people decide. Later chapters build each piece, starting with how language models fail and how tools prevent those failures.
A concrete example
Suppose you report on two campaigns each week. Done by hand, you export two CSV files, paste them into a spreadsheet, compute rates, write a paragraph per campaign, and email it. An agent can run the export, call a metrics function, and draft the paragraphs. The weak spot is the paragraphs. If the model computes "CPA rose 20%" itself, it may get the number wrong and sound confident. If a function computes it and the model only describes it, the number is reliable.
Common mistakes at this stage
- Automating the whole pipeline at once. Start with one stage, such as drafting from a fixed metrics table, and prove it works.
- Skipping the manual baseline. Time how long the manual process takes now. You need that figure to judge the agent later.
- Leaving "define the question" vague. An agent given a loose question produces loose output.
Exercise
In the workflow above, which stage should use deterministic code instead of the language model, and why?
Show answer
Calculate metrics. Rates such as CTR, CPC and CPA need exact, repeatable arithmetic, and models can produce plausible but wrong numbers. A function gives the same correct answer every run, and the model only describes the result.