Engineering case study

How Kojable Made DataForSEO LLM Mentions Production-Safe

12 production problems, six engineering controls, and the trade-off between exact tracking and directional AI visibility. Our first implementation treated an indexed external AI dataset too much like a deterministic prompt runner. Production exposed interacting problems involving market support, sparsity, relevance, cost, partial failure and metric interpretation.

Kojable rebuilt the integration around market capability checks, explicit data states, relevance classification, bounded sampling, partial-run recovery, immutable cost accounting and honest confidence labels.

  • DataForSEO
  • LLM Mentions
  • 16 min read
  • Engineering case study
28 → 14Planned observations reduced to the market-supported set
338 → 17Provider rows reduced to accepted metric evidence
$4.378 → $2.10Recorded cost versus the comparable post-fix maximum estimate

Quick answer

What changed in the production integration?

Kojable’s first DataForSEO LLM Mentions implementation assumed broader platform availability, more deterministic freshness and more complete datasets than the provider could guarantee. The revised system checks market support before paid work, distinguishes absence from zero performance, filters broad rows through a versioned relevance policy, separates cited sources from retrieved search results, caps each observation at one top-volume page, preserves valid rows when siblings fail, records provider charges independently and labels sampled comparisons as directional rather than exact.

This was not one bug. It was a set of interacting data, product and distributed-systems problems. Some constraints are inherent in an external indexed dataset; some are documented market and platform limits; some came from our initial assumptions; and some were integration bugs that Kojable owned and corrected.

DataForSEO provides a valuable external AI-search dataset, but a production system cannot assume that its coverage, freshness, market availability, payload shape and cost behave like a deterministic live prompt runner. Kojable added the controls required to turn that data into an honest, auditable and commercially useful signal.

Current pipeline

How the pipeline works now

Six control families now govern capability, data meaning, classification, sampling, recovery and accounting. The operational path is deliberately explicit from workspace configuration to the Share of Voice dashboard.

  1. Workspace market and approved topics

    Collection starts from the market and the topics the workspace has deliberately approved.

  2. Eligible-platform policy

    The product determines which provider platforms may be considered for that workspace.

  3. Exact market and language capability check

    Capability is confirmed for the precise combination before any paid observation begins.

  4. Cost estimate and budget reservation

    The system estimates the bounded work and reserves budget before paid requests start.

  5. One request per topic and eligible platform

    Every eligible observation has an isolated topic-and-platform scope.

  6. Top 50 rows by AI search volume

    One page is collected, ordered by AI search volume descending, with no automatic second paid page.

  7. Normalisation and validation

    Typed envelopes, null-safe conversion and bounded text handling establish a safe internal shape.

  8. Relevance, brand, URL and domain classification

    Versioned rules decide which rows may influence metrics and how ownership is interpreted.

  9. Provider-charge accounting

    Each accepted provider task has an independent, immutable charge record.

  10. Mention and citation persistence

    Valid observations and source-based citation events are retained without inventing missing evidence.

  11. Metrics and confidence calculation

    Denominators, sample state, ownership and comparability determine which metrics can be shown.

  12. Share of Voice dashboard

    The interface presents the current signal with clear unsupported, sparse, partial or directional labels.

Problem map

12 production problems we had to solve

Twelve production problems and their controls
ProblemControl
Indexed observations looked like freshly executed prompts.Separate provider-observation time from Kojable collection time.
Platform support varied by market.Check exact market and language capability before paid work.
Supported markets could still have no corpus or sparse output.Represent unsupported, empty, sparse, directional and sufficient states separately.
Broad topics returned many workspace-irrelevant rows.Apply versioned accepted, ambiguous and excluded relevance outcomes.
Retrieved results could be mistaken for cited sources.Create citation events from provider source records, not every retrieved result.
Pagination created an unpredictable cost surface.Use one page, a 50-row maximum and AI-search-volume ordering.
Payloads contained nulls, long text and shape variation.Use typed validation, safe normalisation and item-level quarantine.
The application expected model_name while an initial schema used model.Reconcile schema contracts safely and make schema readiness a deployment gate.
Timeouts and transient transport failures affected individual observations.Use bounded retries and isolate failures by topic and platform.
Provider billing and persistence could not be atomic.Use pre-authorisation, immutable provider-charge records and reconciliation.
Cost was controlled only after provider work started.Reserve budget before starting paid observations.
A failed parent run hid valuable persisted data.Allow usable partial snapshots and repair historical status from persisted evidence.

