ontocast.stategraph.unit_pipeline¶
Simplified single-unit agentic pipeline.
This module provides :func:run_unit_pipeline, a lightweight wrapper around
:func:~ontocast.stategraph.atomic.ontology_loop and
:func:~ontocast.stategraph.atomic.facts_loop that processes the entire input
as one content unit without chunking, normalization, or the full LangGraph
workflow.
The pipeline is self-contained: it accepts a raw AgentState (with
raw_input populated) and handles document conversion internally, mirroring
the CONVERT_TO_MD first-node contract of the full
:func:~ontocast.stategraph.create.create_agent_graph workflow.
The loops run sequentially:
- Conversion: raw bytes in
raw_inputare converted to text via :func:~ontocast.agent.convert_document.convert_document. - Ontology loop (if
render_modeincludes ontology): extracts / improves ontology from the input text. The initial ontology context is guided byagent_state.ontology_context_modevia the standard :func:~ontocast.stategraph.context_resolver.resolve_unit_ontology_contextcall inside the loop. - Facts loop (if
render_modeincludes facts): extracts facts from the input text. When the ontology loop ran, its working snapshot is passed as pre-resolved context so facts reuse that output instead of re-querying the catalog or triple store.
DocumentConversionError
¶
Bases: Exception
Raised by :func:run_unit_pipeline when document conversion fails.
Source code in ontocast/stategraph/unit_pipeline.py
run_unit_pipeline(agent_state, tools)
async
¶
Run conversion, ontology, and facts loops for a single content unit.
Source code in ontocast/stategraph/unit_pipeline.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 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 | |