Compare AI SDR Opener Prompts

Score two AI-generated SDR outreach openers against five judging criteria with a custom two-choice eval, then pick the winning prompt by eval majority.

📝
TL;DR

Build a custom two-choice eval that scores an SDR outreach opener on five criteria (engagement, tone, relevance, appropriateness, impact), run it against two candidate opener-generation prompts over a small dataset of value propositions and LinkedIn posts, then pick the winning prompt by counting each row’s majority “Good” tag.

TimeDifficultyPackage
20 minIntermediateagent-learning-kit
Prerequisites

Install

python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install agent-learning-kit==0.3.7 pandas tabulate
export FI_API_KEY="your-api-key"
export FI_SECRET_KEY="your-secret-key"

Tutorial

Run the Python blocks in order in one session. You will use recorded example openers and synthetic posts; you do not need a LinkedIn account or a sending tool.

Load the outreach dataset

The dataset holds one row per prospect: a value_proposition, the prospect’s combined_posts (their recent LinkedIn posts), and two candidate openers already generated by two different prompts.

import pandas as pd

dataset = pd.DataFrame([
    {
        "value_proposition": "Get location information of your social media following to place better ads and sponsorships",
        "combined_posts": "Post 1: In the past 12 months, my LinkedIn following went from 36k to 58k... Post 2: Pro-tip that booked me 4-5 meetings from my top accounts per quarter...",
        "opener_1": "I recently saw your post about leveraging LinkedIn for building a pipeline; location insights could enhance your ad strategies even further!",
        "opener_2": "I recently saw your post about leveraging your LinkedIn presence to build a pipeline, which aligns perfectly with optimizing audience targeting",
    },
    {
        "value_proposition": "Benchmark your support team's response time against industry peers",
        "combined_posts": "Post 1: We cut our median first-response time to 4 minutes this quarter... Post 2: Sharing our support playbook at next month's CX meetup...",
        "opener_1": "Congrats on the 4-minute response time, curious how that benchmarks against the rest of your support org",
        "opener_2": "I saw your post about the CX meetup and wanted to reach out because our platform helps teams like yours track support benchmarks",
    },
])
pd.set_option("display.max_colwidth", None)

Replace this with your own prospect rows, or pd.read_csv("your_file.csv") once you have a real export with the same four columns.

Each row looks like this (posts are shortened here for readability, yours will run longer):

ColumnExample value
value_propositionGet location information of your social media following to place better ads and sponsorships
combined_postsPost 1: In the past 12 months, my LinkedIn following went from 36k to 58k… Post 2: Pro-tip that booked me 4-5 meetings from my top accounts per quarter…
opener_1I recently saw your post about leveraging LinkedIn for building a pipeline; location insights could enhance your ad strategies even further!
opener_2I recently saw your post about leveraging your LinkedIn presence to build a pipeline, which aligns perfectly with optimizing audience targeting

opener_1 and opener_2 stand in for outputs from two different prompts. Use the same prospects for both so the comparison is paired.

Create the custom two-choice eval

Create an evaluator in your workspace with one choice per rating. The unique suffix keeps this example from overwriting an existing evaluator. These are model judgments, not fixed rules: a rating can change between runs.

Note

Turing models run on Future AGI’s managed service. On Future AGI Cloud, each Turing evaluation uses AI credits from your organization’s plan. A self-hosted deployment needs a license that includes the turing_models feature; its Turing calls use that license’s managed AI credits and are not available in an air-gapped install. On a self-hosted install, set FI_BASE_URL to your API URL first. Without it, your keys and inputs go to Future AGI Cloud.

from uuid import uuid4
from fi.evals import EvalTemplateManager, Evaluator

