Skip to content

fix(knowledge): bound KB block vector retrieval - #7903

Merged
icecrasher321 merged 2 commits into
stagingfrom
codex/fix-kb-block-vector-search
Sep 17, 2026
Merged

icecrasher321 merged 2 commits into
stagingfrom
codex/fix-kb-block-vector-search

Conversation

@icecrasher321

@icecrasher321 icecrasher321 commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Bound exact vector ranking for small KB scopes, preserving document access and tag filters; retain ANN retrieval for larger scopes.
  • Apply the shared retrieval deadline to KB block queries, including connection waits and SQL execution.
  • Add timeout regressions and real PostgreSQL coverage for concurrent API-key KB searches, and run the integration coverage in CI.

Type of Change

  • Bug fix

Testing

  • Knowledge search, application, and API unit tests: 254 passed.
  • Disposable PostgreSQL integration tests: 22 passed.
  • App type-check, lint, block registry check, repository audits, and docs manifest check passed.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 17, 2026 12:49am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no new actionable issue was found in the changes since the previous review.

Summary

This PR bounds knowledge-base vector retrieval while preserving access and tag filtering.

  • Probes up to 201 embedding identities and uses exact ranking for scopes containing at most 200 candidates.
  • Retains HNSW approximate retrieval for larger scopes.
  • Applies the shared retrieval deadline to connection acquisition and SQL execution.
  • Adds unit and PostgreSQL integration coverage for timeouts, concurrent API-key searches, access control, and ranking behavior.
  • Adds the new PostgreSQL integration suite to CI.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[KB vector search] --> B[Probe up to 201 candidate IDs]
  B --> C{Retrieval deadline exceeded?}
  C -->|Yes| D[Return partial retrieval]
  C -->|No| E{Candidate count}
  E -->|0| F[Return no rows]
  E -->|1-200| G[Exact vector ranking]
  E -->|201| H[HNSW ANN ranking over full scope]
  G --> I[Reapply access, visibility, and tag predicates]
  H --> I
  I --> J[Hydrate, sort, and trim results]
Loading

Reviews (2) · Last reviewed commit: "fix(knowledge): align search fixtures wi..."

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@icecrasher321 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@icecrasher321
icecrasher321 merged commit 1d08664 into staging Sep 17, 2026
36 of 37 checks passed
@icecrasher321
icecrasher321 deleted the codex/fix-kb-block-vector-search branch September 17, 2026 00:59

This branch was previously deployed

1 inactive deployment
Preview — f6dd97f7 Deployed Sep 17, 2026 by vercel[bot]
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