1. Observation time

Problem
Indexed observations looked freshly executed.
Control
Separate provider time from collection time.

2. Market support

Problem
Platform support varied by market.
Control
Check exact market and language capability first.

3. Sparse corpus

Problem
Supported markets could still be empty or sparse.
Control
Keep unsupported, empty, sparse, directional and sufficient states distinct.

4. Relevance

Problem
Broad topics returned irrelevant rows.
Control
Classify accepted, ambiguous and excluded outcomes.

5. Citation meaning

Problem
Retrieval outputs looked like citations.
Control
Create citation events only from source records.

6. Pagination

Problem
Pagination made cost unpredictable.
Control
One top-volume page, capped at 50 rows.

7. Payload variation

Problem
Nulls, long text and shape variation.
Control
Typed validation, safe normalisation and item quarantine.

8. Schema contract

Problem
Application and schema model fields differed.
Control
Safe reconciliation and a schema deployment gate.

9. Observation failure

Problem
Transport failures affected individual work.
Control
Bounded retries and topic-platform isolation.

10. Accounting boundary

Problem
Provider billing and persistence were not atomic.
Control
Pre-authorisation, immutable charges and reconciliation.

11. Late budget control

Problem
Paid work began before firm cost control.
Control
Reserve budget before paid observations.

12. Hidden partial data

Problem
A failed parent hid useful rows.
Control
Usable partial snapshots and evidence-based repair.

Chapter 1 · Data meaning

Is DataForSEO LLM Mentions real time?

LLM Mentions is not equivalent to Kojable sending a fresh prompt to ChatGPT or Google whenever collection runs. DataForSEO returns recorded AI-search mention observations. Provider rows include first-observed and last-updated timestamps, and both may predate the moment Kojable retrieved them. A synchronous, or “live”, API response describes the retrieval path; it does not necessarily mean a new underlying AI answer was generated at that instant.

Provider time

When DataForSEO first or last observed the AI response.

Collection time

When Kojable retrieved and stored the provider row.

Collected today means Kojable checked the indexed dataset today. It does not necessarily mean the underlying AI answer was generated today.

Market and platform scope matters just as much. The provider’s google platform represents Google AI Overview; we do not describe it as Google AI Mode. ChatGPT LLM Mentions coverage is market-specific. Our first implementation planned Google and ChatGPT work for every workspace without first establishing the exact capability combination.

That was our mistake. In the Irish production example, the workspace had 14 tracked topics. Planning two platforms produced 28 originally planned observations, but only 14 Google AI Overview observations were supported. The 14 ChatGPT observations were unsupported for that market and should never have reached paid planning. The correction is a capability check, not a criticism of a provider whose market availability needs to be interpreted as documented.

Chapter 2 · Confidence

Why no provider result does not mean zero AI visibility

An empty-looking dashboard can conceal several materially different states. We now preserve those states because product language and metric denominators should change with the evidence.

Unsupported

The platform, market and language combination is unavailable.

Empty

The provider request succeeded but returned no rows.

No indexed responses

There is no usable provider denominator.

No relevant responses

Rows arrived, but none passed Kojable’s relevance policy.

Very sparse

Only a minimal accepted sample exists.

Directional

There is enough evidence for a pattern, but not a strong representative claim.

Sufficient

The accepted sample crosses Kojable’s stronger sample-size threshold.

A null denominator must produce an unavailable metric, not a false 0%. AI search volume of 0 is a measured value; AI search volume of null is unknown. Those meanings are not interchangeable.

Ownership is another denominator

Collection can proceed without a confirmed owned domain. Brand mentions and external citations can still be measured. Owned citation metrics, however, remain unavailable until the workspace’s owned domains are known. Showing 0% would falsely imply that ownership was tested and no owned citations existed.

Sample-size confidence is similarly bounded. Calling a sample “sufficient” means it crossed an internal evidence threshold for the selected view. It does not prove that DataForSEO’s indexed corpus represents the whole market, nor can application code create provider corpus where none exists.

Chapter 3 · Classification

How 338 provider rows became 17 accepted observations

338 raw persisted mentions

