ontocast.stategraph¶
Agent module for OntoCast.
This module provides a collection of agents that handle various aspects of ontology processing, including document conversion, text chunking, fact aggregation, and ontology management. Each agent is designed to perform a specific task in the ontology processing pipeline.
build_agent_graph(tools)
¶
Build the document-level agent graph without compiling it.
Use this when you need to attach a checkpointer or store yourself, inspect
the topology, or splice extra nodes in before compiling. Most callers want
:func:create_agent_graph, which compiles for you.
CONVERT -> CHUNK (prepare: segment, tag, filter, size) ->
(conditional extraction)
Per-unit ontology context is assembled inside ontology_loop (not at a
document-level select node). For ONTOLOGY_AND_FACTS, the full ontology
block completes before the facts map runs; facts use the merged document
ontology from AgentState.
Summarization has no node of its own: a unit's summary depends only on that unit, so it runs inside the extraction fan-outs. As a stage it was a barrier that made every unit wait for the slowest summary before any extraction could begin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tools
|
ToolBox
|
The dependency container bound into every node. |
required |
Returns:
| Type | Description |
|---|---|
StateGraph
|
The uncompiled :class: |
Source code in ontocast/stategraph/create.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 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 | |
create_agent_graph(tools, *, checkpointer=None, store=None, name=None)
¶
Create and compile the parallel map/reduce agent graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tools
|
ToolBox
|
The dependency container bound into every node. |
required |
checkpointer
|
BaseCheckpointSaver | None
|
Optional LangGraph checkpointer for durable execution. |
None
|
store
|
BaseStore | None
|
Optional LangGraph store for cross-thread memory. |
None
|
name
|
str | None
|
Optional graph name. Set this when embedding the graph as a node
in a parent graph -- LangGraph shows unnamed subgraphs as
|
None
|
Returns:
| Type | Description |
|---|---|
CompiledStateGraph
|
The compiled graph, ready for |
Source code in ontocast/stategraph/create.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 | |