ontocast.agent.plan_ontology¶
Plan a document's ontology before its units render.
One LLM call per document sees the whole text (within a budget) and the
catalog's terms, and proposes the classes and properties the document adds to
its domain. The proposals are checked against the whole catalog without a
model (:func:~ontocast.tool.ontology_validation.plan.check_plan), and the
accepted plan is handed to every unit: units mint from it, and anything they
mint outside it is decided at reduce.
Attributes¶
logger = logging.getLogger(__name__)
module-attribute
¶
Classes¶
Functions:¶
attach_neighbours(plan, tools, labels, top_k)
async
¶
Add the vector index's nearest catalog terms to each minted plan term.
Skipped when no vector store is ready. A failed lookup leaves the plan unchanged: neighbours are a hint, not a check.
Source code in ontocast/agent/plan_ontology.py
plan_ontology(state, tools)
async
¶
Set state.ontology_plan for a run that renders an ontology.
No plan (None) when planning is off, the run renders no ontology, the
document has no home ontology or no text, or the call fails: units then
mint as they would without one.
Source code in ontocast/agent/plan_ontology.py
propose_plan(state, tools, *, home, text, term_sheet, max_terms)
async
¶
One structured LLM call: the document's term proposals.