← Back to case selection
Fintech · Workforce Platform AI GTM Engineer · Home Assignment

GTM Agent Console

Built for a financial technology and workforce platform. The full assignment as one working system — six agents grounded in a shared context layer, two of them running live in mock mode. Every tab maps to a required part. The guardrails you'll see firing are real code, not scripted text.

The choice

Content Context Validator & Draft Generator

Of every agent in the marketing stack, I built this one because it addresses the highest-risk failure mode in marketing AI: hallucinated or outdated content reaching publication.

The Content Context Validator is the bridge between the context layer (Part 2) and content production. It guarantees every piece of content is grounded in current, accurate context before it ever reaches a human reviewer — no free-floating generation, every claim traced to a source chunk, stale context flagged on sight.

Design spec at a glance

Trigger: content team submits a request (topic, format, audience, goal) — entry gate requires the context layer to return ≥1 relevant chunk
LLM: Claude Sonnet 5 for generation (reasoning + 1M context, cached system prompt) · DeepSeek V4 Flash for validation (cheap classification pass)
Guardrails: no generation on zero context · mandatory source citation · stale-context flag >60 days · brand-voice keyword check
Human-in-the-loop: request submission gate → draft/source/flag review gate → publish feedback loop
Observability: every run logs chunks used, confidence, flags, latency, cache hit/miss for weekly review
Decision 1

Sonnet 5 for generation, DeepSeek V4 Flash for validation

Sonnet 5 brings stronger reasoning, structured-prompt adherence, 1M context, and caching. Flash handles validation — source-citation, recency, and brand-voice checks are classification, not generation, at $0.14/M vs $3.00/M input.

Trade-offSonnet 5 costs more per run, but quality matters for content that reaches publication. Validation on Sonnet would cost ~$0.003/run vs ~$0.0001 on Flash — 30x saved on the validation layer alone.
Decision 2

Prompt caching for system prompt + context

The static ~1,500-token block (system prompt, product context, brand voice) is cached: $0.30/M cache read vs $3.00/M regular input — 90% off reused tokens. Cache write is $3.75/M, amortized across all reads in the TTL.

Trade-offCache expires after 5 min of inactivity — low request volume means more misses. Break-even is fast: one write ($0.0056) pays for itself after two reads.
Decision 3

JSON output with a mandatory sources field

Forcing structured output makes the model cite sources explicitly and makes validation programmatically checkable — no source, no claim survives the gate.

Trade-offThe model sometimes fails to produce valid JSON — handled with regex extraction and a fallback parse rather than a hard failure.
Decision 4

INSUFFICIENT_CONTEXT fallback

If no relevant chunks are found, the agent refuses to generate rather than filling the gap from training data.

Trade-offIt may refuse when it could have produced something reasonable — but for a grounded agent that's correct behavior. Better to refuse than hallucinate.
Decision 5

Keyword match now, vector search in production

For the assignment I used keyword matching for simplicity and transparency. Production swaps in Supabase pgvector or Pinecone for semantic retrieval.

Trade-offKeyword match misses chunks that are semantically relevant but lexically different — vector search is more robust, at the cost of infra setup.
Decision 6

Confidence = model self-report + validation adjust

The model reports its own confidence, then the validation layer independently verifies claims and adjusts the score up or down.

Trade-offModel confidence isn't always calibrated — the second, independent check is what makes the score trustworthy enough to route on.

The parts that only surface once you actually build it. Each of these came up during the build — and each has a fix already in place or specced for production.

JSON parsing failures

Claude sometimes wraps JSON in markdown code fences or adds a preamble line before the object.

FixRegex-extract the JSON block before parsing, with a fallback to raw text if the parse still fails — so a formatting quirk never crashes the run.

Source citation completeness

The model occasionally makes a claim without citing a source, or cites one that doesn't fully support the claim.

FixThe validation layer flags missing citations; in production a second Flash pass verifies each claim against its cited source before it clears review.

Brand voice validation is simplistic

