Skip to content

[codex] Expose query type filters#2191

Draft
TheLordArgus wants to merge 1 commit into
garrytan:masterfrom
TheLordArgus:codex/expose-query-type-filter
Draft

[codex] Expose query type filters#2191
TheLordArgus wants to merge 1 commit into
garrytan:masterfrom
TheLordArgus:codex/expose-query-type-filter

Conversation

@TheLordArgus

Copy link
Copy Markdown

Summary

Exposes the existing SearchOpts.types filter on the public query operation so MCP/remote callers can request evidence-only or type-scoped retrieval directly.

Root Cause

The lower search layer already supports page-type filtering, but the public query op schema did not accept or thread a types parameter. Remote agents therefore had to retrieve all page types and filter client-side, which is both noisier and less reliable for evidence-only temporal retrieval.

Impact

Callers can now ask for queries such as types: ["source", "conversation"] and avoid mixing raw evidence with derived pages when they need source-grounded answers. The same filter is threaded through the text and image/vector query paths.

Changes

  • Add types to the public query operation params.
  • Validate it as a string array and pass it into hybridSearch / vector search options.
  • Add a PGLite e2e regression proving a source page is returned while a same-keyword derived company page is excluded.

Validation

  • bun test test/e2e/source-isolation-pglite.test.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant