Cortex Mock DuckDB Extension
January 27, 2026 ยท View on GitHub
This extension provides lightweight, deterministic mock implementations of Snowflake Cortex-style
AI functions (e.g. AI_COMPLETE, AI_EMBED) for use in local DuckDB-based testing.
Functions
| Function | Signature(s) | Description |
|---|---|---|
ai_complete | ai_complete(prompt) / ai_complete(model, prompt) | Returns a deterministic mock completion string. |
ai_summarize | ai_summarize(text) | Returns a shortened mock summary (first 80 chars). |
ai_translate | ai_translate(text, language) | Returns a tagged mock translation string. |
ai_extract | ai_extract(text, instruction) | Returns a tagged mock extraction string. |
ai_embed | ai_embed(text) | Returns a deterministic list of 8 doubles derived from a hash. |
ai_classify | ai_classify(text, labels) | Returns a tagged mock classification using the first label. |
Build (DuckDB extension template)
This folder is structured to align with the DuckDB extension template: https://github.com/duckdb/extension-template/
To build:
- Clone the DuckDB extension template and replace its
srcandCMakeLists.txtwith the files in this directory. - Follow the template build steps to compile and load the extension into DuckDB.
These mocks are intended for local testing, not production usage.