Files
stack/tests/llm/test_migrate.py
kert 26f01bd0ba
Some checks failed
CI / lint (push) Successful in 58s
CI / notebooks-smoke (push) Successful in 1m48s
Deploy / notebooks (push) Has been skipped
Deploy / zotero (push) Has been skipped
CI / test (push) Failing after 2m58s
Deploy / docs (push) Has been skipped
Deploy / api (push) Has been skipped
Deploy / llm (push) Has been skipped
Deploy / mc (push) Has been skipped
Infra CI / zotero (push) Successful in 25s
Infra CI / notebooks (push) Successful in 58s
Infra CI / docs (push) Successful in 1m32s
Infra CI / api (push) Successful in 1m11s
Infra CI / mc (push) Failing after 41s
Infra CI / llm (push) Successful in 1m9s
Deploy / report (push) Successful in 19s
fix(llm): filtered vector search returns results — hnsw.iterative_scan = relaxed_order on every connection and at the database level
pgvector's HNSW scan collects ef_search (40) nearest candidates and
only then applies the WHERE clause, so a selective metadata filter
(one theme inside one doctype; one docket's comments) could drop every
candidate and answer nothing. pgvector 0.8's iterative scan keeps
walking the graph until the LIMIT is met. The engine now SETs
hnsw.iterative_scan = relaxed_order on each pooled connection (a
placeholder SET needs no privilege) and PGVector is handed that engine
instead of a URL so its sessions inherit it; migrate() also tries
ALTER DATABASE (best effort — the llm role may not; applied once as
the superuser on the live database).
2026-09-24 20:07:38 -04:00

4.2 KiB