{
  "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": "Ontology 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=加入, 隶属, 拜入, 奉命, 外门\n- 对抗: aliases=出手, 拔剑, 斩向, 追杀, 打斗\nKey rules:\n- 实体 type 必须落在核心类型集合中；subtype 仅作细分，不得替代 type。\n- 若实体更像角色身份标签而非完整人物名，优先使用职位称号。\n- 若实体强调修炼路径与长期体系，优先使用功法体系；强调施展动作时优先使用术法神通。\n- 无法安全判断时允许使用其他，但应在后续 Type Consolidation 中优先收缩。\n\nCHUNK_ID: C0001 | PARA_RANGE: 1-5\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----------------------------------------\n話說陝西同州府朝邑縣，城南三十四地方，原有一個村莊。這莊內住的衹有趙、方二姓，并無他族。這莊叫小不小，叫大不大，也有二三十戶人家。祖上世代務農。到了姓趙的爺爺手裏，居然請了先生，教他兒子攻書，到他孫子，忽然得中一名黌門秀士 。鄉里人眼淺，看見中了秀才，竟是非同小可，合莊的人，都把他推戴起來，姓方的便漸漸的不敵了。姓方的瞧著眼熱，有幾家該錢的，也就不惜工本，公開一個學堂，又到城裏請了一位舉人老夫子，下鄉來教他們的子弟讀書。\n\n-----\n\n黌門秀士：黌門，學宮；秀士，即秀才。這舉人姓王名仁，因為上了年紀，也就絕意進取，到得鄉間，盡心教授。不上幾年，居然造就出幾個人材：有的也會對個對兒；有的也會謅幾句詩；內中有個天分高強的，竟把筆做了\"開講\" 。把這幾個東家喜歡的了不得。到了九月重陽，大家商議著，明年還請這個先生。王仁見館地蟬聯，心中自是歡喜。這個會做開講的學生，他父親叫方必開。他家門前，原有兩棵合抱大樹，分列左右，因此鄉下人都叫他為\"大樹頭方家\"。這方必開因見兒子有了怎麼大的能耐，便說自明年為始，另外送先生四貫銅錢。不在話下。\n\n-----"
    }
  ]
}