Skip to content

improvement(knowledge): read the source card with the result - #8099

Merged
waleedlatif1 merged 2 commits into
stagingfrom
chore/search-dead-paths-round-trips
Sep 21, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
chore/search-dead-paths-round-trips

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Every search re-read the returned documents after retrieval to fetch the name, URL, modified time and connector type of each source card, under the same predicate hydration had just applied (7–82 ms and one round trip per search). Those fields now ride on the hydrated row: hydration joins the connector, and the application maps the row directly. getDocumentMetadataByIds stays for the v1 route and document reads.
  • The workspace keyword hydration still scored results on the original vector, which lives out of line in toast storage; it now scores on the projection like the other legs.

Type of Change

  • Improvement

Testing

  • Application tests updated to feed the source-card fields on the hydrated rows; the case that dropped a passage between hydration and the metadata re-read is gone with the re-read, since hydration's predicate is the gate. The hydration test asserts the joined fields.
  • bun run lint, check:audits, type-check pass; 3,311 tests pass across knowledge and the search routes.

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 21, 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 21, 2026 5:08am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the only post-review change restores the shorter Tin readiness-cache window requested by the prior review.

Summary

This PR removes the second source-card metadata read by carrying document and connector fields through hydrated search rows, scores workspace keyword results using the projection vector, and restores the Tin readiness cache to one minute.

  • Joins source-card metadata into vector, tag-only, and keyword hydration queries.
  • Maps hydrated source metadata directly into application search results.
  • Uses the projected embedding for keyword-result distance calculations.
  • Updates diagnostics and tests for the single-read retrieval flow.
  • Restores the shorter Tin readiness-cache window after the previous review.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Search candidates] --> B[Hydrate visible documents]
  B --> C[Join document metadata]
  C --> D[Join connector type]
  D --> E[Optional reranking]
  E --> F[Map hydrated rows to results]
Loading

Reviews (2) · Last reviewed commit: "improvement(knowledge): keep the Tin rea..."

Comment thread apps/sim/lib/knowledge/application/search.ts
Comment thread apps/sim/lib/knowledge/search/tin-keyword.ts Outdated

@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.

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/knowledge/search/tin-keyword.ts Outdated
@waleedlatif1 waleedlatif1 changed the title improvement(knowledge): read the source card with the result and hold Tin readiness longer improvement(knowledge): read the source card with the result Sep 21, 2026
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 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

@waleedlatif1
waleedlatif1 merged commit d5061d5 into staging Sep 21, 2026
34 of 36 checks passed
@waleedlatif1
waleedlatif1 deleted the chore/search-dead-paths-round-trips branch September 21, 2026 05:31

This branch was previously deployed

1 inactive deployment
Preview 2afd6ece Deployed Sep 21, 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