Starts with raw customer behavior
Uses transactional signals like recency, frequency, spend, and tenure as the starting point for CRM decisions.
Infers the right lifecycle objective
Transforms customer metrics into marketing logic such as churn risk, lifecycle stage, and campaign goal before writing.
Generates complete campaign sequences
Delivers structured three-email CRM flows that connect analytical insight directly to execution-ready messaging.
From Customer Data to Campaign Execution
Customer data already tells a story: who is active, who is drifting away, and who drives most of the value. The challenge is not understanding the data, but knowing what to do next.
Translating these signals into clear lifecycle decisions, and then into actual campaigns, is often a fragmented and manual process.
This project explores how that gap can be reduced by connecting data, decision-making, and execution in a single flow.
An AI Agent That Makes Marketing Decisions Before It Writes
Instead of generating campaigns directly from raw data, the system introduces an intermediate decision step.
Customer behavior is first translated into actionable signals, which are used to define the campaign objective and context.
The generation layer then produces a campaign sequence that is consistent with that strategy, not just fluent, but purposeful.
Load Transactional Inputs
Reads customer-level metrics from a structured dataset and prepares a reproducible working sample.
Derive CRM Signals
Builds lifecycle, value, and engagement attributes from the raw behavior patterns.
Infer Strategy
Chooses the marketing objective and customer brief before any campaign text is generated.
Generate Email Sequence
Creates three coordinated lifecycle emails aligned to the selected objective and tone.
From One Customer Profile to Three Generated Emails
This example uses one of the actual sampled customers from the generated output. The panel on the left shows the customer metrics and the derived CRM strategy, while the emails on the right show exactly how those signals were translated into a win-back sequence.
The Marketing Attributes Derived by the Agent
The most important part of the system is not the final copy. It is the intermediate marketing logic that reframes raw transactions into strategy-ready features the model can act on.
- Churn risk derived mainly from recency with purchase frequency as a modifier
- Engagement proxy built from activity, repeat behavior, and spend signals
- Discount sensitivity inferred from lower spend and lower basket patterns
- Lifecycle stage determined from tenure, frequency, and risk profile
- Customer archetype generated as a human-readable strategic summary
Why This Matters
Turns analytics into action
The agent closes the gap between customer-level metrics and ready-to-run lifecycle communication.
Standardizes campaign logic
Because the decision layer is explicit, CRM strategy becomes more consistent across use cases and operators.
Improves scalability
The workflow shows how a small set of interpretable customer signals can support repeatable personalization at scale.
Stays operational when generation fails
The fallback path means campaign creation can continue even when a live API call is unavailable.
Tools Used
The workflow is built in Python and organized as a modular CRM generation pipeline. It combines customer logic, prompt construction, campaign generation, and OpenAI API integration, while exporting usable outputs in JSON and CSV. The overall design emphasizes reproducibility, explainability, and graceful fallback behavior.