mixle.substrate.reasoner module

Reasoner facade over a substrate, skills, and configured actions.

investigate() runs the action loop. Reasoner packages that loop behind ask(question) by wiring retrieval over a substrate, compute actions for registered skills, and any additional simulator, creator, or delegate actions supplied by the caller.

The result of ask is an Investigation carrying the selected evidence, action trace, answer, and abstention state.

class Reasoner(answerer, *, substrate=None, skills=None, actions=None, budget_cost=None, min_confidence=0.15, retrieve_min_score=0.0, scorer=None, telemetry=None)[source]

Bases: object

A configured reasoner: a knowledge store + skills + actions, asked questions through one method.

Parameters:
  • answerer (Callable[[str, str], str])

  • substrate (Substrate | None)

  • skills (Any)

  • actions (list[Action] | None)

  • budget_cost (float | None)

  • min_confidence (float)

  • retrieve_min_score (float)

  • scorer (Callable[[Action, str], float] | None)

  • telemetry (Any)

property actions: list[Action]

The current action space (retrieve + one compute per skill + attached simulators/creators).

add_action(action)[source]

Attach an extra action (a simulator, creator, or delegate); returns self for chaining.

Parameters:

action (Action)

Return type:

Reasoner

use_policy(scorer)[source]

Route by a learned acquisition policy instead of the lexical prior. Chainable.

Parameters:

scorer (Callable[[Action, str], float])

Return type:

Reasoner

ask(question, *, verify=False, **overrides)[source]

Answer question over the configured action space, or abstain. overrides pass through to investigate() (e.g. budget_cost, min_confidence, target_confidence, max_actions).

With verify=True and a substrate configured, the (non-abstained) answer is run back through check_factuality() and the FactualityReceipt is attached to Investigation.factuality – the reasoner grounds its own answer’s claims and reports which it can cite. It does not suppress the answer; the receipt is there for the caller to gate on.

Parameters:
Return type:

Investigation