manager = EvalTemplateManager()
evaluator = Evaluator()
template = manager.create_template(
    name=f"sdr-opener-{uuid4().hex[:10]}",
    eval_type="agent",
    model="turing_flash",
    instructions=(
        "Rate the opener against this one criterion: {{description}}. "
        "Prospect posts: {{combined_posts}}. Value proposition: {{value_proposition}}. "
        "Opener: {{opener}}. Choose exactly one: Good or Poor."
    ),
    output_type="deterministic",
    choice_scores={"Good": 1.0, "Poor": 0.0},
)
print(template.name)

Open Evals and search for the printed name. The same template will judge both candidates. For more on the available options, see Create a custom eval.

Check one opener before scoring the full table

audit = []

def rate(row, opener, description):
    result = evaluator.evaluate(
        eval_templates=template.name,
        inputs={"opener": opener, "description": description,
                "combined_posts": row["combined_posts"],
                "value_proposition": row["value_proposition"]},
        model_name="turing_flash",
    )
    if len(result.eval_results) != 1 or result.eval_results[0] is None:
        raise RuntimeError("Expected one evaluation result")
    item = result.eval_results[0]
    tag = item.output.get("choice") if isinstance(item.output, dict) else None
    if tag not in ("Good", "Poor") or not item.eval_id:
        raise RuntimeError(f"No usable rating: {item.reason}")
    audit.append({"template_id": template.id, "name": template.name,
                  "eval_id": item.eval_id, "rating": tag})
    return tag

first = dataset.iloc[0]
print(rate(first, first["opener_1"], "Choose Good if it invites a specific conversation, Poor otherwise."))

You should see Good or Poor. If you do not, check the reported reason before running the remaining evaluations.

Define the judging criteria

Each criterion is a description string that gets substituted into the eval’s {description} placeholder. The eval returns Good or Poor for each one.

JUDGING_CRITERIA = {
    "Engagement": "Evaluate whether the opener captures attention and encourages interaction or further thought. Choose Good if the opener is engaging, sparks curiosity, or creates a sense of interest, making the reader want to engage further. Choose Poor if the opener feels generic, uninspiring, or fails to prompt any interaction or interest.",
    "Tone": "Evaluate whether the tone of the opener is respectful, professional, and avoids being patronizing or condescending. Choose Good if the tone matches the context, feels approachable, and conveys professionalism without being overly casual or rigid. Choose Poor if the tone is overly formal, dismissive, condescending, or inappropriate for the intended audience.",
    "Relevance": "Evaluate whether the opener is relevant to the combined posts. Choose Good if the opener aligns closely with the topic, addresses the subject matter accurately, and stays on-point. Choose Poor if the opener feels disconnected, includes irrelevant information, or strays from the primary focus of the combined posts.",
    "Appropriateness": "Evaluate whether the correct post from the combined posts was selected to create the opener. Choose Good if the selected post clearly supports the value proposition and fits well with the purpose of the opener. Choose Poor if the selection feels irrelevant, random, or poorly suited to the context or value proposition.",
    "Impact": "Evaluate how compelling and effective the opener is in delivering its message. Choose Good if the opener leaves a strong impression, effectively conveys its value proposition, and makes the reader want to engage further. Choose Poor if the opener feels weak, ineffective, or fails to make a memorable or persuasive impact.",
}

Add your own criteria the same way, as long as each description tells the model exactly how to choose between Good and Poor.

You should see no output. JUDGING_CRITERIA now holds five entries, one per criterion, ready to substitute into the eval’s {description} placeholder in step 5.

Score both openers against every criterion

For each criterion and each row, run the eval once on opener_1 and once on opener_2, then read the choice from the result.

complete_result = {}
for criterion, description in JUDGING_CRITERIA.items():
    for n in (1, 2):
        complete_result[f"{criterion} Eval Rating {n}"] = [
            rate(row, row[f"opener_{n}"], description) for _, row in dataset.iterrows()
        ]
complete_result_df = pd.DataFrame(complete_result)

With choice scores configured, .output contains both choice and score; use choice for the vote. You should see complete_result_df with ten columns, two (Rating 1 and Rating 2) per criterion, each cell either Good or Poor.

