Skip to content

feat(Vector Store Retriever Node): Add reranker support to retriever for QA chain #16051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 6, 2025

Conversation

schrothbn
Copy link
Contributor

Summary

This PR adds support for rerankers in the retrieve operation of vector stores that's used by QA chain nodes.

Changes in retrieve operation:

  • Get and return reranker and VectorStore if reranker is connected
  • Only return VectorStore otherwise

Changes in Vector Store Retriever Node:

  • Handle response from the vector store operation (with and without reranker)
  • With reranker build a ContextualCompressionRetriever which combines the base retriever (vector store) and a compressor (here the reranker) and calls them internally in the correct way
  • Without a passed reranker it will behave as before

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/AI-1019/add-reranker-support-to-retrieverqa-chain

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@schrothbn schrothbn requested review from a team and burivuhster and removed request for a team June 5, 2025 09:53
Copy link
Contributor

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

Choose a reason for hiding this comment

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

cubic found 12 issues across 5 files. Review them in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

@n8n-assistant n8n-assistant bot added the n8n team Authored by the n8n team label Jun 5, 2025
@schrothbn schrothbn force-pushed the ai-1019-add-reranker-support-to-retrieverqa-chain branch from 9cf7b0f to 6445d1b Compare June 5, 2025 10:06
Copy link

codecov bot commented Jun 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@burivuhster burivuhster left a comment

Choose a reason for hiding this comment

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

Looks good! 🚀

Copy link
Contributor

github-actions bot commented Jun 6, 2025

✅ All Cypress E2E specs passed

@schrothbn schrothbn merged commit 969552a into master Jun 6, 2025
33 checks passed
@schrothbn schrothbn deleted the ai-1019-add-reranker-support-to-retrieverqa-chain branch June 6, 2025 11:16
Copy link

cypress bot commented Jun 6, 2025

n8n    Run #11347

Run Properties:  status check passed Passed #11347  •  git commit 969552aeae: 🌳 ADO-3437 🤖 CharlieKolb 🗃️ e2e/*
Project n8n
Branch Review master
Run status status check passed Passed #11347
Run duration 04m 12s
Commit git commit 969552aeae: 🌳 ADO-3437 🤖 CharlieKolb 🗃️ e2e/*
Committer Benjamin Schroth
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 10
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 503
View all changes introduced in this branch ↗︎

@janober
Copy link
Member

janober commented Jun 11, 2025

Got released with [email protected]

TianYi0217 pushed a commit to TianYi0217/n8n that referenced this pull request Jun 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants