Skip to content

Configuration Reference

Detailed documentation of all configuration options available in Episteme.

PipelineConfig

The top-level configuration object that contains settings for all pipeline components.

Bases: BaseModel

Top-level pipeline configuration. Each phase receives only its sub-config.

Serialize to JSON/YAML for reproducible research runs: config.model_dump_json(indent=2)

Source code in packages/episteme-pipeline/episteme_pipeline/config.py
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
class PipelineConfig(BaseModel):
    """
    Top-level pipeline configuration. Each phase receives only its sub-config.

    Serialize to JSON/YAML for reproducible research runs:
        config.model_dump_json(indent=2)
    """

    models: ModelConfig = Field(default_factory=ModelConfig)

    graph_schema: SchemaConfig = Field(default_factory=lambda: DEFAULT_SCHEMA.model_copy())
    phase1: Phase1Config = Field(default_factory=Phase1Config)
    phase2: Phase2Config = Field(default_factory=Phase2Config)
    phase3: Phase3Config = Field(default_factory=Phase3Config)
    phase3b: Phase3bConfig = Field(default_factory=Phase3bConfig)
    phase4_maturation: Phase4EntityMaturationConfig = Field(default_factory=Phase4EntityMaturationConfig)
    phase4: Phase4Config = Field(default_factory=Phase4Config)
    phase5: Phase5Config = Field(default_factory=Phase5Config)
    phase6: Phase6Config = Field(default_factory=Phase6Config)
    theoretical_enrichment: TheoreticalEnrichmentConfig = Field(default_factory=TheoreticalEnrichmentConfig)
    execution: ExecutionConfig = Field(default_factory=ExecutionConfig)
    decision_engine: DecisionEngineConfig | None = Field(default=None)
    modal_resolver: ModalResolverConfig = Field(default_factory=ModalResolverConfig)

    @classmethod
    def from_env(cls, **overrides: Any) -> PipelineConfig:
        """Build a config whose model selection is resolved from the environment.

        This is the one supported way to turn ambient environment state into a
        config. Call it once at the edge (CLI, example script, Studio) and pass
        the result down; do not read ``os.environ`` inside phases.
        """
        return cls(models=ModelConfig.from_env(), **overrides)

    @property
    def default_embedding_model(self) -> str:
        """Deprecated alias for ``config.models.embedding_model``."""
        return self.models.embedding_model

    @property
    def default_reranker_model(self) -> str:
        """Deprecated alias for ``config.models.reranker_model``."""
        return self.models.reranker_model

default_embedding_model property

Deprecated alias for config.models.embedding_model.

default_reranker_model property

Deprecated alias for config.models.reranker_model.

from_env(**overrides) classmethod

Build a config whose model selection is resolved from the environment.

This is the one supported way to turn ambient environment state into a config. Call it once at the edge (CLI, example script, Studio) and pass the result down; do not read os.environ inside phases.

Source code in packages/episteme-pipeline/episteme_pipeline/config.py
579
580
581
582
583
584
585
586
587
@classmethod
def from_env(cls, **overrides: Any) -> PipelineConfig:
    """Build a config whose model selection is resolved from the environment.

    This is the one supported way to turn ambient environment state into a
    config. Call it once at the edge (CLI, example script, Studio) and pass
    the result down; do not read ``os.environ`` inside phases.
    """
    return cls(models=ModelConfig.from_env(), **overrides)

Execution Configuration

Controls overall pipeline execution behavior and artifact management.

Bases: BaseModel

Source code in packages/episteme-pipeline/episteme_pipeline/config.py
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
class ExecutionConfig(BaseModel):
    persist_run_manifests: bool = True
    persist_phase1_artifacts: bool = True
    persist_phase2_artifacts: bool = True
    persist_phase3_artifacts: bool = True
    persist_phase3b_artifacts: bool = True
    persist_phase4_maturation_artifacts: bool = True
    persist_phase4_artifacts: bool = True
    persist_phase5_artifacts: bool = True
    persist_phase6_artifacts: bool = True
    persist_theoretical_enrichment_artifacts: bool = True
    project_artifacts_to_graph: bool = False
    allow_phase_reuse: bool = Field(
        default=True,
        description=(
            "Permit phase-level reuse across runs when every fingerprint "
            "(schema, method, prompt, config, source) matches the parent run. "
            "Set False to force every phase to re-execute."
        ),
    )
    allow_artifact_hydration: bool = Field(
        default=True,
        description=(
            "Prefer reusing persisted artifacts over re-executing upstream phases. "
            "When True, the pipeline hydrates the prior phase's ArtifactCollection "
            "from the last successful run (artifact-native resume) and feeds it into "
            "the next phase instead of recomputing it. "
            "Requires persist_run_manifests=True and an artifacts_dir holding "
            "artifacts from a prior run over the same input. "
            "Trade-off: skips expensive LLM-heavy upstream work, but relies entirely "
            "on fingerprint invalidation for correctness — if a method or schema "
            "changed without changing its fingerprint, hydrated artifacts are stale."
        ),
    )
    runs_dir: str = ".pipeline_runs"
    artifacts_dir: str = ".pipeline_artifacts"

Decision Engine Configuration

Controls System 1 calibrated decision engine routing, provider selection, confidence thresholds, and conformal prediction coverage.

Bases: BaseModel

Configuration for the System 1 Decision Engine (e.g. TypeSafe Jev / Laya).

Attributes

provider : str, default "none" Provider backend identifier ("none", "laya", "transformers", "mock"). api_key : SecretStr or None, default None Optional API key or secret token for remote decision services. endpoint_url : str or None, default None Optional HTTP/gRPC endpoint for remote decision services. timeout_seconds : float, default 2.0 Per-decision inference timeout in seconds. default_confidence_threshold : float, default 0.85 Default empirical accuracy threshold for fast-exit routing. conformal_alpha : float, default 0.05 Significance level for conformal prediction sets (guaranteeing 1 - alpha coverage). stochastic_audit_rate : float, default 0.02 Proportion of fast-exit decisions randomly escalated to System 2 to audit calibration drift. fallback_to_llm : bool, default True Whether to fall back to generative LLM execution if the decision engine fails or has low confidence. model_checkpoint : str, default "aac6fef/laya-mlx" Local weight directory or Hugging Face repository identifier. device : str, default "auto" Target hardware compute accelerator ('auto', 'mps', 'mlx', 'cuda', 'cpu'). fast_exit_threshold : float, default 0.92 Calibrated score threshold for immediate System 1 exit without generative LLM. uncertainty_threshold : float, default 0.55 Uncertainty cutoff below which execution escalates to generative LLM reasoning. phase_gates : dict of str to bool, optional Per-phase gating enablement toggles.

Source code in packages/episteme-pipeline/episteme_pipeline/config.py
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
class DecisionEngineConfig(BaseModel):
    """Configuration for the System 1 Decision Engine (e.g. TypeSafe Jev / Laya).

    Attributes
    ----------
    provider : str, default "none"
        Provider backend identifier ("none", "laya", "transformers", "mock").
    api_key : SecretStr or None, default None
        Optional API key or secret token for remote decision services.
    endpoint_url : str or None, default None
        Optional HTTP/gRPC endpoint for remote decision services.
    timeout_seconds : float, default 2.0
        Per-decision inference timeout in seconds.
    default_confidence_threshold : float, default 0.85
        Default empirical accuracy threshold for fast-exit routing.
    conformal_alpha : float, default 0.05
        Significance level for conformal prediction sets (guaranteeing 1 - alpha coverage).
    stochastic_audit_rate : float, default 0.02
        Proportion of fast-exit decisions randomly escalated to System 2 to audit calibration drift.
    fallback_to_llm : bool, default True
        Whether to fall back to generative LLM execution if the decision engine fails or has low confidence.
    model_checkpoint : str, default "aac6fef/laya-mlx"
        Local weight directory or Hugging Face repository identifier.
    device : str, default "auto"
        Target hardware compute accelerator ('auto', 'mps', 'mlx', 'cuda', 'cpu').
    fast_exit_threshold : float, default 0.92
        Calibrated score threshold for immediate System 1 exit without generative LLM.
    uncertainty_threshold : float, default 0.55
        Uncertainty cutoff below which execution escalates to generative LLM reasoning.
    phase_gates : dict of str to bool, optional
        Per-phase gating enablement toggles.
    """

    provider: str = "none"
    api_key: SecretStr | None = None
    endpoint_url: str | None = None
    timeout_seconds: float = 2.0
    default_confidence_threshold: float = 0.85
    conformal_alpha: float = 0.05
    stochastic_audit_rate: float = 0.02
    fallback_to_llm: bool = True
    model_checkpoint: str = "aac6fef/laya-mlx"
    device: str = "auto"
    fast_exit_threshold: float = 0.92
    uncertainty_threshold: float = 0.55
    phase_gates: dict[str, bool] = Field(
        default_factory=lambda: {
            "phase2_entity_discovery": True,
            "phase3_global_relations": True,
            "phase4_argument_mining": True,
            "phase4_entity_maturation": True,
            "phase5_fusion": True,
            "phase6_theorynet": True,
        }
    )

Phase-Specific Configurations

Phase 1 Configuration

Settings for the data foundation phase including document processing and chunking.

Bases: BaseModel

Source code in packages/episteme-pipeline/episteme_pipeline/config.py
135
136
137
138
class Phase1Config(BaseModel):
    chunk_size: int = 1024
    chunk_overlap: int = 128
    provenance_enabled: bool = True

Phase 2 Configuration

Settings for entity discovery including NER prompts and entity linking parameters.

Bases: BaseModel

Source code in packages/episteme-pipeline/episteme_pipeline/config.py
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
class Phase2Config(BaseModel):
    top_k_linking_candidates: int = 10
    linking_confidence_threshold: float = 0.85
    ner_confidence_threshold: float = 0.0
    local_relation_confidence_threshold: float = 0.0
    batch_size: int = 10
    ner_prompts: StructuredPromptBundle = Field(default_factory=lambda: StructuredPromptBundle(
        direct_template=NER_DIRECT_PROMPT,
        reasoning_template=NER_REASONING_PROMPT,
        format_template=NER_FORMAT_PROMPT,
        gleaning_template=NER_GLEANING_PROMPT,
        decision_template=DECISION_GLEANING_QUESTION,
        name="ner_extraction",
    ))
    ner_decoding_strategy: StructuredDecodingStrategy = StructuredDecodingStrategy.NL_TO_FORMAT
    entity_linking_prompt_template: str = ENTITY_LINKING_PROMPT
    entity_linking_prompts: StructuredPromptBundle = Field(default_factory=lambda: StructuredPromptBundle(
        direct_template=ENTITY_LINKING_PROMPT,
        name="entity_linking",
    ))
    jev_ooo_threshold: float = 0.75
    conformal_linking_alpha: float = 0.05
    gleaning: GleaningConfig = Field(default_factory=GleaningConfig)

Phase 3 Configuration

Settings for relation extraction including global relation discovery parameters.

Bases: BaseModel

Source code in packages/episteme-pipeline/episteme_pipeline/config.py
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
class Phase3Config(BaseModel):
    batch_size: int = 50
    global_relation_confidence_threshold: float = 0.7
    max_candidates_per_entity_pair: int = 200
    subgraph_depth: int = 2
    global_relation_prompts: StructuredPromptBundle = Field(default_factory=lambda: StructuredPromptBundle(
        direct_template=GLOBAL_RELATION_DIRECT_PROMPT,
        reasoning_template=GLOBAL_RELATION_REASONING_PROMPT,
        format_template=GLOBAL_RELATION_FORMAT_PROMPT,
        decision_template=PAIR_GATING_DECISION_PROMPT,
        name="global_relation",
    ))
    global_relation_decoding_strategy: StructuredDecodingStrategy = StructuredDecodingStrategy.NL_TO_FORMAT
    dense_similarity_threshold: float = 0.5
    reranker_threshold: float = 0.6
    trace_dense_retrieval: bool = True
    use_jev_reranker: bool = False
    use_jev_pair_gating: bool = False
    pair_gating_threshold: float = 0.60
    pair_gating_audit_rate: float = 0.02

Phase 3b Configuration

Settings for latent graph consolidation including distance and similarity thresholds.

Bases: BaseModel

Configuration for Phase 3b: Latent Graph Consolidation.

Attributes

enabled : bool, default True Whether Phase 3b latent consolidation is enabled. dense_similarity_threshold : float, default 0.85 The minimum cosine similarity between L2 entity embeddings to consider them candidates for consolidation. relation_overlap_threshold : float, default 0.8 The minimum Jaccard similarity of Phase 3 relation edges required to commit a SAME_AS edge between candidates. A conservative default ensures distinct but related entities are not incorrectly merged. verification : ConsolidationVerificationConfig Sub-configuration for calibrated borderline pair and cluster verification.

Source code in packages/episteme-pipeline/episteme_pipeline/config.py
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
class Phase3bConfig(BaseModel):
    """Configuration for Phase 3b: Latent Graph Consolidation.

    Attributes
    ----------
    enabled : bool, default True
        Whether Phase 3b latent consolidation is enabled.
    dense_similarity_threshold : float, default 0.85
        The minimum cosine similarity between L2 entity embeddings to consider
        them candidates for consolidation.
    relation_overlap_threshold : float, default 0.8
        The minimum Jaccard similarity of Phase 3 relation edges required to
        commit a SAME_AS edge between candidates. A conservative default
        ensures distinct but related entities are not incorrectly merged.
    verification : ConsolidationVerificationConfig
        Sub-configuration for calibrated borderline pair and cluster verification.
    """

    enabled: bool = True
    dense_similarity_threshold: float = 0.85
    relation_overlap_threshold: float = 0.8
    verification: ConsolidationVerificationConfig = Field(default_factory=ConsolidationVerificationConfig)

Phase 4: Entity Maturation Configuration

Settings for entity maturation including centroid selection and description synthesis parameters.

Bases: BaseModel

Configuration for Phase 4: Entity Maturation (epistemic synthesis).

Attributes

maturation_top_k : int, default 5 The number of representative textual envelopes to retrieve closest to the geometric centroid for LLM synthesis. batch_size : int, default 10 The number of entities to synthesize concurrently via the LLM API. entity_synthesis_prompts : StructuredPromptBundle The prompt bundle used when calling the LLM to synthesize a mature entity description. entity_synthesis_decoding_strategy : StructuredDecodingStrategy Which decoding strategy the synthesis call routes through.

Source code in packages/episteme-pipeline/episteme_pipeline/config.py
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
class Phase4EntityMaturationConfig(BaseModel):
    """Configuration for Phase 4: Entity Maturation (epistemic synthesis).

    Attributes
    ----------
    maturation_top_k : int, default 5
        The number of representative textual envelopes to retrieve closest to the
        geometric centroid for LLM synthesis.
    batch_size : int, default 10
        The number of entities to synthesize concurrently via the LLM API.
    entity_synthesis_prompts : StructuredPromptBundle
        The prompt bundle used when calling the LLM to synthesize a mature
        entity description.
    entity_synthesis_decoding_strategy : StructuredDecodingStrategy
        Which decoding strategy the synthesis call routes through.
    """
    maturation_top_k: int = 5
    batch_size: int = 10
    entity_synthesis_prompts: StructuredPromptBundle = Field(default_factory=lambda: StructuredPromptBundle(
        direct_template=ENTITY_SYNTHESIS_PROMPT,
        name="entity_synthesis",
    ))
    entity_synthesis_decoding_strategy: StructuredDecodingStrategy = StructuredDecodingStrategy.DIRECT

Phase 4: Argument Mining Configuration

Settings for argument mining including ADU segmentation and classification parameters.

Bases: BaseModel