A keyword check catches obvious violations ("cheap", "simple") but misses subtler tone drift.

FixProduction replaces the keyword pass with a fine-tuned classifier or an LLM-based brand-voice check scored against a rubric.

Cache TTL vs request frequency

With the 5-min TTL, infrequent requests (>5 min apart) fall out of cache and cost more.

FixFor low-frequency agents, accept non-cached cost or extend the TTL; for high-frequency ones (SDR outreach at 300 runs/day) caching is highly effective as-is.

Why this section exists → these are the details you only hit once you've shipped something. Listing them is the difference between a design doc and a build — and every one already has a remediation path.
Request
Written from memory marketer, unaided
Draft fast from what you remember about the product:
Waiting to start — the marketer writes confident copy from memory. It reads well… until someone checks the facts.
Sourced claims—
Risk—
Grounded in the context layer Claude Sonnet 5 · cited
Hit “Generate” to watch the agent retrieve → generate → validate → route.
Time to draft—
Cost / run—
Sourced claims—
—
of claims traced to a context-layer source
—
hallucinated or stale claims shipped
—
cost per content draft
3–5×
output per writer, editing not writing

Observability — agent run log

live
TimeAgentModelConf.FlagsRoutingLatencyCost
No runs yet — every agent run appends a row here: latency, cost, quality score, error rate.
This morning's queue
Scored, drafted, and pre-validated overnight. The SDR reviews — they don't write.
AccountSignalBusiness needEvidenceScoreStatus
Prospect
The manual way SDR, unaided
Research the account across every source by hand:
Waiting to start — the SDR opens 14 tabs, copies a generic template, and hopes it lands.
Time to send—
Personalization—
Sourced claims—
The agent way Claude Sonnet 5 · grounded
Hit “Run outreach” to watch the agent retrieve → generate → validate → route.
Time to draft—
Cost / run—
Sourced claims—
—
faster to a personalized first-touch
—
less manual research per prospect
—
cost per outreach draft
100%
of claims traced to a real client case study

Observability — agent run log

live
TimeAgentModelConf.FlagsRoutingLatencyCost
No runs yet — every agent run appends a row here: latency, cost, quality score, error rate.

Outbound motion → agent stack

Six stages, six agents, one shared substrate. Click a stage to see what the agent does, what it needs, how it fails, and where it should go silent instead of guessing.

Context Layer — ICP · positioning · value props · case studies · brand voice · battle cards · buying-committee roles
Salesforce — accounts · contacts · signals · scores · sequences · outcomes · audit log
07 · roadmap Pre-Call Intelligence Agent briefs SDRs/AEs before calls — account history, committee roles, talking points, objection handlers in the 12-month vision → Part 5
Highest impact

Content Production Agent

Generates blog posts, LinkedIn posts, nurture emails, and ad copy — grounded in current positioning, case studies, battle cards, and brand voice, not just "write me a post about payroll."

What it changes

Content team shifts from writing to editing. Output per writer up 3–5x, quality holds because generation comes from the context layer, not training data.

Risks if built wrong
  • Hallucinated features publish as fact
  • Outdated pricing goes live
  • Off-brand voice erodes consistency
  • Contradictory messaging across channels
  • No human review → factually wrong content ships
02

Campaign Brief Agent

Takes a goal ("500 SQLs from enterprise fintech in Q3") and generates a full brief: audience, messaging pillars, channel mix, assets, sequence design, metrics, budget allocation.

What it changes

Campaign planning compresses from days to hours. Cross-functional alignment improves — the brief pulls from the same context layer content and SDR teams use.

Risks if built wrong
  • Recommends channels that don't fit the audience
  • Budget allocation on stale historical data
  • Messaging pillars contradict current positioning
03

Social Listening & Response Agent

Monitors mentions of the brand, competitors, and relevant industry conversation. Drafts responses for review; flags high-priority conversations for immediate human attention.

What it changes

