Agents

End-to-End Memory + Consequence Agent

This reference builds a release-support agent. It remembers reviewed operational history, retrieves bounded context, compares release options, records the selected scenario, waits for approval when required, observes the actual result, and creates a reviewable lesson.

Reference lifecycle

flowchart LR
  A["Install approved industry knowledge"] --> B["Remember reviewed history"]
  B --> C["Build bounded agent context"]
  C --> D["Plan bounded scenarios"]
  D --> E["Record selected decision"]
  E --> F{"Approval required?"}
  F -->|Yes| G["Authorized human approval"]
  F -->|No| H["Application acts separately"]
  G --> H
  H --> I["Observe trusted outcome evidence"]
  I --> J["Reflect and review lesson"]
  J --> B

The agent never treats a recommendation as authorization. External action remains in the application and requires the existing identity, policy, approval, idempotency, and recovery controls.

Implement in every supported language

Each implementation covers the same release-support workflow. The official SDK handles memory calls. TypeScript exposes typed Consequence methods; Python, PHP, Go, and Rust call the same public Consequence REST endpoints through a small authenticated helper until those SDKs gain typed parity.

LanguageImplementation
TypeScript / JavaScriptOfficial SDK for memory, industry installation, and Consequence
PythonPython SDK plus standard-library REST helper
PHPPHP SDK plus authenticated REST helper
GoGo SDK plus net/http helper
RustRust SDK plus reqwest helper

Configuration-only examples—CLI commands, MCP manifests, JSON policy, and CI YAML—are language-neutral and are not duplicated across SDK languages.

Shared environment contract

NEUTRON_API_URL
NEUTRON_WORKSPACE_API_KEY
NEUTRON_API_TOKEN
NEUTRON_APPROVER_TOKEN
NEUTRON_INTERNAL_TOKEN
  • Use the workspace key only to install approved industry content.
  • Use the Nucleus token for normal memory, context, planning, decision, and observation calls.
  • Use an approver token only after the application verifies the human approver's identity, role, scope, and current intent.
  • Use the internal token for reviewed reflection operations unavailable to lower-authority agents.

Shared release decision boundary

All implementations:

  • use Nucleus checkout-platform;
  • use stable scopes for industry knowledge, service state, release history, and production-change policy;
  • request a bounded depth-10 plan with at most eight scenarios and an eight-second runtime budget;
  • preserve rollback capability and the approved database lock threshold;
  • record the selected scenario but do not execute it;
  • attach only trusted observations after the separately authorized pilot;
  • review the reflection lesson before any durable memory promotion.

Production checklist

  • Keep workspace installation, agent recall, human approval, internal reflection, and external execution credentials separate.
  • Use idempotency keys for retried plans and action adapters.
  • Keep depth, runtime, nodes, branches, model calls, scenarios, and cost bounded.
  • Require current source evidence and specialist solvers for safety-critical calculations.
  • Audit every decision, approval, observation, reflection, deletion, and external action.
  • Tombstone lifecycle data when its user, scope, or retention boundary requires deletion.