Source code in packages/episteme-pipeline/episteme_pipeline/config.py
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
class Phase4Config(BaseModel):
    adu_segmentation_prompt_template: str = ADU_SEGMENTATION_PROMPT
    adu_segmentation_prompts: StructuredPromptBundle = Field(default_factory=lambda: StructuredPromptBundle(
        direct_template=ADU_SEGMENTATION_PROMPT,
        name="adu_segmentation",
    ))
    adu_confidence_threshold: float = 0.0
    acc_confidence_threshold: float = 0.0
    batch_size: int = 10
    modal_resolver: ModalResolverConfig = Field(default_factory=lambda: ModalResolverConfig())
    acc_prompts: StructuredPromptBundle = Field(default_factory=lambda: StructuredPromptBundle(
        direct_template=ACC_DIRECT_PROMPT,
        reasoning_template=ACC_REASONING_PROMPT,
        format_template=ACC_FORMAT_PROMPT,
        decision_template=DECISION_ACC_QUESTION,
        decision_criteria=DECISION_ACC_CRITERIA,
        name="acc_classification",
    ))
    acc_decoding_strategy: StructuredDecodingStrategy = StructuredDecodingStrategy.NL_TO_FORMAT
    arc_prompts: StructuredPromptBundle = Field(default_factory=lambda: StructuredPromptBundle(
        direct_template=ARC_DIRECT_PROMPT,
        reasoning_template=ARC_REASONING_PROMPT,
        format_template=ARC_FORMAT_PROMPT,
        decision_template=DECISION_ARC_QUESTION,
        decision_criteria=DECISION_ARC_CRITERIA,
        name="arc_classification",
    ))
    arc_decoding_strategy: StructuredDecodingStrategy = StructuredDecodingStrategy.NL_TO_FORMAT
    arc_confidence_threshold: float = 0.65
    arc_subgraph_depth: int = 2
    arc_max_candidates_per_component: int = 10
    arc_use_priority_rank: bool = False
    adu_markup_open: str = "<AC"
    adu_markup_close: str = ">"
    triage_confidence_threshold: float = 0.85
    conformal_alpha: float = 0.05
    stochastic_audit_rate: float = 0.02
    pass_priors_to_llm: bool = True
    gleaning: GleaningConfig = Field(default_factory=GleaningConfig)

Phase 5 Configuration

Settings for alignment fusion including entity matching thresholds.

Bases: BaseModel

Configuration for Phase 5: Argument Web & Theory Fusion.

Source code in packages/episteme-pipeline/episteme_pipeline/config.py
373
374
375
376
377
378
379
380
class Phase5Config(BaseModel):
    """Configuration for Phase 5: Argument Web & Theory Fusion."""

    argument_clustering_enabled: bool = True
    theory_fusion_enabled: bool = False
    fusion_similarity_threshold: float = 0.85
    cluster_layer: Literal["theory_atoms", "l2_entities", "both"] = "theory_atoms"
    gating: FusionGatingConfig = Field(default_factory=FusionGatingConfig)

Graph Schema Configuration

Defines the expected structure and constraints for the constructed theory graph.

Bases: BaseModel

Decoupled schema configuration — all node/edge types the pipeline uses.

Pass a custom instance to PipelineConfig to override the defaults for a different domain. Prompt templates receive these lists as {entity_types} and {relation_types} at runtime.

