Memelang: An Axial Grammar for LLM-Generated Vector-Relational Queries
Bri Holt

TL;DR
This paper introduces Memelang, a novel axial grammar-based language for LLM-generated vector-relational queries, enabling deterministic, compact, and structured IRs for database querying.
Contribution
It presents axial grammar as a new linear token sequence method for recovering multi-dimensional structure, and instantiates it in Memelang, a compact, LLM-emittable query language with advanced referencing and grouping features.
Findings
Supports deterministic parsing without parentheses
Enables direct mapping to SQL with PostgreSQL compatibility
Reduces repetition in LLM-generated queries
Abstract
Structured generation for LLM tool use highlights the value of compact DSL intermediate representations (IRs) that can be emitted directly and parsed deterministically. This paper introduces axial grammar: linear token sequences that recover multi-dimensional structure from the placement of rank-specific separator tokens. A single left-to-right pass assigns each token a coordinate in an n-dimensional grid, enabling deterministic parsing without parentheses or clause-heavy surface syntax. This grammar is instantiated in Memelang, a compact query language intended as an LLM-emittable IR whose fixed coordinate roles map directly to table/column/value slots. Memelang supports coordinate-stable relative references, parse-time variable binding, and implicit context carry-forward to reduce repetition in LLM-produced queries. It also encodes grouping, aggregation, and ordering via inline tags…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsModel-Driven Software Engineering Techniques · Semantic Web and Ontologies · Digital Humanities and Scholarship
