CShorten commited on
Commit
3067a6d
·
verified ·
1 Parent(s): bdb02ce

Delete README.md

Browse files
Files changed (1) hide show
  1. README.md +0 -302
README.md DELETED
@@ -1,302 +0,0 @@
1
- ---
2
- license: cc-by-4.0
3
- pretty_name: Query Agent Gym
4
- language:
5
- - en
6
- size_categories:
7
- - 10K<n<100K
8
- task_categories:
9
- - question-answering
10
- - table-question-answering
11
- tags:
12
- - weaviate
13
- - query-agent
14
- - function-calling
15
- - text-to-query
16
- - database
17
- - retrieval
18
- - agents
19
- - synthetic
20
- configs:
21
- - config_name: queries
22
- default: true
23
- data_files:
24
- - split: test
25
- path:
26
- - public-transit/queries.parquet
27
- - tattoo-studios/queries.parquet
28
- - nonprofits/queries.parquet
29
- - surf-schools/queries.parquet
30
- - childcare/queries.parquet
31
- - config_name: environments
32
- data_files:
33
- - split: test
34
- path: environments.parquet
35
- - config_name: public-transit_TransitRoutes
36
- data_files:
37
- - split: test
38
- path: public-transit/objects/TransitRoutes.parquet
39
- - config_name: public-transit_RidershipReports
40
- data_files:
41
- - split: test
42
- path: public-transit/objects/RidershipReports.parquet
43
- - config_name: tattoo-studios_TattooArtists
44
- data_files:
45
- - split: test
46
- path: tattoo-studios/objects/TattooArtists.parquet
47
- - config_name: tattoo-studios_TattooDesigns
48
- data_files:
49
- - split: test
50
- path: tattoo-studios/objects/TattooDesigns.parquet
51
- - config_name: nonprofits_Charities
52
- data_files:
53
- - split: test
54
- path: nonprofits/objects/Charities.parquet
55
- - config_name: nonprofits_Campaigns
56
- data_files:
57
- - split: test
58
- path: nonprofits/objects/Campaigns.parquet
59
- - config_name: nonprofits_GivingPrograms
60
- data_files:
61
- - split: test
62
- path: nonprofits/objects/GivingPrograms.parquet
63
- - config_name: nonprofits_Donations
64
- data_files:
65
- - split: test
66
- path: nonprofits/objects/Donations.parquet
67
- - config_name: surf-schools_SurfBeaches
68
- data_files:
69
- - split: test
70
- path: surf-schools/objects/SurfBeaches.parquet
71
- - config_name: surf-schools_SurfInstructors
72
- data_files:
73
- - split: test
74
- path: surf-schools/objects/SurfInstructors.parquet
75
- - config_name: surf-schools_LessonPrograms
76
- data_files:
77
- - split: test
78
- path: surf-schools/objects/LessonPrograms.parquet
79
- - config_name: surf-schools_SurfEquipment
80
- data_files:
81
- - split: test
82
- path: surf-schools/objects/SurfEquipment.parquet
83
- - config_name: childcare_DaycareCenters
84
- data_files:
85
- - split: test
86
- path: childcare/objects/DaycareCenters.parquet
87
- - config_name: childcare_ChildcareStaff
88
- data_files:
89
- - split: test
90
- path: childcare/objects/ChildcareStaff.parquet
91
- - config_name: childcare_ChildEnrollments
92
- data_files:
93
- - split: test
94
- path: childcare/objects/ChildEnrollments.parquet
95
- ---
96
-
97
- # Query Agent Gym
98
-
99
- Query Agent Gym is a set of procedurally generated database environments and
100
- natural-language queries with exactly known ground-truth queries.
101
-
102
- This release holds five **held-out test environments**:
103
- 15 collections with 1,000 objects each (15,000 objects, 18,000 searchable
104
- documents) and 250 queries, 50 per environment. Every entity, name, and
105
- document is synthetic.
106
-
107
- | Environment | Collections (kind) | Objects | Queries |
108
- |---|---|---:|---:|
109
- | Public Transit | TransitRoutes (knowledge_base), RidershipReports (transactional) | 2,000 | 50 |
110
- | Tattoo Studios | TattooArtists, TattooDesigns (knowledge_base) | 2,000 | 50 |
111
- | Nonprofits | Charities, Campaigns, GivingPrograms (knowledge_base), Donations (transactional) | 4,000 | 50 |
112
- | Surf Schools | SurfBeaches, SurfInstructors, LessonPrograms, SurfEquipment (knowledge_base) | 4,000 | 50 |
113
- | Childcare | DaycareCenters, ChildcareStaff (knowledge_base), ChildEnrollments (transactional) | 3,000 | 50 |
114
-
115
- ## Quick start
116
-
117
- ```python
118
- from datasets import load_dataset
119
- import json
120
-
121
- queries = load_dataset("weaviate/query-agent-gym", "queries", split="test")
122
- surf = queries.filter(lambda r: r["environment"] == "surf-schools")
123
- q = queries[0]
124
- print(q["command"]) # the natural-language request
125
- print(q["ground_truth_sql"]) # readable ground truth, one entry per sub-query
126
- plan = json.loads(q["ground_truth"]) # exact ground truth (query_database arguments)
127
-
128
- routes = load_dataset("weaviate/query-agent-gym", "public-transit_TransitRoutes", split="test")
129
- ```
130
-
131
- ## Layout
132
-
133
- Each environment has its own folder.
134
-
135
- ```
136
- environments.parquet one row per environment
137
- <environment>/schema.json the schema exactly as generated
138
- <environment>/queries.parquet the environment's 50 queries
139
- <environment>/objects/<Collection>.parquet 1,000 objects per collection
140
- ```
141
-
142
- | Config | Rows | Contents |
143
- |---|---:|---|
144
- | `queries` (default) | 250 | All five environments' queries, with an `environment` column |
145
- | `environments` | 5 | One row per environment |
146
- | `<environment>_<Collection>` | 1,000 each | The objects of one collection, one typed column per property |
147
-
148
- To work with one environment, filter the `queries` config on `environment`,
149
- or read `<environment>/queries.parquet` directly.
150
-
151
- ### `queries`
152
-
153
- | Field | Type | Description |
154
- |---|---|---|
155
- | `query_id` | string | e.g. `public-transit-013` |
156
- | `environment` | string | Environment id, e.g. `public-transit` |
157
- | `environment_name` | string | e.g. `Public Transit` |
158
- | `command` | string | The natural-language request given to the agent |
159
- | `phrasing` | string | `explicit` (names properties and values plainly) or `conversational` (a scenario, with values still verbatim) |
160
- | `plan` | string | The operators of the plan, sub-queries separated by `;` |
161
- | `num_sub_queries` | int | 1 to 3. Sub-queries are independent, never multi-hop |
162
- | `operator_classes` | list of strings | Operator classes the plan features (search, each filter kind, each aggregation kind, group-by, multi-query) |
163
- | `ground_truth` | string (JSON) | List of `query_database` argument objects, one per sub-query (format below) |
164
- | `ground_truth_sql` | list of strings | A SQL-like rendering of each sub-query, for reading only |
165
- | `search_grounds` | list of structs | For each sub-query with a search, its relevance-labeled result set (below) |
166
- | `reference_results` | string (JSON) | Each sub-query's ground truth executed on the objects (below) |
167
-
168
- ### Objects
169
-
170
- Each `<environment>_<Collection>` config has a `uuid` column followed by one
171
- column per property, in schema order. The `uuid` is the object's id and is
172
- what `search_grounds` and `reference_results` refer to. Property types map to
173
- columns and to Weaviate data types as follows.
174
-
175
- | Property type | Column type | Weaviate data type |
176
- |---|---|---|
177
- | `searchable_text` | string | `text` (the prose a search should match) |
178
- | `filterable_text` | string | `text` (identifiers, references, categories) |
179
- | `int` / `number` | int64 / float64 | `int` / `number` |
180
- | `boolean` | bool | `boolean` |
181
- | `date` | string, `YYYY-MM-DD` | `date` (send as RFC 3339, e.g. `2025-11-16T00:00:00Z`) |
182
- | `text_array`, `int_array`, `number_array`, `boolean_array`, `date_array` | list | `text[]`, `int[]`, `number[]`, `boolean[]`, `date[]` |
183
-
184
- Each collection has exactly one identifier property (`is_identifier` in
185
- `schema.json`): an invented, unique name in a `knowledge_base` collection, a
186
- code in a `transactional` one. A `transactional` collection's reference
187
- properties (`references` in `schema.json`) hold the identifier of a
188
- `knowledge_base` record,
189
- stored directly in the row, so no query needs a join. No value is null.
190
-
191
- ## Ground truth format
192
-
193
- A ground truth is a list of sub-queries, each a `query_database` function-call
194
- argument object.
195
-
196
- ```json
197
- [{"collection_name": "TransitRoutes",
198
- "search_query": "observatory and weather access",
199
- "numeric_array_property_filters": [
200
- {"property_name": "stopSequenceNumbers", "operator": "CONTAINS_ALL", "values": [1, 8]}]}]
201
- ```
202
-
203
- | Argument | Items | Operators or metrics |
204
- |---|---|---|
205
- | `collection_name` | | The target collection |
206
- | `search_query` | string | A relevance search over the collection's searchable text |
207
- | `text_property_filters` | `property_name`, `operator`, `value` | `=`, `LIKE` (pattern uses `%`, e.g. `Nerith%`) |
208
- | `numeric_property_filters` | `property_name`, `operator`, `value` | `=`, `<`, `>`, `<=`, `>=` |
209
- | `date_property_filters` | `property_name`, `operator`, `value` (ISO date) | `=`, `<`, `>`, `<=`, `>=` |
210
- | `boolean_property_filters` | `property_name`, `operator`, `value` | `=`, `!=` |
211
- | `array_property_filters` (text arrays), `numeric_array_property_filters`, `boolean_array_property_filters`, `date_array_property_filters` | `property_name`, `operator`, `values` | `CONTAINS_ANY`, `CONTAINS_ALL` |
212
- | `numeric_property_aggregations` | `property_name`, `metric` | `COUNT`, `MIN`, `MAX`, `MEAN`, `MEDIAN`, `MODE`, `SUM` |
213
- | `text_property_aggregations` | `property_name`, `metric`, `top_occurrences_limit` | `COUNT`, `COUNT_DISTINCT`, `TOP_OCCURRENCES` |
214
- | `boolean_property_aggregations` | `property_name`, `metric` | `COUNT`, `TOTAL_TRUE`, `TOTAL_FALSE`, `PERCENTAGE_TRUE`, `PERCENTAGE_FALSE` |
215
- | `date_property_aggregations` | `property_name`, `metric` | `COUNT`, `EARLIEST`, `LATEST` |
216
- | `groupby_property` | string | Groups every aggregation of the sub-query |
217
-
218
- All filters in a sub-query are combined with AND. A sub-query without
219
- aggregations retrieves records, and one with aggregations returns only the
220
- statistics.
221
-
222
- **Searches.** The words of `search_query` are one valid phrasing and are not
223
- the target. A search sub-query's correct result is its labeled set:
224
- `search_grounds[i].candidate_ids` are the records the sub-query's filters
225
- select (R), and `relevant_ids` are the records a language model labeled
226
- relevant to the topic after reading every document in R (S). The `topic` and
227
- `description` fields say what the search is about.
228
-
229
- **Reference results.** `reference_results[i]` is sub-query `i` executed on the
230
- objects, with a search resolving to its `relevant_ids`. A retrieval is a sorted
231
- list of uuids, an aggregation is `{"METRIC(property)": value}`, and a group-by
232
- maps each group value (as a string) to its aggregations. Percentages are on a
233
- 0 to 100 scale, and `TOP_OCCURRENCES` is a list of `[value, count]` pairs.
234
- Ties in `MODE` and `TOP_OCCURRENCES` are broken deterministically, which a
235
- database may break differently.
236
-
237
- ## Evaluation
238
-
239
- The blog post evaluates agents with **Exact Match** over the plan. The
240
- predicted and ground-truth plans are canonicalized and matched sub-query to
241
- sub-query. The collection, every filter with its operator and value, every
242
- aggregation with its metric and property, and the group-by must agree, and
243
- extra sub-queries or statistics count as errors. A search must be present on
244
- the right collection, but its words are not compared. A few re-expressions
245
- that return the same answer on the data are accepted, such as a per-group
246
- count of any populated single-valued property, or a date bound that excludes
247
- no record. Answer-level comparison against `reference_results` is a looser
248
- alternative.
249
-
250
- To reproduce the setup, create one Weaviate collection per objects config with
251
- the data types above and a text vectorizer (the study used
252
- `text2vec_weaviate` with hybrid search), use each row's `uuid` as the object
253
- id, and point the agent at an environment's collections. Uploading each run
254
- under a fresh collection name avoids agents reusing statistics cached from an
255
- earlier run.
256
-
257
- ### Reference results
258
-
259
- The Weaviate Query Agent, run once on the 250 queries with the same code and
260
- filter statistics, before and after a prompt revision made from failures on
261
- separate training environments (not released).
262
-
263
- | Environment | Before revision | After revision |
264
- |---|---:|---:|
265
- | Public Transit | 40/50 | 49/50 |
266
- | Tattoo Studios | 34/50 | 47/50 |
267
- | Nonprofits | 34/50 | 48/50 |
268
- | Surf Schools | 40/50 | 50/50 |
269
- | Childcare | 36/50 | 45/50 |
270
- | **Total** | **184/250 (73.6%)** | **239/250 (95.6%)** |
271
-
272
- ## How the data was made
273
-
274
- Each environment is a position in a seeded order over 200 domain briefs (seed
275
- 380, positions 5 to 9). Its structure is sampled procedurally: the number and
276
- kind of collections, property types, references, and each query's operator
277
- plan. Language models write the surface: the schema design (GPT-6 Sol),
278
- record names and documents (GPT-6 Luna), search topics and their relevance
279
- labels, and the natural-language commands (GPT-5.6 Luna). Ground truths are
280
- grounded in the saved objects and every command passes mechanical checks and
281
- a faithfulness verifier, so the plan can be recovered from the words. Each set
282
- of 50 queries is selected from a pool of 200 sampled plans so that every
283
- operator class appears at least 3 times, which makes the sets balanced across
284
- operators rather than distributed like natural traffic. A seeded coin chose
285
- each command's phrasing, giving 113 explicit and 137 conversational commands.
286
-
287
- ## Limitations
288
-
289
- - All data is synthetic and English only. Entities are invented, so an agent
290
- cannot answer from world knowledge, and documents are written as a real
291
- system of record would write them.
292
- - Values are drawn independently, so a record can combine values that would
293
- rarely co-occur in reality (a fin set tagged for zipper care). Documents are
294
- written to stay consistent with each record's values.
295
- - Public Transit has no group-by queries. Its only groupable properties are
296
- references with over 400 distinct values, which yield degenerate groups.
297
- - Relevance labels for searches come from a language model reading each
298
- candidate document, not from human annotation.
299
- - Search topics can repeat a theme within an environment, and two Tattoo
300
- Studios design searches share the phrase "melting snow".
301
- - The query sets exclude what the Weaviate Query Agent cannot express, such as
302
- aggregating over the results of a semantic search.