classPipelineConfig(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)@classmethoddeffrom_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. """returncls(models=ModelConfig.from_env(),**overrides)@propertydefdefault_embedding_model(self)->str:"""Deprecated alias for ``config.models.embedding_model``."""returnself.models.embedding_model@propertydefdefault_reranker_model(self)->str:"""Deprecated alias for ``config.models.reranker_model``."""returnself.models.reranker_model
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
348349350351352353354355356
@classmethoddeffrom_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. """returncls(models=ModelConfig.from_env(),**overrides)
classExecutionConfig(BaseModel):persist_run_manifests:bool=Truepersist_phase1_artifacts:bool=Truepersist_phase2_artifacts:bool=Truepersist_phase3_artifacts:bool=Truepersist_phase3b_artifacts:bool=Truepersist_phase4_maturation_artifacts:bool=Truepersist_phase4_artifacts:bool=Truepersist_phase5_artifacts:bool=Truepersist_phase6_artifacts:bool=Truepersist_theoretical_enrichment_artifacts:bool=Trueproject_artifacts_to_graph:bool=Falseallow_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"
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.
Source code in packages/episteme-pipeline/episteme_pipeline/config.py
165166167168169170171172173174175176177178179180
classPhase3bConfig(BaseModel):"""Configuration for Phase 3b: Latent Graph Consolidation. Attributes ---------- 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. """enabled:bool=Truedense_similarity_threshold:float=0.85relation_overlap_threshold:float=0.8
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
classPhase4EntityMaturationConfig(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=5batch_size:int=10entity_synthesis_prompts:StructuredPromptBundle=Field(default_factory=lambda:StructuredPromptBundle(direct_template=ENTITY_SYNTHESIS_PROMPT,name="entity_synthesis",))entity_synthesis_decoding_strategy:StructuredDecodingStrategy=StructuredDecodingStrategy.DIRECT
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
classSchemaConfig(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))defnode_types_str(self)->str:return", ".join(self.node_types)defrelation_types_str(self)->str:return", ".join(self.relation_types)defcomponent_types_str(self)->str:importjsonpayload={k:self.component_definitions.get(k,"No description provided.")forkinself.component_types}returnjson.dumps(payload,indent=2,ensure_ascii=False)defargument_relation_types_str(self)->str:importjsonpayload={k:self.argument_relation_definitions.get(k,"No description provided.")forkinself.argument_relation_types}returnjson.dumps(payload,indent=2,ensure_ascii=False)