Open
Description
Is there an existing issue for the same feature request?
- I have checked the existing issues.
Is your feature request related to a problem?
No
Describe the feature you'd like
Dear Infinflow / Ragflow team
Great work so far. It would be nice if we could enhance retrieval performance be prefixing context in the document. Recent work by Anthropic shows notable gains by doing so. This appears to be relatively simple to implement (link shared below)
Basic Example
Suppose the document is of a SEC filing,
original_chunk = "The company's revenue grew by 3% over the previous quarter."
contextualized_chunk = "This chunk is from an SEC filing on ACME corp's performance in Q2 2023; the previous quarter's revenue was $314 million. The company's revenue grew by 3% over the previous quarter."
Describe implementation you've considered
No response
Documentation, adoption, use case
Additional information
Drawbacks
While uploading a file into the rag database, it will take more time now (as the context has to be estimated for all chunks)
Reference links:
- Blog Post: https://www.anthropic.com/news/contextual-retrieval
- Reference implementation by Anthropic: https://github.com/anthropics/anthropic-cookbook/blob/main/skills/contextual-embeddings/guide.ipynb
Metadata
Metadata
Assignees
Labels
No labels