Skip to main content

SQAI (Structured Query AI) — the deterministic, read-only structured-data SDK for AI agents, with full provenance.

Project description

sqai

SQAI (Structured Query AI) — the deterministic, read-only structured-data SDK for AI agents, with full provenance. Python twin of @thyn-ai/sqai: same vocabulary, same error codes, same golden numbers, byte-identical cross-language hashes.

from sqai import create_sqai

sq = create_sqai()  # zero-config: SQAI_DEPLOYMENT_URL -> private deployment, else local
sq.connect([
    {"region": "east", "revenue": 1200.50},
    {"region": "west", "revenue": 900.25},
    {"region": "east", "revenue": 930.00},
], name="sales")

# Query plane — in-process, no key
outcome = sq.ask({"metric": "revenue", "aggregation": "sum",
                  "group_by": "region", "source_name": "sales"})

# Compute plane — one of 4,778 read-only capabilities; same value + hashes as TypeScript
# Requires a free SQAI login first: `sqai login`
result = sq.compute(module="finance", function="npv", args=[0.1, [-1000, 300, 420, 560, 680]])
print(result["value"], result["computation_hash"])
# 505.020148896933 b74f67d0d7a594aa7ac91f6291612452aa8ccdf603351ebc8d801a6fddd91bc8
  • Query planeconnect / resolve / query / verify / ask, in-process, no daemon or key.
  • Compute plane — validated against the embedded capability contract, dispatched to the managed runtime (it provisions once, then stays warm — no per-query cold start); results pass through verbatim with a determinism envelope (invocation_hash before execution, computation_hash after).
  • Policy — allow-lists for sources, fields, and functions; the surface is read-only deterministic capabilities, and policy can only narrow it.
  • Errors — engine codes pass through verbatim (source="engine"); SQAI codes share the same snake_case vocabulary (source="sqai"). Messages never leak absolute paths.

The unsafe escape hatch (from sqai.unsafe import get_unsafe_runtime) bypasses every guarantee above and is deliberately not exported from the package root.

Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sqai-0.1.8.tar.gz (278.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sqai-0.1.8-py3-none-any.whl (278.3 kB view details)

Uploaded Python 3

File details

Details for the file sqai-0.1.8.tar.gz.

File metadata

  • Download URL: sqai-0.1.8.tar.gz
  • Upload date:
  • Size: 278.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for sqai-0.1.8.tar.gz
Algorithm Hash digest
SHA256 1470482112b95c8a2411733a09e97269086454eb464bce29d6110546d2b2c4d0
MD5 2604c81d28a8a8ae57acdf194ff61408
BLAKE2b-256 c1049c554cc351c40f201c81764c4c2fed6f1170f9219b0ca8a8ccb369a545c7

See more details on using hashes here.

File details

Details for the file sqai-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: sqai-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 278.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for sqai-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a4870f8e612d8bbbe90f6759f4495e43547e50b24cde6d5f447bbaffd210e94d
MD5 df8d84c8685091abb5f471cec8dbe9a2
BLAKE2b-256 6710d5c81b79e14c1bf2d8ab14b7f2c7780e818db8ac1b11d0a211d21d2f1aea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page