Ai4
Generative text-to-SQL tools carry unacceptable error rates for enterprise decision-makers, pushing Pfizer to combine deterministic metric extraction with knowledge graphs to diagnose commercial bottlenecks in seconds.
AI-assisted summary of COCO: An Agentic AI Assistant for Marketing Analytics With Pfizer — original source. Check the original for full context.
Source published:
Detailed notes
## Background Published by the Ai4 channel on YouTube on August 19, 2026, this presentation features Shanshan Bi, Director of Commercial AI Acceleration at Pfizer. The session details COCO, an agentic AI assistant developed internally to resolve enterprise marketing analytics bottlenecks by translating natural language queries into automated anomaly detection, multi-source evidence gathering, and human-readable insights.
## TL;DR To eliminate the multi-week ad hoc SQL request cycles that delay strategic adjustments for commercial brands like Paxlovid, Pfizer built COCO, an agentic analytics engine. The system executes a structured four-stage pipeline: scanning KPIs to isolate outliers, generating plausible root-cause hypotheses via an enterprise knowledge graph, cross-validating empirical evidence across claims and detailing feeds, and delivering actionable interventions with estimated ROI. Due to governance constraints, token bloat in fragile 'Uber prompts', and an unacceptable 10% error margin in generative text-to-SQL chatbots, the architecture leverages deterministic backend metric extraction while keeping human marketers in the loop and augmenting existing data science workflows.
## Atmosphere & style The presentation blends conversational stand-up wit with a pragmatic, transparent engineering narrative. Bi engages the audience by contrasting the high-level promise of generative AI with the messy reality of enterprise data silos, prompt maintenance, and colleague anxieties about job security. The session feels like an authentic, behind-the-scenes debrief that grounds cutting-edge agentic workflows in real-world business constraints.
## Key takeaways - [00:04](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=4s) Enterprise commercial dashboards track thousands of KPIs but only provide retrospective visibility, failing to explain root causes or prescribe operational next steps. - [02:35](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=155s) The traditional ad hoc analytics loop between marketers and data scientists requires weeks of turnaround for each query, causing a severe speed-to-insights bottleneck. - [04:42](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=282s) Pfizer's COCO engine streamlines analytics via a four-stage pipeline: automated anomaly detection, knowledge graph hypothesis generation, cross-dataset evidence gathering, and action recommendations. - [04:42](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=282s) COCO is intentionally architected with a human-in-the-loop model, requiring human marketers to evaluate and sign off on suggested interventions rather than automating decisions. - [06:56](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=416s) By synthesizing multi-source data across claims, CDC feeds, and detailing transcripts, the system successfully identified HCP dosing education gaps as the root driver for depressed Paxlovid uptake in elderly DDI cohorts. - [08:32](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=512s) Insights are delivered through lightweight HTML reports anchored on patient conversion funnels, using clear visual markers for deviations, empirical proof, and exportable execution plans. - [10:28](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=628s) Unconstrained conversational text-to-SQL chatbots face severe hurdles in regulated pharma environments due to PII compliance risks, governance rules, and prompt fragility. - [12:31](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=751s) A 90% accuracy rate in autonomous SQL generation leaves a 10% margin of error that undermines marketer trust, prompting a shift toward deterministic backend KPI extraction. - [13:30](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=810s) Using massive 'Uber prompts' packed with schema mappings and few-shot templates drives up token costs while still struggling to eliminate the final 1–5% SQL hallucination rate. - [15:06](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=906s) Positioning agentic AI as an accelerating assistant for data science teams rather than a replacement helps alleviate internal workforce concerns. - [16:00](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=960s) The outlier detection mechanism utilizes a two-year historical baseline to run continuous time-series tracking, year-over-year comparisons, and peer-to-peer cohort benchmarking.
## Detailed walkthrough ### [00:04](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=4s) The Commercial Analytics Bottleneck: Drowning in Dashboards
Shanshan Bi introduces herself with a lighthearted disclaimer: although she moonlights doing stand-up comedy, she will not be cracking jokes about Pfizer today because "they will fire me." Shifting to serious business, she outlines the presentation around COCO, an agentic AI assistant built internally at Pfizer to resolve commercial marketing analytics bottlenecks. Her talk covers three main pillars: current operational pain points, COCO's architectural design and benefits, and an interactive demonstration.
To frame the problem, she asks the audience how brand marketers gauge whether a drug's commercial performance is succeeding and whether marketing strategies are effective. The conventional answer is tracking Key Performance Indicators (KPIs) visualized in dashboards. However, at a pharmaceutical enterprise like Pfizer, a single commercial brand such as Paxlovid (Pfizer’s COVID-19 antiviral therapy) involves thousands of discrete KPIs spread across dozens of distinct dashboards. Maintaining this ecosystem requires dedicated external vendor teams handling ad hoc requests alongside internal data science teams tasked with extracting insights.
In practice, marketers lack the hours in a day to comb through thousands of individual metrics. Even when they scan high-level dashboard summaries, dashboards provide visibility only into what has already taken place—they fail to explain the underlying mechanics or direct next steps. When commercial executives notice declining treatment adoption rates in a specific geographic region and ask why it occurred and how the team should respond, standard business intelligence tools fall silent. Answering those two critical questions—*why* something happened and *what to do next*—is the core design goal behind Pfizer's agentic AI.
[02:35](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=155s) The Painful Query Loop and the "Speed to Insights" Problem
To illustrate the current friction, Bi walks through a standard Paxlovid marketing query. If a marketer wants to know the overall percentage of eligible patients treated with Paxlovid over the prior quarter, the query is straightforward: they open the dashboard and locate the number within thirty seconds. The breakdown occurs as soon as they pose natural follow-up questions, such as drilling into specific regional sub-cohorts—like untreated patient groups in the Northeast—to uncover why those patients never initiated therapy.
Because standard dashboards lack pre-aggregated tiles for every nuanced cohort, the marketer must open a ticket with an internal data scientist or external vendor. The data science team typically requests at least a week to coordinate with data engineering pipelines, author SQL queries, pull data extracts, interpret signals, assemble presentation decks, and schedule a formal read-out meeting. When the marketer finally reviews the deck, the findings prompt immediate follow-up inquiries regarding root causes and key drivers. The analyst then requests another week to schedule a follow-up review.
This iterative loop repeats continuously across commercial operations. By the time an initial question receives an actionable explanation, the quarter has already elapsed, leaving brand managers unable to adjust commercial strategy in flight. Bi stresses that this failure is fundamentally not a data deficiency—the data points and KPI definitions already exist. Rather, the enterprise suffers from a severe "speed to insights problem."
```mermaid flowchart TD accTitle: The Traditional Commercial Analytics Bottleneck subgraph S1["1. Standard Dashboard"] A["Marketer checks basic KPI<br/>(30 seconds)"] --> B["Identifies cohort anomaly<br/>(e.g., Northeast untreated)"] end
subgraph S2["2. Ad Hoc Request Queue"] B --> C["Requests deep dive from Data Scientist / Vendor"] C --> D["Data Engineering & SQL pipelines<br/>(1-week delay)"] D --> E["Slide deck created & review meeting held"] end
subgraph S3["3. Delayed Decision-Making"] E --> F["Follow-up question on root drivers<br/>(Another 1-week delay)"] F --> G["Quarter ends before strategy can adjust"] end ```
[04:42](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=282s) COCO's Four-Step Architecture: From Anomaly to Action
To eliminate this weeks-long feedback loop, Pfizer developed COCO: a knowledge graph-powered insights engine that autonomously scans metrics, diagnoses anomalies, and generates concrete, ready-to-act recommendations. Rather than behaving like an open-ended conversational bot, COCO operates as an automated engine executing a structured four-stage workflow:
```mermaid flowchart LR accTitle: COCO Four-Step Processing Engine subgraph Pipeline["COCO Engine Core Pipeline"] direction TB N1["1. Scan KPIs & Detect Outliers<br/>(Finds 14-20 anomalies)"] --> N2["2. Query Knowledge Graph<br/>(Retrieve candidate explanations)"] N2 --> N3["3. Gather Empirical Evidence<br/>(Cross-examine disparate datasets)"] N3 --> N4["4. Present Human-in-the-Loop Actions<br/>(Recommendations with ROI estimates)"] end ```
The system executes this process through four sequential steps:
1. **Automated Anomaly Detection:** Specialized agents review thousands of KPIs across historical trailing windows (such as the past two weeks or thirty days) to identify statistically significant outliers—typically isolating 14 to 20 actionable deviations that a human would miss. 2. **Knowledge Graph Hypothesis Generation:** Instead of guessing randomly, the system consults an enterprise knowledge graph to retrieve multiple plausible candidate hypotheses that could explain the identified anomaly. 3. **Automated Evidence Gathering:** Agents independently validate or disprove each candidate hypothesis by interrogating Pfizer's underlying data systems, hunting down empirical evidence across patient cohorts (e.g., evaluating female patients over age 50 enrolled in Medicaid). 4. **Action Recommendations with ROI:** The platform surfaces prioritized interventions for brand teams, complete with projected return on investment (ROI) metrics. Marketers can accept recommendations, discard options, record operational rationale, or launch targeted A/B tests.
Bi emphasizes that COCO does not operate autonomously without oversight. The tool is intentionally architected around human-in-the-loop decision-making: "We are not develop the COCO as the AI telling what to do next... and we still need human marketers to sign off. We are not directly replace anyone's job."
[06:56](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=416s) Case Study: Unpacking Paxlovid and Drug-Drug Interactions
Bi grounds the technical workflow in a real-world Paxlovid analytical challenge: explaining unexpectedly depressed prescription initiation rates among patients over 65 who were flagged with Drug-Drug Interaction (DDI) contraindication warnings.
When COCO examines this outlier cohort, its knowledge graph proposes several distinct candidate explanations: - Systemic data quality degradation or incomplete electronic health record feeds. - Patient-level hesitancy driven by fears that Paxlovid might adversely react with their maintenance medications. - Healthcare provider (HCP) knowledge deficits regarding clinical dosage adjustment protocols specifically formulated for co-medicated cohorts.
```mermaid flowchart TD accTitle: Paxlovid DDI Investigation Flow A["Outlier Detected: Patients 65+ with DDI flags<br/>exhibit low treatment rates"] --> B{"Knowledge Graph Hypotheses"} B --> C["Data quality / pipeline errors"] B --> D["Patient fear of interaction"] B --> E["HCP lack of dosing adjustment knowledge"]
E --> F["Data Synthesis Across Enterprise Feeds"] subgraph Datasets["Cross-Dataset Evidence Synthesis"] direction LR G1["Claims & Patient Data"] G2["HCP Detailing Logs"] G3["CDC / Wastewater / Hospital Data"] G4["Omnichannel & Target Lists"] G5["ML Model Inferences"] end F --- Datasets Datasets --> H["Validated Finding: HCP dosing education gap"] H --> I["Action: Adjust HCP target list & field detailing"] ```
To determine which hypothesis holds true, COCO's agents systematically query and correlate massive multi-source datasets: - Longitudinal medical and pharmacy claims. - Patient-level demographic records. - Healthcare Provider (HCP) master files and commercial target lists. - Public epidemiological tracking feeds from the CDC, including regional hospitalization metrics and wastewater surveillance data. - Field representative face-to-face detailing transcripts and multichannel marketing logs. - Predictive machine learning model outputs.
By cross-referencing these feeds, the system rules out data pipeline corruptions and demonstrates that the primary bottleneck stems from HCP prescribing uncertainty. Having substantiated the root cause with empirical data, the platform presents the commercial team with targeted actions, such as dynamically updating field rep call plans or delivering educational omnichannel assets on dose adjustment.
[08:32](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=512s) Inside the COCO Interface: Funnels, Evidence, and Feedback
Demonstrating the user-facing interface, Bi explains that COCO avoids the bloat of traditional dashboards and heavy JavaScript applications, delivering insights instead through a lightweight, structured HTML report. The visual interface organizes findings into an intuitive exploratory hierarchy:
- **The Patient Conversion Funnel:** The top of the report anchors on a macro conversion funnel tracking sequential patient volumes: individuals testing positive or getting infected, total treated cohorts, patients initiated on Paxlovid, and secondary abandonment points where patients fail to pick up prescriptions at the pharmacy. - **Visual Marker Conventions:** - Findings and anomalous deviations are represented along conversion funnel layers as **purple triangles**. Clicking an anomaly opens granular time-series charts detailing time intervals, data sources, patient demographics, and HCP target attributes. - Candidate explanations supported by empirical proof are marked with **red squares** denoting validated evidence. - Recommended operational interventions are displayed as **blue triangles** (or blue action items). - **Closed-Loop Feedback and Export:** Users can directly interact with suggested actions—confirming adoption, rejecting steps with logged feedback, or adjusting target parameters. Marketers can subsequently download reconciled execution plans via PDF or Excel workbooks, providing field sales teams and operations planners with concrete HCP target lists and flagged patient cohorts.
[10:28](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=628s) Why Pure Text-to-SQL Fails: Moving to Deterministic Engines
In the final portion of this segment, Bi contrasts COCO’s deterministic design against the prevailing enterprise AI trend of embedding conversational text-to-SQL chatbots directly into dashboards. In typical text-to-SQL implementations, a user asks a free-form question, a classification model routes the query, and an LLM-driven text-to-SQL agent attempts to query a data warehouse like Snowflake. Bi notes that this pattern encounters severe friction in regulated enterprise environments:
- **Enterprise Governance & PII Guardrails:** Unconstrained conversational interfaces risk surfacing Personally Identifiable Information (PII) or generating outputs that violate strict regulatory compliance and internal pharmaceutical policies. - **Evaluation & Query Reliability:** In mission-critical commercial analytics, SQL output must be mathematically certain. To evaluate LLM SQL reliability, Bi’s team built a rigorous benchmarking framework using a "500 golden dataset" tailored to Paxlovid across tiered difficulty levels. Tier 1 evaluated simple `SELECT` statements, while higher tiers evaluated complex joins and window aggregations. - **The "Uber Prompt" Fragility:** Even after constructing dedicated semantic layers, the engineering team found that keeping the LLM reliable demanded massive, fragile "Uber prompts" to prevent semantic drift and erroneous join logic.
Because generative SQL cannot guarantee 100% accuracy on open-ended ad hoc queries, the architecture was pivoted away from pure conversational agents toward the COCO engine. Rather than relying on real-time code generation for metric calculations, COCO utilizes deterministic KPI extraction logic in the backend, ensuring that all data points, baselines, and anomaly alerts remain mathematically reliable and auditable.
[12:31](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=751s) Data Accuracy, Marketer Trust, and the 10% SQL Dilemma
While the underlying agent architecture explores diverse evidence and multiple potential explanations, handling uncertainty remains an active challenge—principally because the knowledge graph is not yet perfect. Although the team is continuously refining and improving the knowledge graph, they can guarantee that every individual metric pulled directly from Snowflake is 100% accurate. Ensuring raw numerical accuracy is the most direct pathway to winning the trust of commercial marketers.
In evaluation frameworks where agents generated SQL queries autonomously, the system achieved a 90% accuracy rate. While a 90% success rate demonstrates strong agent performance from an engineering standpoint, it leaves a problematic 10% margin of error. For commercial marketers, that remaining 10% risk of retrieving incorrect figures from Snowflake creates real friction and skepticism, making it the primary pain point the team is striving to eliminate.
```mermaid flowchart TD accTitle: Text to SQL Agent Flow and Verification subgraph Input ["Query & Context"] A["Marketer Natural Language Question"] --> B["Uber Prompt\n(Table Relationships & SQL Examples)"] end subgraph Agentic_Layer ["Agent & Execution"] B --> C["Text-to-SQL Agent"] C --> D["Generated SQL Query"] D --> E["Snowflake Data Warehouse"] end subgraph Output ["Validation & Delivery"] E --> F["Raw Verified Metrics (100% Exact)"] F --> G["Human-Readable Answer & Outlier Detection"] end ```
[13:30](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=810s) Text-to-SQL Logic, "Uber Prompts", and Token Economics
An audience member asks how the agent's SQL generation logic is built. The pipeline relies heavily on what the team calls "Uber prompts," which contain detailed semantic mappings of the relationships across disparate tables alongside concrete few-shot SQL query examples (such as pre-formatted queries for calculating treatment rates). The agent ingests these Uber prompts to synthesize new SQL queries modeled after the provided templates.
However, scaling this technique introduces severe trade-offs around cost and efficiency. As more table schemas and example queries are added, the Uber prompt swells in size, consuming a massive number of tokens on every call. Even with increasingly large prompts, the approach still fails to cover 100% of the arbitrary questions a marketer might ask. Another attendee notes their own team's attempts to bridge knowledge graphs (like Neo4j) with relational SQL databases, asking how best to train models for SQL interaction. A robust semantic layer combined with prompt context is essential, but hallucinations persist at roughly a 5% rate, and pushing that error rate down to 1% or 2% remains a significant hurdle.
- **Uber Prompts**: Contain explicit table-to-table relational schemas and curated few-shot SQL examples (e.g., treatment rate calculations). - **Token Inflation**: Expanding prompt context to cover edge cases drastically increases token consumption and operating costs. - **Hallucination Margins**: SQL hallucination rates hover around 5%, requiring continuous tuning of semantic layers to reach a target of 1–2%.
[15:06](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=906s) Reassuring Data Scientists: Augmentation Over Automation
The introduction of automated text-to-SQL sparked frank reactions from internal data science teams, with one colleague half-jokingly telling the speaker, "I hate your job," out of fear that the agent would replace their role. In response, the strategic focus shifted toward framing agentic AI as an assistant rather than a replacement for data science personnel.
Instead of deploying complex text-to-SQL agents that attempt to autonomously execute deep analytics from scratch, the system handles simple, predefined KPI lookups directly from Snowflake into the chat interface. For more intricate tasks, such as deep-dive cohort analysis, the agent serves as an accelerating tool designed to speed up the data scientist's workflow. This reinforces the overarching mission of the Commercial AI Acceleration team: building tools that empower existing talent rather than automating human roles away.
[16:00](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=960s) Outlier Detection, Historical Lookbacks, and Predictive Cohorts
When asked by an audience member about the volume of historical data ingested and whether the system has evolved from retrospective reporting to forward-looking predictive analytics, the focus turns to the underlying time-series outlier detection framework. The engine currently ingests two years of historical data to establish baseline performance and identify meaningful deviations.
The agent actively tracks trends behind the scenes by running year-over-year (YoY) comparisons and longitudinal time-series monitoring. It also executes automated peer-to-peer cohort comparisons—such as benchmarking patients aged 15 and older against those under 15—to spot anomalies and track emerging behavioral shifts across brand and patient segments. The session concludes with an open invitation for attendees to connect for further technical discussions throughout the conference.
- **Historical Lookback**: Analyzes a rolling 2-year window of historical metrics for time-series anomaly detection. - **Trend & Outlier Mechanisms**: Leverages year-over-year comparisons and continuous time-series tracking in the background. - **Peer-to-Peer Cohorts**: Segment-based comparisons (e.g., age-bracketed cohorts) to flag statistical outliers in patient and marketer data.
## Notable quotes > [00:04](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=4s) they will fire me. — Shanshan Bi
> [02:35](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=155s) speed to insights problem — Shanshan Bi
> [04:42](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=282s) We are not develop the COCO as the AI telling what to do next... and we still need human marketers to sign off. We are not directly replace anyone's job. — Shanshan Bi
> [10:28](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=628s) 500 golden dataset — Shanshan Bi
> [10:28](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=628s) Uber prompts — Shanshan Bi
> [15:06](https://www.youtube.com/watch?v=Twct4OtyuZ4&t=906s) I hate your job, — Pfizer Data Scientist
## Mentioned Shanshan Bi, Pfizer, COCO, Paxlovid, Snowflake, Neo4j, CDC, Ai4, Medicaid
## Video description Shanshan Bi - Director of Commercial AI Acceleration - AIML, Pfizer
Marketing teams generate massive amounts of performance data — but extracting timely insights still requires SQL expertise, analyst queues, and days of turnaround. COCO is an agentic AI assistant that lets marketers ask natural language questions and receive data-driven answers in seconds. Built on a multi-agent orchestration architecture, COCO routes questions through specialized AI agents that understand marketing metrics, generate and execute SQL, and deliver human-readable insights across brand performance, omnichannel engagement, and patient trends. This session covers the journey from concept to production — including the architectural decisions behind multi-agent design, lessons learned from real-world evaluation at scale, and how we're using agentic AI to democratize data access for non-technical users in a regulated enterprise environment.
[Source](https://www.youtube.com/watch?v=Twct4OtyuZ4)