-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(langchain): Rerank Documents Based on Recency Bias on Document Date in Metadata #6676
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
Would it make more sense to add a different mode to the existing TimeWeightedVectorStoreRetriever
?
): [Document, number][] { | ||
if (documents.length === 0) return []; | ||
|
||
if (!documents.every(([doc, _]) => doc.metadata.date instanceof Date)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would suggest storing this as an ISO string - not all (most?) vector stores will not deserialize dates
Fixes # (issue): langchain-ai/langchain#18729
This PR implements a retriever that performs reranking based on receny of a documents published date.
This retreiver differs from the
TimeWeightedVectorStoreRetriever
that performs retrieval based on the retrieved date of the document, not its published date