Steps to reproduce

The Drupal AI initiative introduces a Context Control Centre (CCC) that stores an organisation's brand voice, tone guidelines, audience personas, and governance rules. Currently, AI Empathy evaluates responses against fixed ethical dilemma scenarios without any awareness of the organisation's specific communication context. This means an AI response could score well on generic empathy but fail to match the required brand tone.

As the "Beyond the AI Average" blog post states: "AI tools don't just guess; they work within your specific business reality." Empathy evaluation should respect that same context.

Proposed resolution

Integrate CCC context into empathy evaluation:

1. Context-aware scenarios: Allow scenarios to optionally reference CCC context entries. When evaluating, the CCC context (brand voice, tone, audience persona) is injected into the evaluation prompt alongside the scenario.
2. Tone Alignment metric: Add a 5th scoring metric — Tone Alignment (1-5) — that evaluates how well the AI response matches the configured brand voice and tone guidelines from the CCC.
3. Audience-specific evaluation: Allow running the same scenario against different audience personas from the CCC and compare how the AI adapts its empathetic response.
4. Scenario entity update: Add optional `context_profile` field to `AiEmpathyScenario` config entity to reference a CCC context.
5. Scoring service update: `EmpathyScoringService` gains a new metric in its scoring prompt when CCC context is provided.
6. Dashboard update: Tone Alignment metric displayed alongside existing 4 metrics in charts.

Remaining tasks

- [x] Research CCC API/service interface when available in Drupal AI module
- [x] Add `context_profile` field to scenario config entity
- [x] Add `tone_alignment` field to result content entity
- [x] Update `EmpathyScoringService` to accept optional CCC context and score tone alignment
- [x] Update `EmpathyEvaluator` to load and inject CCC context
- [x] Update dashboard charts to include the 5th metric
- [x] Update settings form with tone alignment threshold
- [x] Add config schema for new fields
- [x] Write tests

Issue fork ai_empathy-3583739

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joshua1234511 created an issue. See original summary.

joshua1234511’s picture

kristen pol’s picture

Pasting from the meta issue:

Hi 👋 Just found this (Suchi Garg shared with the Salsa team).

I’m very intrigued and would be happy to understand how this might leverage the Context Control Center work I’m leading.

Feel free to create any related issues in the CCC queue.

joshua1234511’s picture

joshua1234511’s picture

Hi Kristen, thanks for reaching out!

This integration is still early days, more of a concept at this stage. The general idea is that ai_empathy could pull in brand voice/tone context from CCC to evaluate whether AI responses are empathetic in the organisation's voice, not just generically.
I'm still working through how that would look technically. I've created an issue in the CCC queue as a starting point for the conversation: #3584838. Would love your input on whether that direction makes sense from the CCC side.

joshua1234511’s picture

Issue summary: View changes
Status: Active » Needs review

The convenience API from this issue (!122) is now consumed by the AI Empathy
module — confirming it covers the non-agent programmatic use case it was
requested for. See ai_context #3584838.

How it's used in ai_empathy (submodule ai_empathy_ccc):

- A single call does everything we need, no request/selector knowledge required:

$text = $this->requestFactory->getRenderedContext(
scopes: $scopes, // e.g. ['use_case' => ['empathy_evaluation']]
consumerId: 'ai_empathy',
);

We inject '@ai_context.request_factory' and call getRenderedContext() from an
event subscriber to (a) add brand/organisational context to the evaluation
prompt and (b) feed a tone-alignment scoring pass. Empty-string-on-no-match
is exactly the behavior we wanted and it lets us no-op cleanly.

  • joshua1234511 committed c221b5de on 1.0.x
    #3583739: Added Context Control Centre integration for tone-aware...
joshua1234511’s picture

Status: Needs review » Fixed

Merged, will be out in the next release.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

joshua1234511’s picture

Status: Fixed » Closed (fixed)