All provider rows retained as evidence.

17 accepted

Allowed to contribute to core metrics.

12 ambiguous

Held outside core metrics for future review.

309 excluded

Valid provider rows that did not satisfy workspace relevance policy.

2,938 citation events

Normalised source occurrences retained from provider source records.

The request is driven by tracked topics, not the brand domain alone. Broad topics can return answers whose words overlap the query while their practical meaning is only loosely related to the workspace. Treating every returned row as relevant would give those tangential observations the same metric weight as a direct buyer question.

Kojable therefore uses public-level signals such as topic overlap, question meaning, answer meaning, workspace context, brand signals and domain signals. The classifier is deterministic and versioned so the same policy can be audited and compared, but it remains heuristic. It can falsely exclude relevant observations, falsely accept weak ones and bias against broad or short topics. Ambiguous rows need future review, while all policy versions need periodic calibration.

The 309 excluded rows were not failed, corrupted or necessarily invalid. They were provider rows that did not satisfy Kojable’s relevance policy for the core metrics. Preserving that distinction is essential to treating the external dataset fairly and keeping metric meaning honest.

Portfolio deduplication

The same provider response may appear under more than one tracked topic. Topic views retain that topic-local relationship because it explains where the response was found. Portfolio-level Share of Voice counts the underlying response once, preventing a repeated observation from gaining extra influence merely because several topics retrieved it.

Why search results are not automatically citations

Provider sources represent pages cited or relied on in the final answer. Provider search_results represent broader retrieval output. A retrieved page may have helped exploration without influencing the final answer, so counting every search result as a citation would inflate citation metrics. Kojable retains retrieval evidence separately and creates the 2,938 citation events from source records.

Chapter 4 · Cost control

How Kojable capped DataForSEO collection costs

The current policy makes the unit of paid work explicit: one request for each tracked topic and eligible platform, one page, no more than 50 rows, ordered by AI search volume descending. A continuation token does not automatically trigger another paid request. Actual cost may be lower when fewer than 50 rows are available.

Before the fix, the 14-topic Irish workspace planned Google plus incorrectly assumed ChatGPT coverage. That meant 28 observations and potential multi-page expansion. The run recorded or exported $4.378 in provider cost. After the fix, the same market is eligible for Google AI Overview only: up to 14 paid observations, with one page and 50 rows for each. The comparable post-fix estimated maximum is $2.10.

A top-50 collection is a ranked, cost-controlled sample. It is not a complete snapshot of the provider corpus.

This trade-off changes how we talk about monitoring. Current Share of Voice, domain mix and high-volume sources can be directionally useful. But a citation that moves from position 51 to position 49 can look newly discovered even if it existed previously. Market, scope, platform and configuration changes can also make two runs incomparable. Exact “new” or “lost” language is therefore unavailable when collections are incomplete or incompatible.

Paid automatic collection runs every 14 local calendar days. That product cadence reduces unnecessary spend in sparse markets and avoids catch-up bursts. It also gives teams a repeatable interval for the topic visibility view without pretending that underlying provider observations refresh on the same schedule.

Chapter 5 · Recovery

How Kojable stopped one malformed row from destroying a run

Provider ingestion has to tolerate ordinary variation without hiding genuine infrastructure failure. The revised boundary validates typed provider envelopes, handles null values safely, records unknown platforms, detects missing task results and bounds large Markdown answers. Bounded transport retries apply only where a retry is safe; authentication problems fail fast. Telemetry is redacted before it becomes operational evidence.

Long answers exposed a less obvious text problem. JavaScript strings use UTF-16, so a naive slice can split a surrogate pair and damage a character such as an emoji. Safe truncation respects that boundary. Kojable stores a bounded answer excerpt, a content hash and the original length, which preserves useful evidence without persisting an unbounded response.

  1. Valid row

    Validate, normalise and persist the evidence.

  2. Invalid row

    Reject and record the item without treating it as metric evidence.

  3. Next valid row

    Continue and persist it instead of discarding the whole sibling set.

That item-level quarantine is not a licence to swallow unexpected infrastructure failures. Observation failures are isolated by topic and platform, while failures that threaten the integrity of the broader system remain visible. The parent collection can finish as partial when valid data exists alongside degraded siblings.

The schema mismatch was ours

