English to SQL plus: 2 layers retrievals, 6 channel embedding. Not a simple Cosine I got tired of text-to-SQL tools that let the model emit raw SQL against a live DSN. L1 Dense cosine (plus exact/typo name-link) Schema names — tables, aliases, long columns L2 VectorPrism Schema chunks — 1024d tensor, six channels per chunk (dense core + relational + disentangled + hyperbolic + identity + causal). Query is encode_query → PSM search. Joins still only from declared join_paths.
If you’ve wired an internal agent to a warehouse, you know the loop: toy prompt works, then a slightly vague question invents a JOIN, remaps “tickets” onto the wrong table, or picks qty vs unit_amount. Green CI. Garbage query.
you can try with just logging in. free Sandbox on the compile API.
also we split the digits for params — “last 30 days” does not become $30. binds have to match the prompt. no guessing qty vs unit_amount.
also half of this is in a pip lib for getting wet. lol
that half is PrismSchema (Apache-2.0). DDL dump / .sql / local read-only Postgres or MySQL → JSON/YAML contract. it never talks to the compile API. never sends your DSN off-box.
pip install "prismschema==0.1.0"
https://github.com/insightitsGit...
other half is PrismSQL (hosted). upload the contract. model never writes SQL or ON. closed Query IR → compiler (windows, compares, ORDER BY on declared columns, JWT email as a bind, dialect printer). you get sql_template + params (%s). hosted rows always []. you run it. we never take a warehouse DSN.
if the prompt is honest-but-incomplete it stops. HTTP 422, status: clarify, candidates[] — e.g. line items over 5 when both qty and unit_amount exist. unknown tables refuse. not remapped.
Sandbox free (PostgreSQL). more dialects on paid plans. no published benches. compiler 1.6.5.
https://www.insightits.com/produ...https://www.insightits.com/docs/...
how are you stopping the model from writing the JOIN — allowlists, compile, or hoping the prompt holds?