A Query Engine for the Agents

📅 2026-05-26
📈 Citations: 0
Influential: 0
📄 PDF

career value

204K/year
🤖 AI Summary
Existing SQL systems struggle to efficiently query unstructured text data—such as agent trajectories and chat logs—and conventional data lake solutions cannot be lightweightly integrated into client-side JavaScript environments. This work proposes Squirreling, the first embedded query engine designed for AI-native client applications, which natively supports direct reads of Parquet and Apache Iceberg formats and interleaves asynchronous LLM-based user-defined functions with analytical SQL execution. Built atop three open-source JavaScript libraries totaling less than 70 KB, Squirreling achieves up to 300× speedup over DuckDB-WASM on filter-limited queries and 192× on sort-limited queries, while completing a ten-task agent analytics benchmark suite at two-thirds the computational cost, substantially reducing both latency and resource overhead.
📝 Abstract
The fastest-growing data in production today is unstructured text: agent traces, chat logs, reasoning chains, model outputs. People want to analyze it, and the questions worth asking ("show me where the agent got confused") cannot be answered by SQL alone, since text is not queryable without a model in the query path. The natural place this analysis is happening is the new class of AI applications (Claude Code, Cursor, Claude Desktop, in-browser agents) that run client-side and host both a human user and an LLM agent in the same process. These applications increasingly want to work with data, but the lakehouse read path has been hard to use from a JS runtime: Spark, Trino, and managed warehouses do not fit there. To build this new kind of AI data application, three properties of the engine become first-order: a JS-native distribution that drops into the runtime the application already runs in, a bundle small enough to ship inside a cold tab or per-turn agent sandbox, and a way to interleave analytic operators with model-based interpretation of text. We present Hyperparam, three open-source JavaScript libraries (Hyparquet, Squirreling, Icebird) totaling under 70 KB, that read Parquet and Apache Iceberg directly from object storage and meet the third property with per-cell, async-native SQL execution, so expensive cells fire only when downstream operators demand them. Squirreling runs LLM-shaped async UDFs over 300x faster than DuckDB-WASM on filter-bounded queries (and 192x on sort-bounded queries) and completes a ten-task agent analyst suite at two-thirds lower cost. We argue that data engineering as a discipline needs to update for the AI-native client applications now in production and the agents that work alongside their users.
Problem

Research questions and friction points this paper is trying to address.

unstructured text
query engine
AI agents
JavaScript runtime
data analysis
Innovation

Methods, ideas, or system contributions that make the work stand out.

AI-native query engine
JavaScript runtime
async SQL execution
LLM-integrated analytics
client-side data processing