Tabulate results per prompt

Split the interleaved columns back into one table per prompt and print them.

from tabulate import tabulate

complete_result_prompt1 = complete_result_df.iloc[:, ::2].copy()
complete_result_prompt1.columns = [c.replace(" Eval Rating 1", "") for c in complete_result_prompt1.columns]

complete_result_prompt2 = complete_result_df.iloc[:, 1::2].copy()
complete_result_prompt2.columns = [c.replace(" Eval Rating 2", "") for c in complete_result_prompt2.columns]

print("\nEvaluation on Prompt 1")
print(tabulate(complete_result_prompt1, headers="keys", tablefmt="fancy_grid", showindex=False))

print("\nEvaluation on Prompt 2")
print(tabulate(complete_result_prompt2, headers="keys", tablefmt="fancy_grid", showindex=False))

Illustrative output for prompt 1, your tags depend on your dataset and eval run:

EngagementToneRelevanceAppropriatenessImpact
GoodGoodGoodPoorGood
GoodGoodGoodGoodGood

Check whether a more specific opener fits the post

Hold the criterion and prospect fixed. Change only the opener: does citing a specific detail from the follower-growth post help? This is a separate comparison, not part of the vote below.

specificity = (
    "Choose Good only if the opener cites a concrete detail from a post "
    "and connects it to the value proposition. Otherwise choose Poor."
)
revision = (
    "Congrats on growing from 36k to 58k followers. Do you know which regions "
    "drove that growth, so you can target your next sponsorship there?"
)
print("Original:", rate(first, first["opener_1"], specificity))
print("Revision:", rate(first, revision, specificity))

Compare the two tags. If both replies get the same rating, inspect what each actually says before changing the criterion again.

Pick the winning prompt

Take the majority tag across the five criteria for each row, then count how many rows land Good per prompt.

def get_majority(row):
    return "Good" if (row == "Good").sum() > len(row) / 2 else "Poor"

df1_majority = complete_result_prompt1.apply(get_majority, axis=1)
df2_majority = complete_result_prompt2.apply(get_majority, axis=1)

good_count_prompt1 = (df1_majority == "Good").sum()
good_count_prompt2 = (df2_majority == "Good").sum()

if good_count_prompt1 > good_count_prompt2:
    winner = "Prompt 1"
elif good_count_prompt2 > good_count_prompt1:
    winner = "Prompt 2"
else:
    winner = "TIE"

print(f"\nWinner Prompt: {winner}")
pd.DataFrame(audit).to_csv("opener-ratings.csv", index=False)

You should see a Winner Prompt line naming the prompt with more majority-Good rows. A tie means both prompts have the same number of majority-Good rows. Use a larger sample before deciding. opener-ratings.csv records the template ID, result ID and tag for each call.

Troubleshooting

SymptomCauseFix
AttributeError: 'EvalResult' object has no attribute 'metrics'Reading an old result schemaUse eval_results[0].output["choice"]
ModuleNotFoundError: No module named 'tabulate'The table-printing dependency is missingRun python -m pip install tabulate
KeyError: 'opener_1'Your own dataset doesn’t have columns named opener_1 / opener_2 / combined_posts / value_propositionRename your columns or update the row lookups to match
No usable ratingThe eval call did not return either configured choiceConfirm your keys belong to the workspace where the template was created and check the reported reason
Every row scores Good on both promptsThe judging criterion’s description doesn’t distinguish a weak opener from a strong oneTighten the Good / Poor language in JUDGING_CRITERIA with concrete examples of each
Script runs slowly with two prompts x five criteria x N rowsEach evaluate() call is synchronous and network-boundReduce the dataset for iteration, then scale up once the criteria are stable

To automate finding a better opener instead of comparing two hand-written prompts, continue with Improve a prompt automatically.

Was this page helpful?

Questions & Discussion