{
  "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\": \"E000001\", \"name\": \"Alice\", \"type\": \"人物\", \"seen_range\": {\"first\": \"C0001\", \"last\": \"C0001\"}, \"mention_count\": 1, \"descriptions\": [\"女孩\", \"好奇\"], \"matched_terms\": [\"Alice\"], \"relations\": [\"Alice|位于|rabbit-hole\", \"Alice|位于|well\"]}, {\"entity_id\": \"E000007\", \"name\": \"book\", \"type\": \"物品\", \"seen_range\": {\"first\": \"C0001\", \"last\": \"C0001\"}, \"mention_count\": 1, \"descriptions\": [\"姐姐的书\"], \"matched_terms\": [\"book\"], \"relations\": [\"Alice's sister|阅读|book\"]}, {\"entity_id\": \"E000005\", \"name\": \"well\", \"type\": \"地点\", \"seen_range\": {\"first\": \"C0001\", \"last\": \"C0001\"}, \"mention_count\": 1, \"descriptions\": [\"深井\", \"有橱柜书架\"], \"matched_terms\": [\"well\"], \"relations\": [\"Alice|位于|well\"]}, {\"entity_id\": \"E000003\", \"name\": \"Alice's sister\", \"type\": \"人物\", \"seen_range\": {\"first\": \"C0001\", \"last\": \"C0001\"}, \"mention_count\": 1, \"aliases\": [\"her sister\"], \"descriptions\": [\"在河边看书\"], \"relations\": [\"Alice's sister|阅读|book\"]}, {\"entity_id\": \"E000002\", \"name\": \"White Rabbit\", \"type\": \"人物\", \"seen_range\": {\"first\": \"C0001\", \"last\": \"C0001\"}, \"mention_count\": 1, \"aliases\": [\"Rabbit\"], \"descriptions\": [\"白兔\", \"粉眼睛\"], \"relations\": [\"Alice|跟随|White Rabbit\", \"White Rabbit|拥有|watch\"]}, {\"entity_id\": \"E000004\", \"name\": \"rabbit-hole\", \"type\": \"地点\", \"seen_range\": {\"first\": \"C0001\", \"last\": \"C0001\"}, \"mention_count\": 1, \"descriptions\": [\"大兔子洞\", \"树篱下\"], \"relations\": [\"Alice|位于|rabbit-hole\"]}, {\"entity_id\": \"E000006\", \"name\": \"watch\", \"type\": \"物品\", \"seen_range\": {\"first\": \"C0001\", \"last\": \"C0001\"}, \"mention_count\": 1, \"descriptions\": [\"兔子怀表\"], \"relations\": [\"White Rabbit|拥有|watch\"]}]\n\nOntology constraints (prefer these core types and normalized relations):\nAllowed core entity types:\n- 人物: 角色姓名, 主角/关键人物, 配角\n- 地点: 山岳/洞天, 洞府/殿阁, 城镇/疆域, 秘境\n- 组织: 宗门, 门派, 势力, 机构\n- 物品: 兵器, 法器, 经卷典籍, 其他道具\n- 其他\nKey rules:\n- 实体 type 必须落在核心类型集合中；subtype 仅作细分，不得替代 type。\n- 若实体更像角色身份标签而非完整人物名，优先使用职位称号。\n- 若实体强调修炼路径与长期体系，优先使用功法体系；强调施展动作时优先使用术法神通。\n- 无法安全判断时允许使用其他，但应在后续 Type Consolidation 中优先收缩。\n\nCHUNK_ID: C0002 | PARA_RANGE: 17-29\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:\nwhat she was coming to, but it was too dark to see anything; then she\nlooked at the sides of the well, and noticed that they were filled with\ncupboards and book-shelves; here and there she saw maps and pictures\n\nhung upon pegs. She took down a jar from one of the shelves as she\npassed; it was labelled “ORANGE MARMALADE”, but to her great\ndisappointment it was empty: she did not like to drop the jar for fear\n\nof killing somebody underneath, so managed to put it into one of the\ncupboards as she fell past it.\n\n“Well!” thought Alice to herself, “after such a fall as this, I shall\n\nthink nothing of tumbling down stairs! How brave they’ll all think me\nat home! Why, I wouldn’t say anything about it, even if I fell off the\ntop of the house!” (Which was very likely true.)\n\nDown, down, down. Would the fall _never_ come to an end? “I wonder how\nmany miles I’ve fallen by this time?” she said aloud. “I must be\ngetting somewhere near the centre of the earth. Let me see: that would\n\nbe four thousand miles down, I think—” (for, you see, Alice had learnt\nseveral things of this sort in her lessons in the schoolroom, and\nthough this was not a _very_ good opportunity for showing off her\n\nknowledge, as there was no one to listen to her, still it was good\npractice to say it over) “—yes, that’s about the right distance—but\nthen I wonder what Latitude or Longitude I’ve got to?” (Alice had no\n\nidea what Latitude was, or Longitude either, but thought they were nice\ngrand words to say.)\n\nPresently she began again. “I wonder if I shall fall right _through_\nthe earth! How funny it’ll seem to come out among the people that walk\nwith their heads downward! The Antipathies, I think—” (she was rather\n\nglad there _was_ no one listening, this time, as it didn’t sound at all\nthe right word) “—but I shall have to ask them what the name of the\ncountry is, you know. Please, Ma’am, is this New Zealand or Australia?”\n\n(and she tried to curtsey as she spoke—fancy _curtseying_ as you’re\nfalling through the air! Do you think you could manage it?) “And what\nan ignorant little girl she’ll think me for asking! No, it’ll never do\n\nto ask: perhaps I shall see it written up somewhere.”"
    }
  ]
}