Retrieval
What is a retrieval UDF?
A retrieval UDF packages a similarity query so an agent or another column can call retrieval as a function.
Updated · Part of What is RAG?
How it works
- The function names the query, the limit, and the columns to return.
- Callers pass a question and get rows.
- Agents can see it as a tool because it is a function, not an ad-hoc script.
What it is not
It is not raw SQL pasted into a prompt, and it is not a retriever object with no table underneath.
retrieval UDF: this, and the thing it is confused with
| This | Not this | |
|---|---|---|
| Interface | A function | A SQL string in the prompt |
| Data | Rows of a real table or view | A vector client with no source schema |
| Reuse | HTTP, agents, and other columns | Copy-pasted into each handler |
Where Pixeltable fits
Pixeltable uses @pxt.query for that function. pxt.tools() can expose it to an agent.
Questions
- How does retrieval UDF work?
- The function names the query, the limit, and the columns to return. Callers pass a question and get rows. Agents can see it as a tool because it is a function, not an ad-hoc script.
- What is retrieval UDF often confused with?
- It is not raw SQL pasted into a prompt, and it is not a retriever object with no table underneath.