Source code in packages/episteme-pipeline/episteme_pipeline/schema/default_schema.py
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
class SchemaConfig(BaseModel):
    """
    Decoupled schema configuration — all node/edge types the pipeline uses.

    Pass a custom instance to PipelineConfig to override the defaults for a
    different domain. Prompt templates receive these lists as {entity_types}
    and {relation_types} at runtime.
    """

    version: str = "v1"
    node_types: list[str] = Field(default_factory=lambda: list(L2_NODE_TYPES))
    relation_types: list[str] = Field(default_factory=lambda: list(L2_RELATION_TYPES))
    node_definitions: dict[str, str] = Field(default_factory=lambda: dict(L2_NODE_DEFINITIONS))
    relation_definitions: dict[str, str] = Field(default_factory=lambda: dict(L2_RELATION_DEFINITIONS))
    component_types: list[str] = Field(default_factory=lambda: list(L3_COMPONENT_TYPES))
    argument_relation_types: list[str] = Field(default_factory=lambda: list(L3_RELATION_TYPES))
    component_definitions: dict[str, str] = Field(default_factory=lambda: dict(L3_COMPONENT_DEFINITIONS))
    argument_relation_definitions: dict[str, str] = Field(default_factory=lambda: dict(L3_RELATION_DEFINITIONS))
    relation_polarities: dict[str, int] = Field(default_factory=lambda: dict(RELATION_POLARITIES))
    component_partitions: dict[str, str] = Field(default_factory=lambda: dict(COMPONENT_PARTITIONS))
    scope_types: list[str] = Field(default_factory=lambda: list(SCOPE_TYPES))
    epistemic_statuses: list[str] = Field(default_factory=lambda: list(EPISTEMIC_STATUSES))

    def node_types_str(self) -> str:
        return ", ".join(self.node_types)

    def relation_types_str(self) -> str:
        return ", ".join(self.relation_types)

    def component_types_str(self) -> str:
        import json
        payload = {k: self.component_definitions.get(k, "No description provided.") for k in self.component_types}
        return json.dumps(payload, indent=2, ensure_ascii=False)

    def argument_relation_types_str(self) -> str:
        import json
        payload = {k: self.argument_relation_definitions.get(k, "No description provided.") for k in self.argument_relation_types}
        return json.dumps(payload, indent=2, ensure_ascii=False)

    def get_relations_with_polarity(self, polarity: int | None = None) -> list[str]:
        """Return relation names filtered by epistemic polarity.

        Parameters
        ----------
        polarity : int or None, default None
            +1 for positive (support/entailment), -1 for negative (attack/undercut),
            0 for neutral/structural. If None, returns all non-zero dialectical relations (+1 and -1).

        Returns
        -------
        list of str
            Relation type names matching the requested polarity.
        """
        if polarity is None:
            return [r for r, p in self.relation_polarities.items() if p != 0]
        return [r for r, p in self.relation_polarities.items() if p == polarity]

    def get_support_relations(self) -> list[str]:
        """Return all relation names with positive support polarity (+1).

        Returns
        -------
        list of str
            Relation types with polarity +1.
        """
        return self.get_relations_with_polarity(1)

    def get_attack_relations(self) -> list[str]:
        """Return all relation names with negative attack polarity (-1).

        Returns
        -------
        list of str
            Relation types with polarity -1.
        """
        return self.get_relations_with_polarity(-1)

    def is_support_relation(self, relation_type: str) -> bool:
        """Check whether a relation type has positive support polarity (+1).

        Parameters
        ----------
        relation_type : str
            Relation type to evaluate.

        Returns
        -------
        bool
            True if relation has polarity +1.
        """
        return self.relation_polarities.get(relation_type, self.relation_polarities.get(relation_type.upper(), 0)) > 0

    def is_attack_relation(self, relation_type: str) -> bool:
        """Check whether a relation type has negative attack polarity (-1).

        Parameters
        ----------
        relation_type : str
            Relation type to evaluate.

        Returns
        -------
        bool
            True if relation has polarity -1.
        """
        return self.relation_polarities.get(relation_type, self.relation_polarities.get(relation_type.upper(), 0)) < 0

    def resolve_relation_type(self, candidate: str) -> str | None:
        """Resolve a candidate relation name or dialectical stance to a configured argument relation.

        Matches candidate names directly against argument_relation_types or dynamically
        maps positive/negative stance labels (e.g. 'SUPPORTS' -> 'SUPPORTS_ARG') based
        on identical polarity alignment.

        Parameters
        ----------
        candidate : str
            Candidate relation or stance identifier.

        Returns
        -------
        str or None
            Matching canonical relation type, or None if unmapped.
        """
        if not candidate:
            return None
        cand_upper = candidate.upper()
        if candidate in self.argument_relation_types:
            return candidate
        if cand_upper in self.argument_relation_types:
            return cand_upper

        cand_pol = self.relation_polarities.get(cand_upper, self.relation_polarities.get(candidate, 0))
        if cand_pol != 0:
            for r in self.argument_relation_types:
                if self.relation_polarities.get(r) == cand_pol:
                    return r
        return None

get_attack_relations()

Return all relation names with negative attack polarity (-1).

Returns

list of str Relation types with polarity -1.

Source code in packages/episteme-pipeline/episteme_pipeline/schema/default_schema.py
192
193
194
195
196
197
198
199
200
def get_attack_relations(self) -> list[str]:
    """Return all relation names with negative attack polarity (-1).

    Returns
    -------
    list of str
        Relation types with polarity -1.
    """
    return self.get_relations_with_polarity(-1)

get_relations_with_polarity(polarity=None)

Return relation names filtered by epistemic polarity.

Parameters

polarity : int or None, default None +1 for positive (support/entailment), -1 for negative (attack/undercut), 0 for neutral/structural. If None, returns all non-zero dialectical relations (+1 and -1).

