yggdrasil.loki.planning¶
planning ¶
Structured agent planning — tasks, personas, and required skills.
Replaces the old free-form routing dict with a small, stable class hierarchy:
- :class:
AgentTask— the classification of a request: its category, the persona to embody (data engineer, analyst, software engineer, trader, confessor, companion, …), the required skills, and data/time-series flags. - :class:
AgentPlan— an :class:AgentTaskplus the execution decision: the action to take, an optional specialist agent, and a source URL.
:class:AgentPlan is mapping-compatible (plan["action"] / plan.get(...))
so it drops in wherever the old dict was used, while giving callers typed
fields, a persona system prompt, and to_dict().
AgentTask
dataclass
¶
AgentTask(
text: str,
category: str = "chat",
persona: str = "assistant",
required_skills: tuple[str, ...] = (),
data: bool = False,
timeseries: bool = False,
why: str = "",
)
The classification of a request — what kind of work, by whom, with what.
persona_prompt ¶
The system prompt that makes the agent embody :attr:persona.
AgentPlan
dataclass
¶
AgentPlan(
text: str,
category: str = "chat",
persona: str = "assistant",
required_skills: tuple[str, ...] = (),
data: bool = False,
timeseries: bool = False,
why: str = "",
action: str = "reason",
specialist: Optional[str] = None,
url: Optional[str] = None,
skill: Optional[str] = None,
skill_kwargs: dict = dict(),
)
classify_persona ¶
Best-matching persona for text by signal hits ("assistant" default).
skills_for ¶
Required skills for a category (data requests always include tabular).