DataForSEO returned model_name, while an initial Kojable PostgreSQL schema used model. That was a Kojable integration contract failure, not provider-data scarcity. The corrected system reconciles the contract safely and treats schema readiness as a deployment requirement.

Recovering the historical run

The production run persisted valuable data but ended with a failed parent-run status. The read model behaved correctly by ignoring failed runs, yet the consequence was that usable evidence disappeared from the product. We repaired the historical status using only persisted PostgreSQL evidence. No additional provider call was made, no missing rows were reconstructed, and the original failure remained auditable. Future degraded runs can surface as usable partial snapshots.

Chapter 6 · Accounting and metrics

Why provider billing and database persistence cannot be fully atomic

An external provider may accept and bill a request before Kojable persists either the charge or result. A normal PostgreSQL transaction cannot make the provider and the database one atomic system. If an HTTP response is lost, a retry can also be ambiguous: the original work may have happened even though the caller did not receive confirmation.

Our controls reduce that gap without claiming to eliminate it mathematically. Budget is reserved before paid work. Each observation is authorised individually. Provider task charges are immutable, and the provider’s actual cost is authoritative. Charge evidence is persisted before mention evidence. Further paid work stops when charge persistence repeatedly fails. Pricing drift is detected and historical spend can be reconciled.

These controls do not abolish distributed-systems risk. They make the remaining risk bounded, discoverable and auditable. An ambiguous retry can still create duplicate-charge exposure, which is why reconciliation remains part of the design rather than an afterthought.

What the current metrics mean

Citation Share of Voice
Owned citation occurrences divided by all accepted citation occurrences. It is occurrence share, not unique-domain share or prompt share.
Citation coverage
Accepted responses containing at least one owned citation divided by accepted responses.
Brand mention rate
Accepted responses in which the brand is detected divided by accepted responses.
AI opportunity-weighted coverage
Owned citation coverage weighted by the AI search volume that is available.
Distinct owned URLs
Unique normalised owned URLs appearing in accepted citation events.
Domain share
Citation-event share by normalised domain across accepted citation events.
New and lost citations
Available only when current and previous collections satisfy compatibility and completeness rules.

Are we building exact full-corpus citation-change monitoring, or a cost-controlled directional visibility monitor?

The top-50 architecture is strongly aligned with directional monitoring. It supports current Citation Share of Voice, domain mix, brand mention rate, topic diagnosis and discovery of high-volume citations. It is less suited to definitive claims that a citation was gained or lost across the provider’s complete corpus.

Before and after

From broad assumptions to bounded evidence

DataForSEO LLM Mentions integration before and after
BeforeAfter
28 observations planned for an Irish workspace, including 14 unsupported ChatGPT observations.Up to 14 market-supported Google AI Overview observations and no paid ChatGPT work outside supported markets.
Multi-page cost exposure and budget checks after work began.One page, 50 rows per observation and budget reservation before paid work.
One malformed item could degrade broader work.Item-level quarantine preserves valid siblings.
Valuable data was hidden by a failed parent status and overstated failure messaging.Partial snapshots remain usable and distinct from complete success.
Provider charges and results were too closely coupled.Immutable provider-charge accounting and reconciliation.
Unsupported, empty, sparse and ownership states risked misleading interpretation.States are shown separately; unresolved ownership produces unavailable metrics, not false zeroes.
Cadence and cost could expand with work discovered during collection.A fourteen-day automatic cadence and bounded observation policy.

Market scope

Before
28 planned; 14 ChatGPT observations unsupported.
After
Up to 14 supported Google AI Overview observations.

Cost surface

Before
Pagination and late cost control.
After
One page, 50 rows and pre-work reservation.

Failure scope

Before
Malformed siblings could hide valid work.
After
Quarantine and usable partial snapshots.

Metric honesty

Before
Absence states could read as zero performance.
After
Unsupported, empty, sparse and unknown remain distinct.

Limitations

What remains partially solved

Production-safe does not mean uncertainty-free. These are the boundaries we continue to manage and communicate.

1

Top-50 sampling cannot support exact full-corpus citation-change monitoring.

2

Small markets may have scarce provider corpus that application code cannot create.

3

The relevance classifier requires calibration and review of ambiguous rows.

4

Provider billing and database persistence cannot be made fully atomic.