Returns

list of str Relation type names matching the requested polarity.

Source code in packages/episteme-pipeline/episteme_pipeline/schema/default_schema.py
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
def get_relations_with_polarity(self, polarity: int | None = None) -> list[str]:
    """Return relation names filtered by epistemic polarity.

    Parameters
    ----------
    polarity : int or None, default None
        +1 for positive (support/entailment), -1 for negative (attack/undercut),
        0 for neutral/structural. If None, returns all non-zero dialectical relations (+1 and -1).

    Returns
    -------
    list of str
        Relation type names matching the requested polarity.
    """
    if polarity is None:
        return [r for r, p in self.relation_polarities.items() if p != 0]
    return [r for r, p in self.relation_polarities.items() if p == polarity]

get_support_relations()

Return all relation names with positive support polarity (+1).

Returns

list of str Relation types with polarity +1.

Source code in packages/episteme-pipeline/episteme_pipeline/schema/default_schema.py
182
183
184
185
186
187
188
189
190
def get_support_relations(self) -> list[str]:
    """Return all relation names with positive support polarity (+1).

    Returns
    -------
    list of str
        Relation types with polarity +1.
    """
    return self.get_relations_with_polarity(1)

is_attack_relation(relation_type)

Check whether a relation type has negative attack polarity (-1).

Parameters

relation_type : str Relation type to evaluate.

Returns

bool True if relation has polarity -1.

Source code in packages/episteme-pipeline/episteme_pipeline/schema/default_schema.py
217
218
219
220
221
222
223
224
225
226
227
228
229
230
def is_attack_relation(self, relation_type: str) -> bool:
    """Check whether a relation type has negative attack polarity (-1).

    Parameters
    ----------
    relation_type : str
        Relation type to evaluate.

    Returns
    -------
    bool
        True if relation has polarity -1.
    """
    return self.relation_polarities.get(relation_type, self.relation_polarities.get(relation_type.upper(), 0)) < 0

is_support_relation(relation_type)

Check whether a relation type has positive support polarity (+1).

Parameters

relation_type : str Relation type to evaluate.

Returns

bool True if relation has polarity +1.

Source code in packages/episteme-pipeline/episteme_pipeline/schema/default_schema.py
202
203
204
205
206
207
208
209
210
211
212
213
214
215
def is_support_relation(self, relation_type: str) -> bool:
    """Check whether a relation type has positive support polarity (+1).

    Parameters
    ----------
    relation_type : str
        Relation type to evaluate.

    Returns
    -------
    bool
        True if relation has polarity +1.
    """
    return self.relation_polarities.get(relation_type, self.relation_polarities.get(relation_type.upper(), 0)) > 0

resolve_relation_type(candidate)

Resolve a candidate relation name or dialectical stance to a configured argument relation.

Matches candidate names directly against argument_relation_types or dynamically maps positive/negative stance labels (e.g. 'SUPPORTS' -> 'SUPPORTS_ARG') based on identical polarity alignment.

Parameters

candidate : str Candidate relation or stance identifier.

Returns

str or None Matching canonical relation type, or None if unmapped.

Source code in packages/episteme-pipeline/episteme_pipeline/schema/default_schema.py
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
def resolve_relation_type(self, candidate: str) -> str | None:
    """Resolve a candidate relation name or dialectical stance to a configured argument relation.

    Matches candidate names directly against argument_relation_types or dynamically
    maps positive/negative stance labels (e.g. 'SUPPORTS' -> 'SUPPORTS_ARG') based
    on identical polarity alignment.

    Parameters
    ----------
    candidate : str
        Candidate relation or stance identifier.

    Returns
    -------
    str or None
        Matching canonical relation type, or None if unmapped.
    """
    if not candidate:
        return None
    cand_upper = candidate.upper()
    if candidate in self.argument_relation_types:
        return candidate
    if cand_upper in self.argument_relation_types:
        return cand_upper

    cand_pol = self.relation_polarities.get(cand_upper, self.relation_polarities.get(candidate, 0))
    if cand_pol != 0:
        for r in self.argument_relation_types:
            if self.relation_polarities.get(r) == cand_pol:
                return r
    return None