Social moves from reactive monitoring to proactive engagement. Response time on flagged conversations drops from hours to minutes; coverage goes from manual to 24/7.

Risks if built wrong
  • Auto-responds to complaints or legal issues with no human review
  • Misreads tone — casual reply to a serious complaint
  • Engages bot or troll accounts
04

Task Orchestration Agent

Monitors the marketing PM system (Asana/Linear), spots bottlenecks and missed dependencies, reassigns tasks by capacity, alerts before deadlines slip.

What it changes

Marketing ops shifts from manual project tracking to exception-based management — the team works, instead of producing status updates.

Risks if built wrong
  • Reassigns tasks needing specific domain knowledge
  • Floods the team with alerts → alert fatigue
  • Misreads bottlenecks from incomplete project data

Three domains, one retrieval layer

Product Context

owner: Product Marketing · reviewed monthly + on release
  • Features, pricing, roadmap (internal-only)
  • Integration catalog
  • Security & compliance certs
  • Use-case library

Market Context

owner: Competitive Intelligence · reviewed quarterly + on announcements
  • ICP + buyer personas
  • Competitor battle cards
  • Industry trends
  • Analyst reports

Company Context

owner: Brand / Content Lead · reviewed monthly + on brand updates
  • Brand voice & tone guide
  • Messaging framework
  • Case studies + testimonials
  • Press & events
↓ ↓ ↓
Vector store — chunked docs, embeddings, metadata (type / date / version), similarity scoring
↓
Version control & provenance — owner, version, change log, one-click rollback
↓
Retrieval API — query(topic, type, recency_filter) → chunks + provenance + confidence

Validation pipeline — how hallucination and stale content get caught

Agent generates output → Source citation check → Recency check → Brand voice check → Contradiction check → pass → human review · fail twice → human co-drafting
Failure mode — product changes, context layer doesn't The most dangerous failure: content generates against stale product info and publishes claims that are no longer true. Detection is a version check — if product context is >60 days old, every output is flagged "stale product context — verify before publication," and a product-release webhook marks the context layer "pending update" until Product Marketing confirms. The agent never auto-publishes on a product claim; human review is mandatory until the flag clears.
Failure mode — sources contradict each other Example: a case study claims an 80% reduction in payroll processing time, the product doc says up to 25% efficiency gain. The retrieval API returns both chunks rather than picking one — the agent must surface the contradiction in its output and route to human review to decide which framing fits the context, instead of silently choosing.
Failure mode — human becomes the bottleneck If every piece needs full review, the agent shifts work instead of creating leverage. Fix: tiered review (low-risk content auto-publishes with spot-check audit; high-risk content — blog, press, customer email — stays mandatory), batch review with highlighted sources (20 min → 5 min per piece), and a fast-track queue for confidence > 0.95 with all checks passed.

Who can write, read, and administer

Write access

  • Product Marketing → Product Context
  • Competitive Intelligence → Market Context
  • Brand/Content Lead → Company Context
  • Marketing Ops → structure, metadata, versioning

Read access

  • All AI agents, via the Retrieval API
  • All marketing team members, via UI or API
  • Sales/SDR team — read-only, agent-mediated

Admin access

  • Marketing Ops Lead — governance, audit, rollback

How agents access it

One standardized call for every agent — query_context(topic, type, recency_filter, limit). Frequently used context (brand voice, ICP) is cached per agent and invalidates on version change. Every query is logged: which agent, what query, which chunks came back, when — so a bad output is traceable to the exact context it ran on.

How people interact with it