5

Ambiguous retries retain a duplicate-charge risk.

6

Rapid baseline jobs still need careful coalescing.

7

Capability caching trades faster planning for some freshness risk.

8

Provider platform naming must remain precise as products evolve.

No provider corpus, no relevant rows, no owned citation and collection failure are four different statements. The product should never collapse them into one zero.

Kojable’s interpretation

Monitor → Diagnose → Improve → Verify

Monitor: collect eligible topic, answer, source, platform and provider-time evidence. The goal is not a score in isolation; it is a traceable observation with a declared scope.

Diagnose: separate unsupported markets, sparse samples, irrelevant rows, citation evidence, ownership gaps and collection failures. A useful diagnosis begins by refusing to call every absence the same thing.

Improve: change the information environment, topic scope, evidence or product configuration based on that defensible diagnosis. Kojable does not control third-party AI systems, so actions focus on evidence and configuration that teams can actually influence.

Verify: run comparable future collections and say whether the result is exact, sampled or directional. The AI visibility monitoring approach is useful only when the comparison conditions are visible.

Third-party AI data becomes useful only when the product communicates what was observed, what was unavailable, what was sampled, what was filtered and how confident the resulting metric should be.

Bottom line

The data needed an interpretation and control layer

The first production version assumed too much. DataForSEO’s external data became useful to Kojable after we added explicit capability, classification, cost, failure and confidence layers. The revised pipeline no longer assumes universal platform availability, paginates without a hard ceiling, lets one malformed row erase valid siblings or hides usable data solely because sibling observations degraded.

It also does not present sampled top-50 data as a complete corpus. Citation correlation is evidence of association in the observed sample, not proof that a particular page caused an AI answer. The system makes current visibility and source patterns measurable while preserving the limits of the underlying observation.

The current system is designed for cost-controlled directional monitoring. That makes current visibility, domain mix and topic diagnosis measurable. It does not justify casual claims that every gained or lost citation has been observed across the provider’s entire corpus.

FAQ

DataForSEO LLM Mentions integration questions

Is DataForSEO LLM Mentions real time?

It is synchronously retrievable indexed observation data, not necessarily a newly generated AI answer. Provider timestamps may predate Kojable’s collection.

What is the difference between provider time and collection time?

Provider time is when DataForSEO first or last observed the response. Collection time is when Kojable retrieved and stored that row.

Why does no DataForSEO result not mean zero visibility?

The combination may be unsupported, the request may be empty, the corpus may have no usable denominator or returned rows may fail relevance policy. Each differs from a measured zero.

Does DataForSEO LLM Mentions support ChatGPT in every country?

No. ChatGPT LLM Mentions availability is market-specific, so Kojable checks the exact market and language capability before paid work.

Why did Kojable accept only 17 of 338 persisted rows?

Broad tracked topics returned many rows that did not satisfy the workspace relevance policy. Seventeen were accepted, 12 ambiguous and 309 excluded; excluded does not mean failed or corrupted.

Are DataForSEO search results the same as citations?

No. Search results are broader retrieval output. Kojable creates citation events from provider source records associated with the final answer.

Why does Kojable collect only the top 50 rows?

One AI-search-volume-ranked page gives a bounded, cost-controlled sample. Automatic pagination would create a less predictable cost surface.

How does Kojable control DataForSEO costs?

It checks capability, estimates and reserves budget before paid work, authorises observations individually, limits each to one 50-row page and records provider charges independently.

Can a partial collection still be useful?

Yes. Valid persisted observations can support a clearly labelled partial snapshot even when sibling observations fail, provided metric denominators and confidence remain honest.

Can top-50 data identify exact new and lost citations?

Not across the complete corpus. A source can move across the sample boundary, so exact change language requires compatible and complete current and previous collections.

Why can provider billing and database persistence not be fully atomic?

The provider and Kojable’s database are separate systems. A provider can accept paid work before the local charge and result are committed, and a lost response can make retries ambiguous.

What does directional AI visibility monitoring mean?

It means using a declared, ranked sample to assess current patterns such as Share of Voice, domain mix, brand mentions and topic gaps without claiming complete market coverage.

Next step

See what is shaping AI’s answers about your company

Establish your current AI representation baseline, identify the sources and evidence associated with the result, and learn what to investigate next.