langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
46.75k stars 6.61k forks source link

Support Contextual Retrieval #8776

Open Weaxs opened 3 days ago

Weaxs commented 3 days ago

Self Checks

1. Is this request related to a challenge you're experiencing? Tell me about your story.

https://www.anthropic.com/news/contextual-retrieval

<document> 
{{WHOLE_DOCUMENT}} 
</document> 
Here is the chunk we want to situate within the whole document 
<chunk> 
{{CHUNK_CONTENT}} 
</chunk> 
Please give a short succinct context to situate this chunk within the overall document for the purposes of improving search retrieval of the chunk. Answer only with the succinct context and nothing else. 

image

2. Additional context or comments

have 2 problem:

  1. should support change llm for explaining the chunks, maybe can use system llm in the beginning.
  2. If file content context large than max context size which llm supported, maybe not explain/summarize automatically ?

3. Can you help us with this feature?