Semantic search using DuckDB native vector functions.
Returns table of (id, text, similarity, distance) tuples.
Pre-filters via vector similarity, can be combined with LLM operators.
SQL Usage:
-- Explicit form (DuckDB):
SELECT * FROM read_json_auto(vector_search_json_3('eco-friendly products', 'products', 10));
SELECT * FROM read_json_auto(vector_search_json_4('query', 'table', 10, 0.7)); -- with threshold
Performance:
- Vector search uses DuckDB native vector functions
- No LLM calls (pure vector similarity)
- Results cached by query hash
Hybrid Pattern (Vector + LLM):
WITH takes AS (
SELECT * FROM VECTOR_SEARCH('eco products', 'products', 100)
)
SELECT *
FROM takes c
JOIN products p ON p.id = c.id
WHERE p.description MEANS 'eco-friendly AND affordable'
ORDER BY c.similarity DESC;
Semantic search using DuckDB native vector functions.
Returns table of (id, text, similarity, distance) tuples.
Pre-filters via vector similarity, can be combined with LLM operators.
SQL Usage:
-- Explicit form (DuckDB):
SELECT * FROM read_json_auto(vector_search_json_3('eco-friendly products', 'products', 10));
SELECT * FROM read_json_auto(vector_search_json_4('query', 'table', 10, 0.7)); -- with threshold
Performance:
- Vector search uses DuckDB native vector functions
- No LLM calls (pure vector similarity)
- Results cached by query hash
Hybrid Pattern (Vector + LLM):
WITH takes AS (
SELECT * FROM VECTOR_SEARCH('eco products', 'products', 100)
)
SELECT *
FROM takes c
JOIN products p ON p.id = c.id
WHERE p.description MEANS 'eco-friendly AND affordable'
ORDER BY c.similarity DESC;