A Retool-style UI for search, edit-with-versioning, pending-approval review, and audit trail. Plus a Slack path: updates notify the owning channel (#product-marketing, #competitive-intel), and anyone can run /context query "..." straight from Slack.

Approval workflow

Owner edits → draft version → Marketing Ops Lead reviews → approved → live, all agents get it next query · rejected → owner revises

Every change logs who / what / when / why. If a context update tanks agent quality (caught by monitoring), Marketing Ops rolls back to the previous version in one click — every agent gets the rollback on its next query.

Guardrails against stale or conflicting context Every retrieved chunk carries last_updated — past the threshold, the output is flagged "stale context." If two chunks with similarity > 0.8 disagree, the agent gets a conflict_flag and must acknowledge the conflict rather than pick a side. And structurally: no agent generates from zero chunks, every factual claim needs a citation, and context version ships in the output metadata for audit.

The scenario

An outbound intelligence agent runs ~300 times/day across the SDR team, pulling context from Salesforce, Gong, ZoomInfo, and Sumble on every run. After two weeks: costs are 3x estimate, 70% of outputs are good, 20% acceptable, 10% confidently wrong — two SDRs already sent factually incorrect outreach.

Root cause 1

Over-fetching context

Pulling large payloads from all four sources on every run — likely 50K tokens when 5K is relevant.

Evidence

300 runs × 50K tokens × $3.00/M = $45/day on input alone; at 5K tokens that's $4.50/day — 10x waste.

Root cause 2

Sonnet 5 for every task

Signal classification, role matching, and scoring don't need Sonnet-level reasoning — DeepSeek V4 Flash is 21x cheaper on input, 53x on output.

Evidence

If 60% of runs could move to Flash, that's ~20x cost reduction on those runs alone.

Root cause 3

No prompt caching

System prompt + product context (~2,000 tokens) re-sent at full price every run instead of using Sonnet 5's cache-read pricing.

Evidence

Uncached: $1.80/day on system prompt alone. Cached: $0.18/day. 90% savings on that slice.

Root cause 4

No retrieval filtering

All available context passes through unfiltered — wasting tokens, distracting the model with noise, and letting contradictory chunks confuse generation.

Evidence

The 10% confidently-wrong outputs likely trace to the model latching onto irrelevant or contradictory chunks.

Root cause 5

No confidence scoring or validation

Every output is treated equally — there's no gate between generation and SDR delivery.

Evidence

"Two SDRs already sent factually incorrect outreach" — outputs are reaching SDRs with zero review layer.

Root cause 6

No prompt optimization

Prompts are likely verbose and unstructured, with redundant instructions burning input tokens on every single run.

Evidence

A 3x cost overrun against estimate is consistent with prompt + context token count running well above plan.

Lever 1

Prompt architecture rewrite

Cut the system prompt from a sprawling ~2,000-token brief to ~200 tokens: role, retrieved context slots, a capped output schema, and one grounding rule — no evidence, no claim.

Impact

System prompt -90%, context -96% (50K → 2K), output capped -60%. ~85% total token reduction per run.

Lever 2

Context retrieval strategy

Semantic retrieval with relevance scoring: embed the query, pull top 5 chunks, filter by relevance >0.75 and recency, cap at 2K tokens. Summarize Gong transcripts and Salesforce history instead of passing full logs.

Impact

Input tokens 50K → 2K (96% reduction) and a quality gain — the model works from signal, not noise.

Lever 3

Model selection & routing

Route by task type and complexity: classification/scoring/validation → DeepSeek V4 Flash; high-complexity enterprise outreach → Claude Sonnet 5; standard personalization → Flash.

Impact

~60% of runs move to Flash at ~30x lower cost — roughly 10x blended cost reduction on its own.

Lever 4

Prompt caching (Sonnet 5)

Cache the static ~2,000-token block (system prompt, product context, brand voice, ICP) at 5-min TTL; only the ~500-token dynamic block is fresh per run.

Impact

90% savings on cached tokens; break-even at 2 cache reads. At 300 runs/day: ~$1.40/day in cache savings alone.

Lever 5

Two-layer output validation

Layer 1 (free): schema, length, and brand-voice checks. Layer 2 (DeepSeek V4 Flash, ~$0.0001/validation): claim verification, hallucination check, independent confidence score.

Impact

Confidently-wrong outputs drop from 10% toward <1% — caught before they reach an SDR, not after.

Lever 6

Confidence-based routing

>0.85 + validation pass → fast-track. 0.6–0.85 → standard review. <0.6 or validation fail → regenerate stricter; fail twice → human co-drafting. Every claim needs cited evidence or it's stripped from the draft.

Impact

SDR-facing failures drop ~90% (10% → <1%) while fast-track keeps throughput high for the 90%+ good outputs.

Daily cost · 300 runs
$54 → $1.26
−98%
Monthly cost · 22 days
$1,188 → $27.72
−98%
Confidently-wrong outputs
10% → <1%
−9pp · quality up

Before vs. after

MetricBeforeAfterChange
Input tokens / run~50,000~2,500 (2K cached + 500 fresh)-95%
Output tokens / run~2,000~500 (capped)-75%
Model mixSonnet 5, all runsSonnet 5 (40%) + Flash (60%)—
Cost per run (blended)$0.18$0.0042-98%
Daily cost (300 runs)$54$1.26-98%
Monthly cost (22 days)$1,188$27.72-98%
Output quality (good)70%90%++20pp
Confidently wrong10%<1%-9pp
SDR-facing failures10% (~30/day)<1% (<3/day)-90%

Cost levers, ranked by effort

LeverCost reductionImplementation effort
Context filtering (50K → 2K)96% on inputMedium — vector store + retrieval
Model routing (Sonnet → Flash, 60%)~20x on those runsLow — routing logic
Prompt caching (Sonnet 5)90% on cached tokensLow — API parameter
Prompt optimization (2K → 200 sys prompt)90% on system promptLow — prompt rewrite
Output capping (2K → 500)75% on outputLow — max_tokens
Key insight — cost is an architectural decision, not a compromise The ~98% cost reduction comes from context filtering, model routing, and caching — not from cutting corners. Quality actually improves alongside cost: the model focuses on relevant context instead of noise, validation catches hallucinations before SDRs see them, and confidence-based routing keeps low-quality output out of the send queue entirely.

12 months out — what exists

Content Production Agent Campaign Brief Agent Social Listening & Response Task Orchestration Context Layer Observability Layer

All six operational: content generates from the context layer with human review on high-risk pieces and auto-publish on low-risk; campaign briefs compress planning from days to hours; social moves from reactive to proactive with 24/7 coverage; marketing ops runs on exception-based management instead of manual tracking. Every agent run is tracked for latency, cost, quality, and cache hit rate, reviewed weekly with the Marketing Ops Lead.

What it has changed

  • Content team shifts from writing to editing — 3–5x output per writer
  • Campaign planning: days → hours
  • Social: reactive monitoring → proactive engagement
  • Marketing ops: manual tracking → exception-based management
  • Every piece of content is grounded — no hallucination reaching publication
  • Marketing and sales share one context layer — messaging stays aligned
  • Cost per content piece down 90%+ via caching and model routing

Main challenges

Technical + org

Context layer maintenance

Product changes, the context layer doesn't — agents produce outdated content.

Solution

Staleness alerts on version control, a release webhook that triggers the update workflow, and clear single-owner assignment per domain (Product Marketing / Competitive Intel / Brand Lead). No ownership, no update.

Organizational

Team adoption

The team either over-edits (defeating the purpose) or under-reviews (letting bad content through) because they don't trust AI output yet.

Solution

Start on low-risk use cases to build trust, train the team to work with their agent rather than against it, and let SDR/team feedback shape prompt iteration.

Technical

Brand voice consistency

Output drifts from brand voice over time, especially as prompts get iterated on.

Solution

Brand voice lives in the context layer, not buried in the prompt. A validation layer checks every output against it; weekly audits sample 10 outputs per agent against the rubric.

Data-related

Measuring ROI

"How much pipeline did the agent generate?" is hard to answer when agents support humans rather than replace them.

Solution

Measure time saved, output increased, quality maintained (edit/rejection rate), and cost per output. Correlate with pipeline metrics without claiming direct attribution — the ROI is leverage, not replacement.

Technical

Cost management at scale

As content production scales, token costs can grow in ways that are easy to miss until the invoice arrives.

Solution

Caching, model routing, output capping, and weekly cost review (cost per piece, cache hit rate, model mix) — investigate anything that moves >10% week over week.

12 months out — what exists

Signal Agent Source Agent Enrichment Agent Score Agent Outreach Agent Coach Agent Pre-Call Intelligence Agent

The full Part 1 stack in production, plus a Pre-Call Intelligence Agent that briefs SDRs/AEs before calls — account history, contact roles, recent signals, talking points, objection handlers — pulled from the context layer, Salesforce, and Gong with prompt caching on product context.

What it has changed

  • SDRs spend 80% of time on conversations, not research
  • Personalization quality rises while time-per-email drops
  • Account prioritization is transparent and data-driven, not gut-feel
  • Coaching is continuous, not quarterly
  • Marketing and sales share the same context layer — messaging alignment
  • Pipeline velocity rises — SDRs work higher-quality accounts with better personalization
  • Cost per SDR run down 98% via model routing, context filtering, and caching

Main challenges

Organizational

SDR trust

SDRs have seen obviously-AI outreach before and don't want to send it.

Solution

Start with the Coach Agent, not Outreach — show SDRs what's working before asking them to trust AI-generated content. Outreach Agent then arrives as a drafting tool, never an auto-sender. Trust is earned through quality, not mandated.

Technical + data

Data quality across systems

Salesforce, Gong, ZoomInfo, and Sumble each have different models, freshness, and quality — agents inherit the weakest link.

Solution

Every agent has defined degradation behavior (Part 1): confidence adjusts and outputs flag when a source is stale or down. A Marketing Ops dashboard shows source health in real time.

Technical

Cost management at scale

300 SDR runs/day is the start — costs can spiral as agents extend to AEs and CS.

Solution

Model routing, context filtering, token caps, and cost-anomaly alerts. The Part 4 remediation plan is the template, applied proactively rather than reactively.

Organizational

Sales-marketing alignment

Marketing builds the agents SDRs use, but SDRs report to Sales — who owns what, and who prioritizes improvements?

Solution

Marketing owns the infrastructure, Sales owns the outcomes. Shared metrics (pipeline contribution, meetings booked, reply rate) and joint sign-off on changes to SDR-facing agents.

Technical

Hallucination in customer-facing content

An SDR sends outreach with a wrong claim — the prospect loses trust, the SDR loses credibility.

Solution

Evidence-based personalization: every claim cites a source, no source means no claim. Low-confidence output never reaches SDRs without human co-drafting. AI drafts, humans approve — non-negotiable.

Technical

Cache management across territories

Prompt caching has a 5-minute TTL — SDRs across time zones running agents at different times increases cache misses.

Solution

Territory-based cache warming at the start of each territory's business hours; monitor hit rate by territory and adjust the warming schedule if it drops below 80%.

One role, two domains, one shared substrate.

Not two workstreams — one infrastructure

This isn't "build AI for marketing" and "build AI for sales" as separate tracks. It's building AI infrastructure that serves both, grounded in one shared context layer. Marketing content and SDR outreach draw from the same positioning, the same case studies, the same battle cards. When product changes, both domains update together — because they share the substrate.

Agents on the data layer, humans on the relationship layer

The 12-month vision isn't "lots of agents" — it's a coherent system where agents handle the data layer, humans handle the relationship layer, and the context layer keeps everything grounded and current. AI does the research; humans do the conversation. That's how genuine relationships scale to enterprise size.

Cost is an architectural decision, not an afterthought

Model routing, prompt caching, context filtering, and output capping are designed in from day one — the Part 4 remediation applied proactively. Result: ~98% cost reduction while quality improves, because the model focuses on relevant context, validation catches errors, and confidence-based routing keeps bad output away from humans.

Alessandro Capezza · AI GTM Engineer — Fintech Workforce Platform · Claude Sonnet 5 + DeepSeek V4 Flash