feat(memory): add emotion batch extraction task and improve extraction prompts

- Add extract_emotion_batch_task for async emotion extraction
- Refine Chinese entity types and relation types in extraction prompts
- Add STATEMENT_EMOTION_UPDATE Cypher query for Neo4j backfill
- Refactor statement_step and triplet_step implementations
This commit is contained in:
lanceyq
2026-04-24 13:55:14 +08:00
parent a98011fc8a
commit b0ddd12cc6
14 changed files with 1321 additions and 833 deletions

View File

@@ -46,6 +46,15 @@ SET s += {
RETURN s.id AS uuid
"""
STATEMENT_EMOTION_UPDATE = """
UNWIND $items AS item
MATCH (s:Statement {id: item.statement_id})
SET s.emotion_type = item.emotion_type,
s.emotion_intensity = item.emotion_intensity,
s.emotion_keywords = item.emotion_keywords
RETURN s.id AS uuid
"""
CHUNK_NODE_SAVE = """
UNWIND $chunks AS chunk
MERGE (c:Chunk {id: chunk.id})