Skip to content

About

A VGI worker exposing TypeSafe System One questions (choice, noul, score) to DuckDB/SQL as LATERAL-joinable table functions

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Repository files navigation

Query.Farm

vgi-typesafe

CI Latest release Documentation on Orchard License: MIT vgi worker: query.farm

vgi-typesafe · a VGI worker by Query.Farm

TypeSafe System One questions — choice, noul and score — as DuckDB table functions you can LATERAL join against.

Documentation and hosting on Orchard: every function and table with runnable examples; run it yourself or let Query.Farm host it

Quick start

SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

ATTACH 'typesafe' AS typesafe (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-typesafe'
);

-- The result columns are built from the `questions` argument at bind time —
-- one typed STRUCT per question, then `usage`. DESCRIBE only binds, so this
-- runs without an API key and issues no request.
DESCRIBE SELECT *
FROM typesafe.main.ask(
  'a lost package',
  questions => {'dept': {'type': 'choice',
  'instructions': 'Which team?',
  'criteria': {'shipping': 'Delays and lost packages',
  'billing': 'Invoices'}},
  'urgent': {'type': 'noul',
  'instructions': 'Does this need a reply today?'}}
);

-- Route, flag and grade every row in one request each
SELECT t.id, a.dept.choice, a.urgent.noul
FROM (VALUES (1, 'My package is lost')) t(id, body),
     LATERAL typesafe.main.ask(
       t.body,
       questions => {'dept': {'type': 'choice',
       'instructions': 'Which team?',
       'criteria': {'shipping': 'Lost packages',
       'billing': 'Invoices'}},
       'urgent': {'type': 'noul',
       'instructions': 'Needs a reply today?'}}
     ) a;

-- Classify one text column with the single-question shorthand
SELECT choice, confidence
FROM typesafe.main.choice(
  'I was charged twice',
  instructions => 'Which team should handle this?',
  criteria => MAP {'shipping': 'Lost packages',
  'billing': 'Invoices'}
);

Documentation

  • Orchard: vgi-typesafe: every function and table, with examples you can run, and setup for each way to run the worker (release binary, signed Docker image, or your own server).
  • Catalog reference: the full list of functions and tables with their arguments and columns.
  • Executed notebooks: worked analyses using the published worker.
  • What is VGI?: the protocol that connects workers like this one to DuckDB.

VGI: Vector Gateway Interface

Development

make check   # everything CI runs: lint, unit tests, SQL tests, metadata lint

License

MIT, see LICENSE. Written by Query.Farm.

Copyright 2026 Query Farm LLC - https://query.farm

About

A VGI worker exposing TypeSafe System One questions (choice, noul, score) to DuckDB/SQL as LATERAL-joinable table functions

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages