{
  "messages": [
    {
      "role": "system",
      "content": "You are a knowledge graph extraction agent for long-form novels. Extract entities and relations from the given text chunk. Return JSON only."
    },
    {
      "role": "user",
      "content": "Retrieved existing entity cards for this chunk. Reuse these canonical names/types when the same entity reappears; do not create near-duplicate entities if a card already matches the mention:\n[{\"entity_id\": \"E000022\", \"name\": \"心月狐\", \"type\": \"人物\", \"seen_range\": {\"first\": \"C0005\", \"last\": \"C0005\"}, \"mention_count\": 2, \"aliases\": [\"则天皇帝\", \"武曌\", \"武则天\"], \"descriptions\": [\"天星临凡\", \"投胎为唐家天子\"], \"matched_terms\": [\"武后\"], \"relations\": [\"嫦娥|告知|心月狐\", \"心月狐|前往|廣寒\"]}, {\"entity_id\": \"E000028\", \"name\": \"暖閣\", \"type\": \"其他\", \"seen_range\": {\"first\": \"\", \"last\": \"\"}, \"mention_count\": 0, \"matched_terms\": [\"暖閣\"], \"relations\": [\"心月狐|前往|暖閣\"]}, {\"entity_id\": \"E000001\", \"name\": \"百花仙子\", \"type\": \"人物\", \"seen_range\": {\"first\": \"C0001\", \"last\": \"C0005\"}, \"mention_count\": 7, \"aliases\": [\"仙姑\", \"百草仙子\"], \"descriptions\": [\"蓬莱山红颜洞仙姑\", \"修行多年\"], \"relations\": [\"麻姑|告知|百花仙子\", \"百花仙子|告知|麻姑\"]}, {\"entity_id\": \"E000009\", \"name\": \"嫦娥\", \"type\": \"人物\", \"seen_range\": {\"first\": \"C0002\", \"last\": \"C0005\"}, \"mention_count\": 3, \"aliases\": [\"月姊\"], \"descriptions\": [\"月府仙子\"], \"relations\": [\"嫦娥|告知|百花仙子\", \"嫦娥|告知|心月狐\"]}, {\"entity_id\": \"E000019\", \"name\": \"麻姑\", \"type\": \"人物\", \"seen_range\": {\"first\": \"C0003\", \"last\": \"C0005\"}, \"mention_count\": 3, \"aliases\": [\"麻姑洞府\"], \"descriptions\": [\"戏言惩罚\"], \"relations\": [\"麻姑|告知|百花仙子\", \"百花仙子|告知|麻姑\"]}, {\"entity_id\": \"E000023\", \"name\": \"徐敬業\", \"type\": \"人物\", \"seen_range\": {\"first\": \"C0005\", \"last\": \"C0005\"}, \"mention_count\": 1, \"aliases\": [\"徐績之孫\"], \"descriptions\": [\"英国公之孙\", \"起兵讨武后\"], \"relations\": [\"徐敬業|告知|駱賓王\"]}, {\"entity_id\": \"E000025\", \"name\": \"長安\", \"type\": \"地点\", \"seen_range\": {\"first\": \"C0005\", \"last\": \"C0005\"}, \"mention_count\": 1, \"descriptions\": [\"唐朝都城\", \"被四关围住\"]}, {\"entity_id\": \"E000024\", \"name\": \"駱賓王\", \"type\": \"人物\", \"seen_range\": {\"first\": \"C0005\", \"last\": \"C0005\"}, \"mention_count\": 1, \"descriptions\": [\"与徐敬业共同讨武\"], \"relations\": [\"徐敬業|告知|駱賓王\", \"駱賓王|告知|兒子\"]}]\n\nOntology constraints (prefer these core types and normalized relations):\nAllowed core entity types:\n- 人物: 角色姓名, 主角/关键人物, 配角\n- 地点: 山岳/洞天, 洞府/殿阁, 城镇/疆域, 秘境\n- 组织: 宗门, 门派, 势力, 机构\n- 物品: 兵器, 法器, 经卷典籍, 其他道具\n- 其他\nNormalized relations:\n- 告知: aliases=说道, 问道, 笑道, 答道, 开口\n- 前往: aliases=前往, 来到, 进入, 回到, 抵达\n- 修炼: aliases=修炼, 修行, 参悟, 参修, 修习\nKey rules:\n- 实体 type 必须落在核心类型集合中；subtype 仅作细分，不得替代 type。\n- 若实体更像角色身份标签而非完整人物名，优先使用职位称号。\n- 若实体强调修炼路径与长期体系，优先使用功法体系；强调施展动作时优先使用术法神通。\n- 无法安全判断时允许使用其他，但应在后续 Type Consolidation 中优先收缩。\n\nCHUNK_ID: C0006 | PARA_RANGE: 6-7\n\nFrom the text chunk below, extract entities and relations. Output STRICT JSON with keys: entities (list) and relations (list). Entity schema: {name,type,aliases,attributes,descriptions,evidence,mentions}. mentions is a list of {chunk_id,summary,attributes,evidence}. Relation schema: {subject,relation,object,evidence,mentions}. mentions is a list of {chunk_id,summary,evidence}. Use ontology core types when possible. Do not invent new top-level entity type labels outside the ontology if an existing type fits. Prefer normalized relation names from the ontology alias list. If an existing entity card clearly matches a mention in this chunk, reuse that card's canonical name. If the chunk uses a title, alias, or shortened reference that matches a card, keep it under the same entity instead of splitting it. Keep outputs compact: at most 8 entities and 8 relations for this pass. Each description/evidence/summary should be short (<=30 characters) and avoid full sentences. Limit each entity to <=2 descriptions and <=2 mentions; each relation to <=1 mention. For mentions in this chunk, set chunk_id to the provided CHUNK_ID. Only include information supported by the chunk. Return a single JSON object and nothing else (no markdown, no code fences). If unsure, return {\"entities\":[],\"relations\":[]}.\n\nTEXT CHUNK:\n武后因雪越下越大，不覺喜道：「古人云：『雪兆豐年。』朕才登極，就得如此佳兆，明歲自然五穀豐登，天下太平了。」公主同上官婉兒率領眾宮娥都山呼叩賀。未知後事如何，且看下回分解。\n\n第四回     吟雪詩暖閣賭酒　揮醉筆上苑催花"
    }
  ]
}