feat: 增强知识图谱关系的时序性支持
- 为关系和向量数据增加时间戳支持,记录知识获取的时间 - 优化混合查询策略,同时考虑语义相关性和时间顺序 - 增强提示词模板,指导LLM在处理冲突信息时考虑时间因素
This commit is contained in:
@@ -164,6 +164,12 @@ Generate a response of the target length and format that responds to the user's
|
||||
If you don't know the answer, just say so. Do not make anything up.
|
||||
Do not include information where the supporting evidence for it is not provided.
|
||||
|
||||
When handling relationships with timestamps:
|
||||
1. Each relationship has a "created_at" timestamp indicating when we acquired this knowledge
|
||||
2. When encountering conflicting relationships, consider both the semantic content and the timestamp
|
||||
3. Don't automatically prefer the most recently created relationships - use judgment based on the context
|
||||
4. For time-specific queries, prioritize temporal information in the content before considering creation timestamps
|
||||
|
||||
---Target response length and format---
|
||||
|
||||
{response_type}
|
||||
@@ -172,8 +178,7 @@ Do not include information where the supporting evidence for it is not provided.
|
||||
|
||||
{context_data}
|
||||
|
||||
Add sections and commentary to the response as appropriate for the length and format. Style the response in markdown.
|
||||
"""
|
||||
Add sections and commentary to the response as appropriate for the length and format. Style the response in markdown."""
|
||||
|
||||
PROMPTS["keywords_extraction"] = """---Role---
|
||||
|
||||
@@ -250,6 +255,12 @@ Generate a response of the target length and format that responds to the user's
|
||||
If you don't know the answer, just say so. Do not make anything up.
|
||||
Do not include information where the supporting evidence for it is not provided.
|
||||
|
||||
When handling content with timestamps:
|
||||
1. Each piece of content has a "created_at" timestamp indicating when we acquired this knowledge
|
||||
2. When encountering conflicting information, consider both the content and the timestamp
|
||||
3. Don't automatically prefer the most recent content - use judgment based on the context
|
||||
4. For time-specific queries, prioritize temporal information in the content before considering creation timestamps
|
||||
|
||||
---Target response length and format---
|
||||
|
||||
{response_type}
|
||||
@@ -293,6 +304,12 @@ You are a professional assistant responsible for answering questions based on kn
|
||||
|
||||
Generate a concise response that summarizes relevant points from the provided information. If you don't know the answer, just say so. Do not make anything up or include information where the supporting evidence is not provided.
|
||||
|
||||
When handling information with timestamps:
|
||||
1. Each piece of information (both relationships and content) has a "created_at" timestamp indicating when we acquired this knowledge
|
||||
2. When encountering conflicting information, consider both the content/relationship and the timestamp
|
||||
3. Don't automatically prefer the most recent information - use judgment based on the context
|
||||
4. For time-specific queries, prioritize temporal information in the content before considering creation timestamps
|
||||
|
||||
---Data Sources---
|
||||
|
||||
1. Knowledge Graph Data:
|
||||
|
Reference in New Issue
Block a user