← Back to Gene Catalog

contract-revision-advisor

Hybrid legal.contract

基于知识库与 LLM 的合同条款级审查;强化贴原文与抗幻觉的 system 约束,可选高质量模式(略降温度);支持合同类型细分、法规焦点摘录、变更优先审查(含条款定位与摘录);分段预设、长文本分段送审、汇总去重、JSON 容错与修复。

README

No documentation yet.

Gene authors can add a README when publishing.

Phenotype

Input

PropertyType Req Description
apiKeys object
chunkSize number
knowledge object 四类知识库至少一类非空(由基因逻辑校验)
partyRole string
focusAreas array
chunkPreset conservative | balanced | aggressive 分段策略预设;与 maxCharsSinglePass/chunkSize/chunkOverlap 可同时使用,显式数字优先
reviewScope full | delta 默认 full;delta 时优先针对 changeSummary 审查
chunkOverlap number
contractText string 待审全文(合同、单方文书或非诉专业文书)
documentKind contract | unilateral_compliance | non_litigation_professional contract=合同/协议;unilateral_compliance=单方文书;non_litigation_professional=非诉专业文书/制度
changeSummary string 与 reviewScope=delta 配合:本轮变更说明
chunkedReview boolean
contractTitle string
documentSubtype string 文书细分:documentKind=contract 时为合同类型(如投融资合同、建设工程施工合同、劳动/用人等);单方/非诉时同前
reviewPrecision standard | high standard 默认;high 时加强贴原文、少凑条,并略降低采样温度
sessionFeedback string
changeClauseRefs array 与 reviewScope=delta 配合:变更涉及的条款/章节定位(如「第5.2条」「附件二」)
maxCharsSinglePass number
priorLearningContext string
changeAffectedExcerpt string 与 reviewScope=delta 配合:变更相关正文摘录
chunkConsolidationPass boolean 默认 true。分段审查且段数>1 时是否再调用一次模型做汇总去重
knowledgeFocusExcerpts string 可选。宿主根据 confirmed 名称从法规/案例库检索匹配的摘录文本
confirmedKnowledgeFocus array 可选。用户在长知识库预警流程中确认的法规/要点名称

Output

PropertyType Req
disclaimer string
riskSummary string
chunkReviewMeta object
checklistForOwner array
revisionSuggestions array
learningContextForNextCall string
Raw JSON Schema

inputSchema

