Octopus stores and reuses ai judgments to speed semantic database queries
OCTOPUS: Towards A Tag Model for Cross-Query Reuse in Semantic Query Processing
Databases
Summary
Semantic queries let computers answer questions about complex, varied data using AI models, but current systems usually forget the AI's answers after each query, making repeat questions costly. The authors propose a tag model that saves these AI judgments as regular data inside the database, so later queries can reuse them without extra AI calls. Their system, OCTOPUS, connects to existing databases and reduces AI processing dramatically, making querying faster and consistent. This approach also allows the database to grow smarter based on the questions users ask.
What this means in practice
- •For database engineers: Optimize semantic query performance by storing and reusing AI model results as data within relational databases.
- •For enterprise analytics teams: Maintain consistent, auditable AI-derived insights across multiple queries in business intelligence systems.
Authors
GuangXue Zhang, Nada Lahjouji, Yiming Lin, Ashwin Colaco, Sharad Mehrotra
Abstract
Large language models make it possible to pose semantic questions over diverse, multi-modal data. Recent systems give such workloads the declarative feel of a database through semantic operators: relational operators whose conditions a model judges. Most of them now run on a relational engine, yet almost none keeps what the model says past the query: every judgment is discarded on completion and paid for again the next time a query needs it. We present the tag model and tag operators, the right unit for semantic processing, and OCTOPUS, a prototype built as a middleware over DBMS. Two mechanisms are central. First, the tag: each semantic answer a model produces is written back to the relation as data, which the database engine filters, indexes, and stores as it would any other. Second, the tag operator: the unit into which common semantic operators are translated, which fixes the granularity of reuse. A model judges a tuple once, and later queries reuse that judgment as data: through relationships between predicates, a stored judgment can accept a tuple for a later predicate, eliminate one that cannot satisfy it, simplify its test, or order the search of a query that stops early. On the movie scenario of SemBench, our prototype sends the model 10 to 108x fewer rows than iPDB, ThalamusDB, Palimpzest, and LOTUS at broadly competitive quality, and three of its eight queries issue no model call at all. More broadly, a database that keeps its judgments lets its schema grow from the questions its users ask, so that each semantic answer is paid for once, stays consistent across queries, and can be audited through its provenance.