Deep Query for AI agents. Faster, cheaper answers from your business data.
Deep Query gives employees' AI the counts and fields a question needs from synced business data, without calling the source system.
Querying synced records
list_s1query_queryable_fields SAP SuccessFactors user fields sapsuccessfactors_list_users_s1query 6,150 records → 6 averages Average base salary across 6,150 New York employees:
1 query · 6 averages · no provider API call · 4,708 tokens per run
Querying synced records
greenhouse_list_notes_s1query match_phrase "open to relocating to London" → 12 notes 12 candidates are open to relocating to London:
1 query · 12 of 200,000 notes · no provider API call · 4,949 tokens per run
Reading the synced employee record
sapsuccessfactors_list_users_s1query userId: mchen · 2 fields Omar Haddad, your manager, approves it. It's charged to cost center 4400.
Synced SAP SuccessFactors data · no provider API call
Companies already connected through StackOne
Deep Query use cases. Query any system of record
like a database.
Deep Query filters, counts, sums and groups synced records inside StackOne, so your agent gets totals, breakdowns and trends instead of the records behind them. Pick an example to compare it with the provider's own API.
Which 10 companies have the most open pipeline value?
Pipedrive deals 2,400 synced deals1,500 open10 organization totals
pipedrive_list_deals_s1query
{
"filter": {"term": {"status": "open"}},
"aggs": {
"by_organization": {
"terms": {"field": "org_id", "size": 10, "order": {"total": "desc"}},
"aggs": {"total": {"sum": {"field": "value"}}}
}
}
}pipedrive_list_organizations_s1query
{
"filter": {
"terms": {"id": [7002, 7001, 7004, 7020, 7003, 7033, 7019, 7009, 7005, 7015]}
},
"source": ["name", "id"]
}Then the agent sums value by org_id across the open deals itself, keeps the top 10 and asks for their names.
Kestrel Energy has the most open pipeline at $635,000, then Meridian Bank at $560,000.
One of 240 synced records
{
"id": 51000,
"title": "Cedar Logistics renewal",
"value": 2500,
"currency": "USD",
"status": "open",
"org_id": 7022,
"owner_id": 31,
"stage_id": 3,
"pipeline_id": 1,
"probability": 35,
"add_time": "2026-01-31T09:00:00Z",
"expected_close_date": "2027-01-02"
}One of 40 synced records
{
"id": 7001,
"name": "Meridian Bank",
"owner_id": 31,
"address": "100 Main Street, New York, NY",
"add_time": "2024-01-15T10:00:00Z"
}pipedrive_list_deals_s1queryFilter open deals, sum value for the top 10 organizations
{
"filter": {
"term": {
"status": "open"
}
},
"aggs": {
"by_organization": {
"terms": {
"field": "org_id",
"size": 10,
"order": {
"total": "desc"
}
},
"aggs": {
"total": {
"sum": {
"field": "value"
}
}
}
}
}
}pipedrive_list_organizations_s1queryLook up the 10 organizations by id
{
"filter": {
"terms": {
"id": [
7002,
7001,
7004,
7020,
7003,
7033,
7019,
7009,
7005,
7015
]
}
},
"source": [
"name",
"id"
]
}All results
| Kestrel Energy | $635,000 · 30 deals |
|---|---|
| Meridian Bank | $560,000 · 20 deals |
| Tidewater Shipping | $465,000 · 60 deals |
| Alder Pharma | $440,000 · 30 deals |
| Harbor Analytics | $360,000 · 90 deals |
| Nimbus Cloud | $345,000 · 50 deals |
| Zephyr Airlines | $320,000 · 40 deals |
| Redwood Capital | $315,000 · 20 deals |
| Pinnacle Insurance | $290,000 · 40 deals |
| Upland Software | $277,500 · 80 deals |
Returned by pipedrive_list_deals_s1query
[
{
"key": "7002",
"doc_count": 30,
"total": {
"value": 635000
}
},
{
"key": "7001",
"doc_count": 20,
"total": {
"value": 560000
}
},
{
"key": "7004",
"doc_count": 60,
"total": {
"value": 465000
}
},
{
"key": "7020",
"doc_count": 30,
"total": {
"value": 440000
}
},
{
"key": "7003",
"doc_count": 90,
"total": {
"value": 360000
}
},
{
"key": "7033",
"doc_count": 50,
"total": {
"value": 345000
}
},
{
"key": "7019",
"doc_count": 40,
"total": {
"value": 320000
}
},
{
"key": "7009",
"doc_count": 20,
"total": {
"value": 315000
}
},
{
"key": "7005",
"doc_count": 40,
"total": {
"value": 290000
}
},
{
"key": "7015",
"doc_count": 80,
"total": {
"value": 277500
}
}
]Returned by pipedrive_list_organizations_s1query
[
{
"name": "Meridian Bank",
"id": 7001
},
{
"name": "Kestrel Energy",
"id": 7002
},
{
"name": "Harbor Analytics",
"id": 7003
},
{
"name": "Tidewater Shipping",
"id": 7004
},
{
"name": "Pinnacle Insurance",
"id": 7005
},
{
"name": "Redwood Capital",
"id": 7009
},
{
"name": "Upland Software",
"id": 7015
},
{
"name": "Zephyr Airlines",
"id": 7019
},
{
"name": "Alder Pharma",
"id": 7020
},
{
"name": "Nimbus Cloud",
"id": 7033
}
]These examples run on fictional records. Their token counts, costs and times are modelled from the records each call returns. For measured results, see the Deep Query benchmark.
Deep Query benchmark. Half the tokens
on the same tasks.
On the same 1,345 benchmark tasks, agents with Deep Query used half the tokens. They also completed more of them, because fewer tool responses overflowed the agent's context.
Tokens used
Lower is better
Tasks completed
Higher is better
Truncated responses
Lower is better
Faster tool responses. Read synced data
without waiting on the source API.
Deep Query reads records already stored in StackOne, so your agent gets an answer even while a provider's API is slow or rate-limited.
A live lookup waits 0.2 to 12.7 seconds for the provider API to answer. Deep Query reads the synced records in about 0.2 seconds.
Hear it on a voice call
Every second an agent waits on a tool is a second of silence for the caller. Press play to hear the same question answered both ways: fetching 500 employees live takes 17 seconds at the median in production.
CallerHey, how many people do we have in the Berlin office right now?
sapsuccessfactors_list_users 17.2 s of waiting before the answer
sapsuccessfactors_list_users_s1query 0.11 s before the answer
Configure Data Sync. Set how often Data Sync
refreshes your records.
Choose which actions to sync and set a schedule for each one. Deep Query reads those stored records, so the schedule sets how fresh its results are.
Follow the Data Sync setup guide01Pick an actionOpen a Connector Profile and find a list action that supports sync.
PipedriveProfile · Sales agent
ActionType
List DealsRead
Get DealRead
List OrganizationsRead
Update DealWrite
02Enable Data SyncSelect the sync icon and switch Data Sync on for that action.
Data Sync· List DealsOptimize
Setup
Enable Data Sync
Preferences
03Set the scheduleChoose how often new and changed records sync, and how often a full re-sync runs.
Data Sync· List DealsOptimize
Setup
Enable Data Sync
Preferences
04SaveSave the profile to start syncing.
Data Sync· List DealsOptimize
Setup
Enable Data Sync
Preferences
05StackOne syncsStackOne pages through the provider API on your schedule and keeps the records current.
- Full sync2,400 records
- Incremental38 changed
- Incremental12 changed
06Your agent queriesThe action's query tool is ready over MCP to filter, search and aggregate.
How many open deals are in each pipeline stage?
pipedrive_list_deals_s1query1 query
filter: status open aggs: terms stage_id
1,500 open deals across 5 stages, 380 of them in stage 3.
Sync any list action, including your own.
An action declares Data Sync in its connector's YAML before anyone can turn it on. StackOne's connectors declare it for common records. In your own connector, you choose. Edit the block to see how it changes each sync run and the tool your agent gets.
Valid. The action offers Data Sync.
In the Connector Profile1
Data Sync can't be turned on while allowed is false.
Sync run2
- GET/workers?updated_after=2026-09-24T09:00:00Z100 · next=c_8f2a
- GET/workers?next=c_8f2a&updated_after=2026-09-24T09:00:00Z100 · next=c_90bd
- GET/workers?next=c_90bd&updated_after=2026-09-24T09:00:00Z37 · no next
- Done in 3 requests. Unchanged workers stay as they were.
What your agent gets3
hrportal_list_workers_s1query Filter, search, sort and count your synced workers, in about 0.2 seconds.
departmentstatuscountryjobTitlestartDateprobationEndDate
filtermatchsortaggssource
No query tool. The agent can only page through your system's live API.
Deep Query syntax. Filter, search and count
on any synced field.
Query tools take OpenSearch-style queries. Your agent looks up each synced field and its type first, then filters, searches and aggregates on it.
Filter
Search text
Aggregate
Shape the result
Deep Query FAQ. How Deep Query works
with your AI agent.
Get started with Deep Query.
Turn on Data Sync for one supported list action and ask your agent a counting question.