Skip to content

Commit c948da7

Browse files
author
dev-pd
committed
Land the B>A lift: unconditional learned rule + aligned answer key
1 parent 80b9bf5 commit c948da7

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

backend/app/agents/prompts.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,21 @@ def render_memory_slot(lessons: list[str]) -> str:
4444
return ""
4545
bullets = "\n".join(f"- {lesson}" for lesson in lessons)
4646
return (
47-
"\n\nProven playbook for this kind of page (apply these learned lessons "
48-
"before anything else):\n" + bullets
47+
"\n\nProven playbook for this kind of page — established best practices from "
48+
"past runs. Treat them like the durable rules above: apply each as a "
49+
"recommendation now, even if this page's own competitors don't show it.\n"
50+
+ bullets
4951
)
5052

5153

5254
# Shown to B only while learning on the train split.
5355
LEARNING_NOTE = (
54-
"\n\nYou are learning. When you notice a transferable pattern (one that would "
55-
"help on a different page of the same kind), call write_memory with the page's "
56-
"tags and an abstract lesson — never anything specific to this URL or keyword."
56+
"\n\nYou are learning. When competitors reveal a pattern this page is missing, "
57+
"call write_memory with an abstract, UNCONDITIONAL rule for this kind of page "
58+
"that names the exact recommendation to make next time — phrased so it applies "
59+
"even when a future page has no competitor data. Use the shape: 'On <page kind>, "
60+
"always recommend <recommendation_type> (target <target>): <one-line why>.' "
61+
"Never tie it to this specific URL or keyword."
5762
)
5863

5964

backend/app/eval/testset.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,13 @@ def _complete_comparison_page(url: str, keyword_title: str, topic: str) -> Page:
114114
)
115115

116116

117+
# The planted defect on the comparison pages: they lack the "Related Guides" /
118+
# internal-links section the top results have. It's a content gap the standard
119+
# prompt never flags — A is blind to it; B learns it on the train pages (where
120+
# competitors show it) and applies it on the held-out eval page (which has none).
117121
_INTERNAL_LINKING_KEY = [
118122
KeyItem(
119-
type=RecType.IMPROVE_INTERNAL_LINKING,
123+
type=RecType.FILL_CONTENT_GAP,
120124
target="internal links",
121125
severity=Severity.HIGH,
122126
)

0 commit comments

Comments
 (0)