glam/schemas/20251121/linkml/modules/classes/ReasoningContent.yaml
kempersc 1516d509cf Add metadata to LinkML class definitions and update prefixes
- Added `id`, `name`, `title`, and `description` fields to multiple LinkML class YAML files.
- Standardized prefixes across all class definitions.
- Introduced a new script `fix_linkml_metadata.py` to automate the addition of metadata to class files.
- Updated existing class files to ensure compliance with the new metadata structure.
2026-01-29 17:40:47 +01:00

173 lines
6.3 KiB
YAML

id: https://nde.nl/ontology/hc/class/ReasoningContent
name: ReasoningContent
title: Reasoning Content
description: LinkML class definition for Reasoning Content
prefixes:
linkml: https://w3id.org/linkml/
schema: http://schema.org/
skos: http://www.w3.org/2004/02/skos/core#
rico: https://www.ica.org/standards/RiC/ontology#
wd: http://www.wikidata.org/entity/
# ReasoningContent - LLM reasoning content preservation class
#
# Created: 2026-01-19
# Migration: clear_thinking → preserves_or_preserved + ReasoningContent class
# Per slot_fixes.yaml, Rule 53/56
#
# Rule compliance: 0b (structured class), 37 (specificity), 50 (ontology mapping)
id: https://nde.nl/ontology/hc/class/ReasoningContent
name: reasoning_content_class
title: Reasoning Content Class
prefixes:
linkml: https://w3id.org/linkml/
hc: https://nde.nl/ontology/hc/
schema: http://schema.org/
prov: http://www.w3.org/ns/prov#
default_prefix: hc
imports:
- linkml:types
- ../slots/has_or_had_label
- ../slots/has_or_had_description
- ../slots/has_or_had_identifier
classes:
ReasoningContent:
class_uri: prov:Entity
description: |
LLM reasoning content that is preserved across conversation turns.
**DEFINITION**:
ReasoningContent represents the chain-of-thought reasoning that LLMs like
GLM 4.7 expose through their thinking modes. This class captures the
reasoning_content that should be preserved when using "Preserved Thinking"
mode for multi-turn conversations.
**GLM 4.7 Preserved Thinking** (https://docs.z.ai/guides/capabilities/thinking-mode):
When `clear_thinking: false` (Preserved Thinking enabled):
- Reasoning content from previous turns is retained in context
- Improves model performance and increases cache hit rates
- Requires returning EXACT, UNMODIFIED reasoning_content back to API
**Migration from clear_thinking**:
This class replaces the boolean `clear_thinking` slot with a structured
representation of what is being preserved:
| Old Pattern | New Pattern |
|-------------|-------------|
| `clear_thinking: false` | `preserves_or_preserved: ReasoningContent` with `is_preserved: true` |
| `clear_thinking: true` | `preserves_or_preserved: ReasoningContent` with `is_preserved: false` |
**PROV-O Alignment**:
- ReasoningContent IS a prov:Entity (the reasoning output)
- Links to LLMResponse via preserves_or_preserved slot
- Enables tracking reasoning provenance across turns
**Use Cases**:
- Multi-turn agent conversations with preserved context
- Debugging reasoning chain across API calls
- Auditing LLM decision-making process
- Optimizing cache hit rates
exact_mappings:
- prov:Entity
close_mappings:
- schema:Comment
- schema:Review
slots:
- has_or_had_label
- has_or_had_description
- has_or_had_identifier
attributes:
is_preserved:
range: boolean
required: true
description: |
Whether this reasoning content is preserved across turns.
- **true**: Preserved Thinking enabled (keep reasoning, better cache hits)
- **false**: Clear previous reasoning (fresh context each turn)
Maps to the inverse of the old `clear_thinking` boolean:
- `is_preserved: true` ≡ `clear_thinking: false`
- `is_preserved: false` ≡ `clear_thinking: true`
content_text:
range: string
required: false
description: |
The actual reasoning content text (chain-of-thought).
Optional - may be omitted if only tracking preservation status.
examples:
- value: |
The user is asking about Dutch heritage institutions. I need to identify:
1) Institution name: Rijksmuseum
2) Type: Museum (maps to InstitutionTypeEnum.MUSEUM)
3) Location: Amsterdam (city in Noord-Holland province)...
description: GLM 4.7 reasoning trace
turn_number:
range: integer
required: false
description: |
The conversation turn number this reasoning came from.
Useful for tracking reasoning provenance across multi-turn conversations.
token_count:
range: integer
required: false
description: |
Number of tokens in the reasoning content.
Important for context window management.
slot_usage:
has_or_had_label:
description: Human-readable label for this reasoning content.
examples:
- value: Turn 3 Reasoning
description: Reasoning from the third conversation turn
has_or_had_description:
description: Description of the reasoning context or purpose.
examples:
- value: Chain-of-thought reasoning for heritage institution extraction
description: Purpose of the preserved reasoning
has_or_had_identifier:
description: Unique identifier for this reasoning content block.
examples:
- value: reasoning-turn-3-20260119-143000
description: Timestamped reasoning block ID
annotations:
specificity_score: 0.80
specificity_rationale: Highly specific to LLM API reasoning preservation domain
custodian_types: '["D"]'
custodian_types_rationale: Applies to Digital Platform custodians using LLM APIs
examples:
- value:
is_preserved: true
has_or_had_label: Preserved Reasoning
content_text: |
The user is asking about Dutch heritage institutions...
turn_number: 3
token_count: 250
description: Preserved reasoning content from turn 3
- value:
is_preserved: false
has_or_had_label: Cleared Context
has_or_had_description: Fresh context for new query topic
description: Cleared reasoning (fresh context)
comments:
- Created from slot_fixes.yaml migration (2026-01-19)
- Replaces boolean clear_thinking with structured reasoning preservation
- Enables tracking what reasoning is preserved and why
- PROV-O Entity alignment for provenance tracking