uv add noesis or pip install noesis. Import as import noesis as ns.
Core functions
ns.run()
Execute a baseline episode using the current session.Task or goal for the episode.
Seed for reproducibility.
True enables the default intuition policy, False disables it, or pass an Intuition implementation.Metadata tags attached to the episode.
Optional runtime context. If provided, execution bypasses the default session.
Workspace root to snapshot for verification.
Verification assertions to evaluate against the workspace.
"ep_01JH6Z2V9Q2K6Y6N0QZ7K2QW8C")
Example:
context is a RuntimeContext (a ports container). For metadata, prefer tags={...}.
ns.solve()
Execute an episode through a specific adapter/graph.Adapter name/import path or callable to execute the task.
Verification helpers
Use these helpers to build verification specs forverify=....
ns.summary.read()
Load the summary for an episode.ns.events.read()
Load the event timeline for an episode.stream=True to iterate lazily.
noesis.io.list_runs()
List recent episodes (newest first).episode_id, task, started_at, flags, success, manifest, and manifest_status (when strict_manifest=True).
In v1.0.0,
ns.list_runs() exists as a deprecated legacy alias. Prefer noesis.io.list_runs().noesis.io.last()
Get the most recent episode ID.ns.set() / ns.get()
Update or read the current configuration snapshot.runs_dir, planner_mode (meta/minimal), direction_min_confidence, governance_mode (off/audit/enforce), governance_failure_policy, governance_timeout_ms (reserved/unused), policy_aliases, learn_home, learn_mode, learn_auto_apply_min_confidence, learn_auto_apply_min_successes, intuition_mode, timeout_sec, prompt_provenance_enabled, prompt_provenance_mode, agents (reserved/unused), tasks (reserved/unused).
Intuition and policies
DirectedIntuition
Base class for policies that can emit hints, interventions, or vetoes.hint(advice, confidence=0.5, rationale=None, evidence_ids=None, target="input", scope="episode")intervene(advice, patch, confidence=0.6, rationale=None, evidence_ids=None, target="input", scope="episode")veto(advice, confidence=0.8, rationale=None, evidence_ids=None, target="plan", scope="episode")
IntuitionEvent (schema)
Fields includekind, advice, confidence, policy_id, policy_version, policy_kind, applied, rationale, evidence_ids, patch, target, scope, and blocking (plus schema_version).
NoesisVeto
Raised when a policy vetoes an episode.Governance
Pre-act governance evaluates proposed actions before execution. Configure vians.set(governance_mode=...).
GovernanceMode
GovernanceFailurePolicy
audit → fail_open, enforce → fail_closed.
GovernanceDecision
GovernanceResult
Immutable result from governance evaluation.Custom governors
Custom governor injection is not part of the v1.0.0 runtime/CLI execution surface. Governance is configured via
ns.set(governance_mode=..., governance_failure_policy=...) and uses the built-in pre-act governor.Governed side effects (pre-act gating)
ns.governed_act(...) is the operating-system boundary for side effects. It emits:
action_candidate → governance → act- or, on enforced veto:
action_candidate → governance → terminate(noact)
Session management
Use sessions when you need isolated configuration, explicit lifecycle control, or registered ports.SessionBuilder reads config from env/TOML; you can also inject ports before building. Within a session, run/solve behave like the module-level helpers but share the session’s config and runtime context.
Module facades
ns.summary.read(episode_id, context=None): readsummary.json.ns.events.read(episode_id, stream=False, context=None): iterate events; passstream=Trueto lazily consume.ns.context: helpers for building runtime contexts and attaching ports (advanced use — see the “Add a memory port” guide).ns.learn: learning signal emission and proposal management (see Learning section below).
Learning
The learning subsystem records proposals from episode outcomes for policy improvement.LearnMode
ns.set(learn_mode="record").
LearnStatus
LearnProposal
Dataclass for learning signals. Containskind, payload, confidence, status, and metadata.
In v1.0.0, learning proposals are emitted automatically during summary finalization when
learn_mode is enabled. When proposals are generated, they are written to learn.jsonl for the episode and tracked under learn_home.Helper functions
Episode index
EpisodeIndex
Manage an on-disk episode manifest (and optional FAISS similarity index).append(episode_id, summary_path, state_path, status, task, using, provenance=None, embedding=None)iter(include_expired=False)→ iterator ofEpisodeRecordsearch(embedding, k=5)→ similarity matches (empty if FAISS disabled)vacuum()→ prune expired records
Type definitions
IntuitionEvent
Returned by policy methods. See schema above for fields.Determinism utilities
For reproducible testing and replay, Noesis exports deterministic clock and RNG utilities:Environment variables
| Variable | Description |
|---|---|
NOESIS_RUNS_DIR | Artifact storage directory |
NOESIS_PLANNER | Planner mode (meta/minimal) |
NOESIS_DIRECTION_MIN_CONFIDENCE | Direction minimum confidence |
NOESIS_GOVERNANCE_MODE | Governance mode (off/audit/enforce) |
NOESIS_GOVERNANCE_FAILURE_POLICY | Failure policy (fail_open/fail_closed) |
NOESIS_GOVERNANCE_TIMEOUT_MS | Reserved/unused in v1.0.0 (parsed into config) |
NOESIS_INTUITION_MODE | Intuition mode |
NOESIS_TIMEOUT_SEC | Default timeout (seconds) |
NOESIS_LEARN_HOME | Learning artifacts directory |
NOESIS_LEARN_MODE | Learning mode |
NOESIS_LEARN_AUTO_APPLY_MIN_SUCCESSES | Minimum successes before auto-apply |
NOESIS_LEARN_AUTO_APPLY_MIN_CONFIDENCE | Confidence threshold for auto-apply |
NOESIS_PROMPT_PROVENANCE_ENABLED | Enable prompt provenance (true/false) |
NOESIS_PROMPT_PROVENANCE_MODE | Prompt provenance mode |
NOESIS_AGENTS | Reserved/unused in v1.0.0 (parsed into config) |
NOESIS_TASKS | Reserved/unused in v1.0.0 (parsed into config) |

