Experiment: The impact of curated datasets on AI agent token use
Coralogix is a full-stack observability platform. It processes telemetry as it streams in and keeps it, always queryable, in the customer's own cloud object storage. We wanted to know whether curated datasets cut the work an AI agent does to answer questions about production telemetry. Three versions of the same agent each answered 100 questions about three businesses, from simple lookups to multi-step investigations, ten times over. One could query only raw logs and spans. A second was told how to find datasets, and a third had every dataset described in its system prompt. Across 3,000 sessions, we measured tokens, time, tool calls and accuracy.
At a glance
With the dataset catalog in their system prompt, agents answered the same 100 questions with 86% fewer tokens and solved 939 of 940 runs, against 930 with raw telemetry alone.
Tokens per question when agents discovered datasets
Time to answer
Tool calls
Sessions that ran out of time
The telemetry we started with
Every question ran against Coralogix’s own demo account, which simulates three businesses: an online casino and sportsbook, an ecommerce store and a research platform for finance clients. Over the seven days we used, they sent about 40 million log records and 35 million spans from 69 services.
GoldSpin Play
- Log records
- 25.7M
- Spans
- 22.7M
- Services
- 25
Coralogix Store
- Log records
- 12.8M
- Spans
- 10.6M
- Services
- 25
Coralogix Finance
- Log records
- 1.5M
- Spans
- 1.5M
- Services
- 19
Each dataset is one DataPrime query, run over the week as a Background Query, with its results written back to the account. Open a dataset to see its query.
Business events
2,166,606 rowsOne row per business event, with its fields lifted out of the log record: a bet, a deposit, an order line, a query billed.
gaming.wallet_events+
source logs | filter $l.applicationname == 'goldspin-play' && $d.attributes['event.domain'] == 'business' | choose $d.attributes['event.name'] as event, $d.attributes['outcome'] as outcome, $l.subsystemname as service, $d.attributes['user.id'] as user_id, $d.attributes['user.segment'] as user_segment, $d.attributes['session.id'] as session_id, $d.attributes['money.amount_minor']:number as amount_minor, $d.attributes['money.currency'] as currency, $d.attributes['money.direction'] as direction, $d.attributes['money.kind'] as money_kind, $d.attributes['money.margin_minor']:number as margin_minor, $d.attributes['payment.method'] as payment_method, $d.attributes['decline.code'] as decline_code, $d.attributes['decline.issuer'] as decline_issuer, $d.attributes['decline.reason'] as decline_reason, $d.attributes['reject.reason'] as reject_reason, $d.attributes['hold.reason'] as hold_reason, $d.attributes['block.reason'] as block_reason, $d.attributes['bet.market'] as market, $d.attributes['bet.selection'] as selection, $d.attributes['bet.selections']:number as selections, $d.attributes['bet.price']:number as price, $d.attributes['jackpot.game'] as jackpot_game, $d.attributes['jackpot.tier'] as jackpot_tierecommerce.order_events+
source logs | filter $l.applicationname == 'coralogix-store' && $d.logRecord.attributes['event.domain'] == 'business' | choose $d.logRecord.attributes['event.name'] as event, $d.logRecord.attributes['outcome'] as outcome, $l.subsystemname as service, $d.logRecord.attributes['user.id'] as user_id, $d.logRecord.attributes['user.segment'] as user_segment, $d.logRecord.attributes['customer.type'] as customer_type, $d.logRecord.attributes['session.id'] as session_id, $d.logRecord.attributes['money.amount_minor']:number as amount_minor, $d.logRecord.attributes['money.currency'] as currency, $d.logRecord.attributes['money.direction'] as direction, $d.logRecord.attributes['money.kind'] as money_kind, $d.logRecord.attributes['order.items']:number as order_items, $d.logRecord.attributes['order.lines']:number as order_lines, $d.logRecord.attributes['order.discount_minor']:number as order_discount_minor, $d.logRecord.attributes['order.margin_minor']:number as order_margin_minor, $d.logRecord.attributes['order.promo_code'] as promo_code, $d.logRecord.attributes['delivery.method'] as delivery_method, $d.logRecord.attributes['payment.method'] as payment_method, $d.logRecord.attributes['product.sku'] as sku, $d.logRecord.attributes['product.name'] as product_name, $d.logRecord.attributes['product.department'] as department, $d.logRecord.attributes['line.qty']:number as line_qty, $d.logRecord.attributes['line.unit_price_minor']:number as line_unit_price_minor, $d.logRecord.attributes['line.full_price_minor']:number as line_full_price_minor, $d.logRecord.attributes['line.discount_minor']:number as line_discount_minor, $d.logRecord.attributes['line.revenue_minor']:number as line_revenue_minor, $d.logRecord.attributes['line.cost_minor']:number as line_cost_minor, $d.logRecord.attributes['line.margin_minor']:number as line_margin_minor, $d.logRecord.attributes['line.value_minor']:number as line_value_minor, $d.logRecord.attributes['basket.items']:number as basket_items, $d.logRecord.attributes['abandon.stage'] as abandon_stage, $d.logRecord.attributes['stock.cause'] as stock_cause, $d.logRecord.attributes['decline.code'] as decline_code, $d.logRecord.attributes['decline.reason'] as decline_reasonfintech.research_billing+
source logs | filter $l.applicationname == 'coralogix-finance' && $d.logRecord.attributes['event.domain'] == 'business' | choose $d.logRecord.attributes['event.name'] as event, $d.logRecord.attributes['outcome'] as outcome, $l.subsystemname as service, $d.logRecord.attributes['user.id'] as user_id, $d.logRecord.attributes['user.segment'] as client_segment, $d.logRecord.attributes['session.id'] as session_id, $d.logRecord.attributes['money.amount_minor']:number as amount_minor, $d.logRecord.attributes['money.currency'] as currency, $d.logRecord.attributes['money.direction'] as direction, $d.logRecord.attributes['cost.kind'] as cost_kind, $d.logRecord.attributes['research.asset_class'] as asset_class, $d.logRecord.attributes['research.region'] as region, $d.logRecord.attributes['research.cited'] as cited, $d.logRecord.attributes['research.citation.count']:number as citation_count, $d.logRecord.attributes['research.retrieval_passes']:number as retrieval_passes, $d.logRecord.attributes['vendor.calls']:number as vendor_calls, $d.logRecord.attributes['guardrails.blocked'] as guardrail_blocked, $d.logRecord.attributes['refund.reason'] as refund_reason, $d.logRecord.attributes['export.format'] as export_format
Customer rollups
202,269 rowsOne row per customer per day, or per shopping session, with totals already added up.
gaming.player_daily+
source logs | filter $l.applicationname == 'goldspin-play' && $d.attributes['event.domain'] == 'business' && $d.attributes['user.id'] != null | create ev from $d.attributes['event.name']:string | create amt from $d.attributes['money.amount_minor']:number | create mg from $d.attributes['money.margin_minor']:number | groupby roundTime($m.timestamp, 1d) as day, $d.attributes['user.id']:string as user_id, $d.attributes['user.segment']:string as user_segment aggregate count() as events, sum(if(ev == 'bet.accepted', 1, 0)) as bets_accepted, sum(if(ev == 'bet.rejected', 1, 0)) as bets_rejected, sum(if(ev == 'bet.accepted', amt, 0)) as stake_minor, sum(if(ev == 'bet.won', amt, 0)) as winnings_paid_minor, sum(if(ev == 'bet.won' || ev == 'bet.lost', mg, 0)) as house_margin_minor, sum(if(ev == 'deposit.settled', amt, 0)) as deposits_minor, sum(if(ev == 'deposit.declined' || ev == 'deposit.blocked', 1, 0)) as deposits_failed, sum(if(ev == 'withdrawal.paid', amt, 0)) as withdrawals_paid_minor, sum(if(ev == 'withdrawal.held', 1, 0)) as withdrawals_held, sum(if(ev == 'jackpot.won', amt, 0)) as jackpot_minor, approx_count_distinct($d.attributes['session.id']) as sessionsecommerce.session_funnel+
source logs | filter $l.applicationname == 'coralogix-store' && $d.logRecord.attributes['event.domain'] == 'business' && $d.logRecord.attributes['session.id'] != null | create ev from $d.logRecord.attributes['event.name']:string | create amt from $d.logRecord.attributes['money.amount_minor']:number | groupby $d.logRecord.attributes['session.id']:string as session_id aggregate min($m.timestamp) as first_seen, max($d.logRecord.attributes['user.id']:string) as user_id, max($d.logRecord.attributes['customer.type']:string) as customer_type, max($d.logRecord.attributes['user.segment']:string) as user_segment, sum(if(ev == 'basket.started', 1, 0)) as baskets_started, sum(if(ev == 'basket.started', amt, 0)) as basket_value_minor, max(if(ev == 'basket.abandoned', $d.logRecord.attributes['abandon.stage']:string, null)) as abandon_stage, sum(if(ev == 'order.placed', 1, 0)) as orders_placed, sum(if(ev == 'order.placed', amt, 0)) as order_value_minor, sum(if(ev == 'order.placed', $d.logRecord.attributes['order.discount_minor']:number, 0)) as discount_minor, max(if(ev == 'order.placed', $d.logRecord.attributes['order.promo_code']:string, null)) as promo_code, sum(if(ev == 'order.declined', 1, 0)) as orders_declined, sum(if(ev == 'order.lost', 1, 0)) as orders_lost, sum(if(ev == 'order.lost', amt, 0)) as lost_value_minorfintech.client_daily+
source logs | filter $l.applicationname == 'coralogix-finance' && ($d.logRecord.attributes['user.id'] != null) | create ev from $d.logRecord.attributes['event.name']:string | create amt from $d.logRecord.attributes['money.amount_minor']:number | groupby roundTime($m.timestamp, 1d) as day, $d.logRecord.attributes['user.id']:string as user_id aggregate max($d.logRecord.attributes['user.segment']:string) as client_segment, sum(if(ev == 'query.billed', 1, 0)) as queries_billed, sum(if(ev == 'query.billed', amt, 0)) as billed_minor, sum(if(ev == 'query.failed', 1, 0)) as queries_failed, sum(if(ev == 'credit.refunded', amt, 0)) as refunded_minor, sum(if(ev == 'inference.charged', amt, 0)) as inference_cost_minor, sum(if(ev == 'vendor.datacall.charged', amt, 0)) as market_data_cost_minor, sum(if(ev == 'notebook.exported', 1, 0)) as notebooks_exported, sum(if($d.logRecord.attributes['error.type'] == 'VendorQuotaExceeded', 1, 0)) as vendor_quota_errors, sum(if($m.severity == ERROR, 1, 0)) as error_logs
Platform rollups
83,385 rowsOne row per service, route or price feed per hour: latency percentiles, request counts, errors and pool pressure.
platform.service_latency_hourly+
source spans | filter $l.applicationName == 'goldspin-play' || $l.applicationName == 'coralogix-store' || $l.applicationName == 'coralogix-finance' | create dur_ms from $m.duration:number / 1000 | groupby roundTime($m.timestamp, 1h) as hour, $l.applicationName as app, $l.serviceName as service, $l.operationName as operation, $d.tags['span.kind']:string as span_kind aggregate count() as spans, sum(if($d.tags['otel.status_code'] == 'ERROR', 1, 0)) as errors, avg(dur_ms) as avg_ms, percentile(0.5, dur_ms) as p50_ms, percentile(0.95, dur_ms) as p95_ms, percentile(0.99, dur_ms) as p99_ms, max(dur_ms) as max_msplatform.http_requests_hourly+
source logs | filter ($l.subsystemname == 'edge-gateway' || $l.subsystemname == 'store-gateway' || $l.subsystemname == 'research-gateway') | create route from firstNonNull($d.attributes['http.route'], $d.logRecord.attributes['http.route']) | create status from firstNonNull($d.attributes['http.status_code'], $d.logRecord.attributes['http.status_code']) | filter route != null && status != null | groupby roundTime($m.timestamp, 1h) as hour, $l.applicationname as app, $l.subsystemname as gateway, route:string as route, status:string as status_code aggregate count() as requestsplatform.resource_pressure_hourly+
source logs | filter $l.applicationname == 'goldspin-play' || $l.applicationname == 'coralogix-store' || $l.applicationname == 'coralogix-finance' | create in_use from firstNonNull($d.attributes['pool.in_use'], $d.logRecord.attributes['pool.in_use']):number | create size from firstNonNull($d.attributes['pool.size'], $d.logRecord.attributes['pool.size']):number | create breached from firstNonNull($d.attributes['budget.breached'], $d.logRecord.attributes['budget.breached']):string | filter in_use != null || breached != null || $d ~ 'degraded' | groupby roundTime($m.timestamp, 1h) as hour, $l.applicationname as app, $l.subsystemname as service aggregate sum(if(in_use != null, 1, 0)) as pool_samples, max(in_use) as pool_max_in_use, avg(in_use) as pool_avg_in_use, max(size) as pool_size, sum(if(in_use != null && in_use >= size, 1, 0)) as pool_saturated_samples, sum(if(breached == 'true', 1, 0)) as latency_budget_breaches, sum(if($d ~ 'degraded', 1, 0)) as degraded_pod_warningsops.error_rollup_hourly+
source logs | filter ($l.applicationname == 'goldspin-play' || $l.applicationname == 'coralogix-store' || $l.applicationname == 'coralogix-finance') && $m.severity >= WARNING | create err_type from firstNonNull($d.attributes['error.type'], $d.logRecord.attributes['error.type'], 'none') | groupby roundTime($m.timestamp, 1h) as hour, $l.applicationname as app, $l.subsystemname as service, $m.severity as severity, err_type as error_type aggregate count() as eventsgaming.odds_feed_hourly+
source logs | filter $l.applicationname == 'goldspin-play' && $d.attributes['feed.provider'] != null | groupby roundTime($m.timestamp, 1h) as hour, $l.subsystemname as service, $d.attributes['feed.provider']:string as provider aggregate count() as observations, sum(if($d.attributes['feed.status'] == 'stale', 1, 0)) as stale_observations, max($d.attributes['feed.last_tick_age_ms']:number) as max_tick_age_ms, avg($d.attributes['feed.last_tick_age_ms']:number) as avg_tick_age_ms, approx_count_distinct(if($d.attributes['market.status'] == 'suspended', $d.attributes['market.id']:string, null)) as suspended_markets, sum(if($d.attributes['error.type'] != null, 1, 0)) as errors
AI assistants
527,137 rowsOne row per call made by the businesses’ AI assistants: model calls with tokens and cost, tool calls, guardrail checks.
ai.assistant_calls+
source spans | filter ($l.applicationName == 'goldspin-play' || $l.applicationName == 'coralogix-store' || $l.applicationName == 'coralogix-finance') && $d.tags['gen_ai.operation.name'] != null | choose $l.applicationName as app, $l.serviceName as assistant, $d.tags['gen_ai.operation.name'] as operation, $d.tags['gen_ai.agent.name'] as agent_name, $d.tags['gen_ai.request.model'] as model, firstNonNull($d.tags['gen_ai.request.user'], $d.tags['enduser.id'], $d.tags['user.id']) as user_id, $d.tags['gen_ai.conversation.id'] as conversation_id, $d.traceID as trace_id, $d.tags['otel.status_code'] as status, $m.duration:number / 1000 as duration_ms, $d.tags['gen_ai.usage.input_tokens']:number as input_tokens, $d.tags['gen_ai.usage.output_tokens']:number as output_tokens, $d.tags['gen_ai.prompt_price']:number as prompt_cost_usd, $d.tags['gen_ai.response_price']:number as response_cost_usd, $d.tags['gen_ai.response.finish_reasons'] as finish_reasons, $d.tags['gen_ai.tool.name'] as tool_name, $d.tags['error'] as tool_error, $d.tags['guardrails.triggered'] as guardrail_triggered, $d.tags['gen_ai.prompt.guardrails.pii.triggered'] as guardrail_pii_triggered, $d.tags['gen_ai.prompt.guardrails.prompt_injection.triggered'] as guardrail_injection_triggered, $d.tags['gen_ai.prompt.guardrails.toxicity.triggered'] as guardrail_toxicity_triggered, $d.tags['gen_ai.prompt.guardrails.custom.0.name'] as guardrail_policy_name, $d.tags['gen_ai.prompt.guardrails.custom.0.triggered'] as guardrail_policy_triggered, $d.tags['gen_ai.prompt.evaluations.custom.0.name'] as eval0_name, $d.tags['gen_ai.prompt.evaluations.custom.0.triggered'] as eval0_triggered, $d.tags['gen_ai.prompt.evaluations.custom.1.name'] as eval1_name, $d.tags['gen_ai.prompt.evaluations.custom.1.triggered'] as eval1_triggered
What is a dataset?
A dataset is a named collection of telemetry inside a dataspace, much like a table inside a database. Every account starts with logs and spans, and you can add your own in two ways. A TCO Optimizer policy routes matching logs into a streaming dataset as they arrive. A Background Query writes the results of a DataPrime query into a summary dataset, such as one row per order or one row per service per hour.
Each dataset keeps its own schema and access policy, sits in your own cloud object storage, and answers any DataPrime query that names it. An agent reading the finance platform’s per-client daily rollup scans 483 rows. The logs it was built from hold 1.5 million.
1.5M finance log records in one week
TCO Optimizer policy
Routes matching logs as they arrive
Background Query
Writes a DataPrime query’s results
logsBuilt inspansBuilt in<your dataset>Streamingfintech.client_daily Summary, 483 rowssource default/fintech.client_daily- Agents
- Dashboards
- Alerts
The datasets we built
We turned the demo telemetry into 12 summary datasets with Background Queries. Some flatten business events into one row per event. Others roll customers up by day and the platform up by hour. One holds every call made by the businesses’ AI assistants. Together they hold about 3 million rows, around 4% of the raw records they came from.
| Dataset | One row is | Rows |
|---|---|---|
gaming.wallet_events | One GoldSpin money event: a bet, deposit, withdrawal or jackpot | 1,041,991 |
ecommerce.order_events | One store event: a basket, order line, decline or lost order | 1,069,745 |
fintech.research_billing | One billing event: a query billed, a refund or a vendor cost | 54,870 |
gaming.player_daily | One player’s day: stake, winnings, deposits and withdrawals | 10,913 |
ecommerce.session_funnel | One shopping session, from first basket to order | 190,873 |
fintech.client_daily | One finance client’s day: queries, revenue, refunds and costs | 483 |
platform.service_latency_hourly | One operation’s hour of spans: count, errors and latency percentiles | 46,348 |
platform.http_requests_hourly | One gateway route and status code’s hour of requests | 5,057 |
platform.resource_pressure_hourly | One service’s hour of connection-pool and latency-budget pressure | 8,391 |
ops.error_rollup_hourly | One hour of warnings and errors for a service and error type | 22,918 |
gaming.odds_feed_hourly | One price-feed provider’s hour: stale prices and tick age | 671 |
ai.assistant_calls | One AI assistant span: a model call, tool call or guardrail check | 527,137 |
Three agents, the same 100 questions
All three ran the same GLM 5.3 model with the Coralogix CLI and the same instructions, and differed only in what they knew about the datasets. We checked every answer against a value computed from raw telemetry and replied No to each wrong one, with no hint. Each agent kept going until it was right, gave up or reached 45 minutes.
No Dataset
Raw logs and spans.
Discover Datasets
Told that datasets may exist, and given cx datasets list to see them with their descriptions. No names, no fields.
Datasets in system prompt
A catalog of all 12 datasets, with every field, in its system prompt.
25 questions in each tier, across gaming, ecommerce, finance, platform operations and AI assistants
| Tier | Kind of question | Example |
|---|---|---|
| Tier 1 | Lookups A single filtered total or count | What was the total value of jackpot wins paid out by GoldSpin Play between 30 October and 6 November 2026, in GBP? |
| Tier 2 | Rankings Group, rank and pick the top | At which step do Coralogix Store shoppers abandon the most baskets between 30 October and 6 November 2026, and what percentage of all abandoned baskets does that step account for? |
| Tier 3 | Multi-step analysis Ratios, rates and definitions to apply | What was Coralogix Finance's gross margin on research queries between 30 October and 6 November 2026, defined as (query revenue billed - credits refunded - inference costs - market-data costs) / query revenue billed? Give it as a percentage. |
| Tier 4 | Investigations Several signals, several answers | GoldSpin Play's bet placement feels slow. Using spans between 30 October and 6 November 2026: what was the p95 latency in milliseconds of the server-side PlaceBet operation in bet-service, which downstream call made by bet-service (client span operation) had the highest p95 latency, and what was that call's p95 in milliseconds? |
Findings
Datasets cut token use by 61% to 86%.
Agents limited to raw telemetry used a median of 798,000 tokens per question, against 108,000 with the dataset catalog in their system prompt. Agents that found the datasets for themselves used 313,000, a 61% cut.
Agents found the datasets on their own.
Told only how to list datasets, agents listed them within their first three commands in 97% of sessions and started with the dataset we expected for the question 95% of the time. Without field names, they read a few rows of a dataset before querying it in 93% of sessions, against 51% for agents with the catalog, and went back to raw telemetry in 54%, against 31%.
Share of sessions
Consistent reduction in tokens, tool calls and time
At every tier, from lookups to investigations, both agents with datasets used fewer tokens, fewer tool calls and less time than the agent limited to raw telemetry. With the catalog in the system prompt, tokens fell by 56% to 90%, tool calls by 47% to 84% and time by 39% to 81%. Investigations saw the smallest cuts, because many needed trace-level detail, such as which downstream call slowed a request, that an hourly rollup doesn’t hold.
Answers arrived in under a third of the time.
The median question took 10 minutes with raw telemetry alone, 6 minutes with discovery and under 3 minutes with the catalog in the system prompt. Tool calls fell in step, from 43 to 23 to 9.
Agents with datasets solved more questions.
Every agent solved at least 930 of its 940 question runs. Sessions that hit the 45-minute limit fell from 10 with raw telemetry alone to 2 with discovery and 1 with the catalog.
Methods and results
What we measured and how to read the results.
Summary results
The median is the middle result across 940 question runs per agent. Changes compare each agent’s median with the agent limited to raw telemetry. The 95% intervals are for the ratio of total tokens over paired runs.
| Measure | No Dataset | Discover Datasets | Datasets in system prompt |
|---|---|---|---|
| Tokens | 797,548 | 312,615 (−61%) | 107,790 (−86%) |
| Output tokens | 3,519 | 1,663 (−53%) | 810 (−77%) |
| Time to answer (seconds) | 599 | 347 (−42%) | 169 (−72%) |
| Model calls | 32 | 18 (−44%) | 9 (−72%) |
| Tool calls | 43 | 23 (−47%) | 9 (−79%) |
| Queries run | 33 | 16 (−52%) | 7 (−79%) |
| Queries with errors | 6 | 5 (−17%) | 3 (−50%) |
| Solved | 930 | 938 | 939 |
| Solved first time | 922 | 937 | 929 |
| Reached 45 minutes | 10 | 2 | 1 |
| Wrong answers given | 12 | 1 | 10 |
| Discover Datasets, total tokens against No Dataset | 0.45 (95% interval 0.41 to 0.49) | ||
| Datasets in system prompt, total tokens against No Dataset | 0.27 (95% interval 0.24 to 0.31) | ||
How we graded answers
We computed every expected answer from raw logs and spans, never from the datasets. An answer passed when it named the right entity and every number fell within 0.5% for money and counts, or 1% for percentages and averages.
A wrong answer got the reply No, with no hint. An agent could try again, give up, or keep working until it reached 45 minutes or eight wrong answers.
How we measured token use
Tokens are the input, output and reasoning tokens the model service reported for every model call in a session, including context repeated in later calls. The service reported no cached tokens. Each agent ran in its own isolated session with no memory of earlier runs.
For the 95% intervals, we resampled the 940 paired question runs 4,000 times and took the ratio of total tokens each time.
Run it yourself
About 1.85 billion tokens a runThe telemetry replay, the dataset builder, the agent harness and the scoring behind this page are on GitHub. You need a Coralogix account and an endpoint that serves GLM 5.3.
git clone https://github.com/coralogix/benchmark-run-yourself
cd benchmark-run-yourself/datasets-and-tokenomics
Open the guide on GitHub