Skip to content

ontocast.stategraph.routing

route_after_chunk(state)

Route after chunk prepare: optional summarization or extraction.

Source code in ontocast/stategraph/routing.py
def route_after_chunk(state: AgentState) -> str:
    """Route after chunk prepare: optional summarization or extraction."""
    if state.use_summarization:
        return WorkflowNode.SUMMARIZE_CHUNKS
    return route_after_tag_or_chunk(state)

route_after_convert(state)

Route after document conversion: always chunk next.

Source code in ontocast/stategraph/routing.py
def route_after_convert(state: AgentState) -> str:
    """Route after document conversion: always chunk next."""
    return WorkflowNode.CHUNK

route_after_ontology_consolidation(state)

Route after ontology stage to the ontology-only structural check.

Source code in ontocast/stategraph/routing.py
def route_after_ontology_consolidation(state: AgentState) -> str:
    """Route after ontology stage to the ontology-only structural check."""
    return WorkflowNode.STRUCTURAL_CHECK

route_after_tag_or_chunk(state)

Route after tagging/summarization: ontology map-reduce vs facts-only.

Source code in ontocast/stategraph/routing.py
5
6
7
8
9
def route_after_tag_or_chunk(state: AgentState) -> str:
    """Route after tagging/summarization: ontology map-reduce vs facts-only."""
    if not state.render_ontology:
        return WorkflowNode.RENDER_FACTS
    return WorkflowNode.RENDER_ONTOLOGY_UPDATE