{
  "type": "object",
  "required": [
    "knowledge",
    "contractText",
    "apiKeys"
  ],
  "properties": {
    "apiKeys": {
      "type": "object",
      "required": [
        "llm"
      ],
      "properties": {
        "llm": {
          "type": "object",
          "required": [
            "apiKey"
          ],
          "properties": {
            "model": {
              "type": "string"
            },
            "apiKey": {
              "type": "string"
            },
            "baseUrl": {
              "type": "string"
            },
            "provider": {
              "enum": [
                "deepseek",
                "openai",
                "anthropic"
              ],
              "type": "string"
            }
          }
        }
      }
    },
    "chunkSize": {
      "type": "number"
    },
    "knowledge": {
      "type": "object",
      "properties": {
        "laws": {
          "type": "string"
        },
        "cases": {
          "type": "string"
        },
        "revisionSamples": {
          "type": "string"
        },
        "contractTemplates": {
          "type": "string"
        }
      },
      "description": "四类知识库至少一类非空(由基因逻辑校验)"
    },
    "partyRole": {
      "type": "string"
    },
    "focusAreas": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "chunkPreset": {
      "enum": [
        "conservative",
        "balanced",
        "aggressive"
      ],
      "type": "string",
      "description": "分段策略预设;与 maxCharsSinglePass/chunkSize/chunkOverlap 可同时使用,显式数字优先"
    },
    "reviewScope": {
      "enum": [
        "full",
        "delta"
      ],
      "type": "string",
      "description": "默认 full;delta 时优先针对 changeSummary 审查"
    },
    "chunkOverlap": {
      "type": "number"
    },
    "contractText": {
      "type": "string",
      "description": "待审全文(合同、单方文书或非诉专业文书)"
    },
    "documentKind": {
      "enum": [
        "contract",
        "unilateral_compliance",
        "non_litigation_professional"
      ],
      "type": "string",
      "description": "contract=合同/协议;unilateral_compliance=单方文书;non_litigation_professional=非诉专业文书/制度"
    },
    "changeSummary": {
      "type": "string",
      "description": "与 reviewScope=delta 配合:本轮变更说明"
    },
    "chunkedReview": {
      "type": "boolean"
    },
    "contractTitle": {
      "type": "string"
    },
    "documentSubtype": {
      "type": "string",
      "description": "文书细分:documentKind=contract 时为合同类型(如投融资合同、建设工程施工合同、劳动/用人等);单方/非诉时同前"
    },
    "reviewPrecision": {
      "enum": [
        "standard",
        "high"
      ],
      "type": "string",
      "description": "standard 默认;high 时加强贴原文、少凑条,并略降低采样温度"
    },
    "sessionFeedback": {
      "type": "string"
    },
    "changeClauseRefs": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "与 reviewScope=delta 配合:变更涉及的条款/章节定位(如「第5.2条」「附件二」)"
    },
    "maxCharsSinglePass": {
      "type": "number"
    },
    "priorLearningContext": {
      "type": "string"
    },
    "changeAffectedExcerpt": {
      "type": "string",
      "description": "与 reviewScope=delta 配合:变更相关正文摘录"
    },
    "chunkConsolidationPass": {
      "type": "boolean",
      "description": "默认 true。分段审查且段数>1 时是否再调用一次模型做汇总去重"
    },
    "knowledgeFocusExcerpts": {
      "type": "string",
      "description": "可选。宿主根据 confirmed 名称从法规/案例库检索匹配的摘录文本"
    },
    "confirmedKnowledgeFocus": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "可选。用户在长知识库预警流程中确认的法规/要点名称"
    }
  }
}

outputSchema

{
  "type": "object",
  "required": [
    "revisionSuggestions",
    "riskSummary",
    "checklistForOwner",
    "learningContextForNextCall",
    "disclaimer"
  ],
  "properties": {
    "disclaimer": {
      "type": "string"
    },
    "riskSummary": {
      "type": "string"
    },
    "chunkReviewMeta": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "chunkSize": {
          "type": "number"
        },
        "chunkCount": {
          "type": "number"
        },
        "chunkPreset": {
          "type": [
            "string",
            "null"
          ],
          "description": "生效的分段预设;未使用预设时为 null"
        },
        "reviewPrecision": {
          "enum": [
            "standard",
            "high"
          ],
          "type": "string"
        },
        "jsonRepairApplied": {
          "type": "boolean",
          "description": "是否曾触发 JSON 修复(额外模型调用)"
        },
        "consolidationError": {
          "type": "string"
        },
        "maxCharsSinglePass": {
          "type": "number"
        },
        "consolidationApplied": {
          "type": "boolean",
          "description": "是否已执行分段后的汇总去重"
        },
        "consolidationSkippedReason": {
          "type": "string"
        }
      }
    },
    "checklistForOwner": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "revisionSuggestions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "basis": {
            "type": "string"
          },
          "issue": {
            "type": "string"
          },
          "clauseRef": {
            "type": "string"
          },
          "riskLevel": {
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string"
          },
          "suggestion": {
            "type": "string"
          },
          "originalExcerpt": {
            "type": "string"
          },
          "suggestedRedline": {
            "type": "string"
          }
        }
      }
    },
    "learningContextForNextCall": {
      "type": "string"
    }
  }
}

Arena History

Date Fitness Safety Calls
Apr 2 0.5000 1.00 1