AGENT SKILL

sme-ann-backprop

Formulate and execute Agentic Neural Network (ANN) textual backpropagation, momentum-smoothed updates, and 4-stage candidate validation to optimize multi-agent DAGs. Do not use for simple linear scripts or deterministic bugs.

License 许可
MIT
最近更新
2026-11-15
Stars
★ 0
Forks
0

01 前言 Front Matter

name
sme-ann-backprop
description
Formulate and execute Agentic Neural Network (ANN) textual backpropagation, momentum-smoothed updates, and 4-stage candidate validation to optimize multi-agent DAGs. Do not use for simple linear scripts or deterministic bugs.

02 资源文件 2

03 SKILL.md 正文

SME ANN Backprop & Self-Evolving Workflow Engine

sme-ann-backprop operationalizes Agentic Neural Network ($\mathcal{ANN}$) textual backpropagation and candidate pool governance for Brain Harness. Distilled from the SME Forensic Gateway (Lawnmower Man v3.0.1), it treats multi-agent workflow DAGs as layered networks where execution errors are backpropagated as structured textual gradients ($\nabla_{\text{text}}$), smoothed via momentum velocity buffers, and gated through a 4-stage validation filter before persistent pool insertion.

Every ANN self-optimization cycle follows a strict five-stage progression:

[1. Trajectory Analysis & Global Loss] → [2. Layerwise Local Gradients] → [3. Momentum Velocity Smoothing] → [4. 4-Stage Candidate Validation] → [5. Candidate Pool Commit & Routing]

See CARD.md for the companion summary card, backpropagation formulas, and verification invariants. Consult /crafting-skills for skill craft standards, /data-topology-mapper for DAG blast radius mapping, and /deep-repo-auditor for repository distillation.


1. Trajectory Analysis & Global Textual Loss ($G_{\text{global}}$)

Inspect the execution transcript of a multi-agent or multi-step workflow to compute the global loss signal:

  1. Loss Quantification:
    • Compute bounded loss score: $$\text{Loss}_{\text{global}} = \frac{\text{Number of Failed Steps / Layers}}{\text{Total Trajectory Steps}} \in [0.0, 1.0]$$
  2. Layer Failure Localization:
    • Extract the specific layer indices $\ell \in [0, N-1]$ that raised exceptions, returned error observation payloads, or failed schema validation.
  3. Inter-Layer Structural Suggestions:
    • Generate high-level routing suggestions and input rewiring instructions to isolate failed dependencies.

Completion criterion: GlobalGradient object emitted with verified loss score, failed layer indices, and structural recommendations.


2. Layerwise Local Textual Gradients ($G_{\text{local},\ell}$)

Formulate local layerwise gradients for each active agent team block $f_{\ell}$:

  1. Combined Loss Computation:
    • Balance global trajectory feedback with local step outcome using mixing parameter $\beta = 0.5$: $$\text{Loss}{\text{combined}} = \beta \cdot \text{Loss}{\text{global}} + (1 - \beta) \cdot \text{Loss}_{\text{local}}$$
  2. Node Prompt Refinement:
    • For failed nodes: Append explicit output schema constraints, parameter validation checks, and error-handling directives.
    • For successful nodes: Optimize for conciseness and logical consistency.
  3. Validator Node Insertion:
    • If structural gaps caused execution failure, insert downstream validation nodes (e.g. node_validator with static analysis or schema check roles).

Completion criterion: LocalGradient synthesized for each affected layer with prompt suggestions and node/edge updates.


3. Momentum Velocity Smoothing (MomentumBuffer)

Smooth prompt and topological updates across iterations to eliminate oscillation:

  1. Update Velocity Tracking:
    • Maintain historical gradient velocity per layer index $\ell$: $$G'{t,\ell} = \alpha \cdot G{t,\ell} + (1 - \alpha) \cdot G_{t-1,\ell} \quad (\alpha = 0.7)$$
  2. Prompt Merge & Stabilization:
    • Merge previous prompt improvements with incoming suggestions to prevent catastrophic forgetting of validated instructions.

Completion criterion: Momentum-smoothed local gradient $G'_{t,\ell}$ produced.


4. 4-Stage Candidate Validation Filter

Gate candidate agent blocks ($f'_{\ell}$) through 4 rigorous verification stages before pool insertion:

  1. Stage 1 (Node Validation):
    • Ensure all nodes declare valid agent identifiers, non-empty role prompts, and required capabilities.
  2. Stage 2 (Edge Validation):
    • Ensure all directed edges connect valid existing vertices; reject dangling links.
  3. Stage 3 (Structural Acyclicity & Deduplication):
    • Run cycle detection to guarantee strictly acyclic DAG execution.
    • Verify candidate structure is unique and not already present in the existing pool.
  4. Stage 4 (Performance Baseline):
    • Confirm projected candidate loss is $\le$ baseline performance threshold.

Completion criterion: 4-stage filter returns is_valid: true. If invalid, failure reason and rejected stage are reported.


5. Candidate Pool Commit & Dynamic Selection

Persist validated candidate team blocks into SQLite WAL candidate pools:

  1. Atomic Insertion:
    • Insert validated block into candidate_pools table ($F_{\ell}$) with unique block_id, layer_index, loss_score, and JSON schema payload.
  2. Dynamic $O(1)$ Team Selection:
    • Select candidate team block minimizing loss score or matching specific task context tags during runtime execution.

Completion criterion: Candidate block saved to SQLite WAL storage and ready for dynamic routing.


In-File Reference & Formulas

  • Global Loss: $\text{Loss}_{\text{global}} = \frac{|\text{Failed Layers}|}{|\text{Total Steps}|}$
  • Combined Layer Loss: $\text{Loss}{\text{combined}} = \beta \cdot \text{Loss}{\text{global}} + (1 - \beta) \cdot \text{Loss}_{\text{local}}$
  • Momentum Smoothing: $G'{t} = \alpha G{t} + (1 - \alpha) G_{t-1}$ where $\alpha = 0.7$
  • Candidate Pool: $F_{\ell} = { f_{1}, f_{2}, \dots, f_{k} }$ persisted in SQLite WAL laboratory.db

The Three Foundational Pillars

1. The Visual Brief

Synthesize findings, structural matrices, and execution DAGs into a self-contained HTML visual brief written to %TEMP%\sme-ann-backprop-<timestamp>.html (or /tmp/sme-ann-backprop-<timestamp>.html on Unix) loading Tailwind CSS and Mermaid.js via CDN. Present the absolute clickable path to the user for visual review.

2. The Mandatory Checkpoint

When proposing structural modifications, refactors, or execution pipelines, always author an implementation_plan.md artifact with RequestFeedback: true. The agent must STOP and wait for explicit human confirmation before executing mutating actions.

3. Explicit Anti-Patterns

Rigid behavioral boundaries must be maintained to prevent catastrophic failure modes.


Anti-Patterns

  • Oscillatory Prompt Churn — Applying raw gradient updates without momentum smoothing, causing prompts to thrash between conflicting instructions.
  • Ungated Pool Pollution — Committing candidate agent blocks without running the 4-stage validation filter.
  • Circular Execution Deadlocks — Allowing edge mutations that introduce cycles into agent execution DAGs.
  • Unbounded Loss Metrics — Using non-normalized loss scales instead of strictly bounded $[0.0, 1.0]$ loss metrics.

04 同仓库更多 Skills

SpectreDeath
SpectreDeath/Brain-Harness

ui-behavior-primitive-architect

Architect, audit, and verify zero-dependency headless UI behavior primitives, WebMCP agent bridges, WAI-ARIA/SSR/RTL tri-modal checks, and framework expert routing. Do not use for static CSS theme styling or backend database migrations.

★ 0
SpectreDeath
SpectreDeath/Brain-Harness

trustgraph-ontology-governor

Govern knowledge graphs, SHACL-AF triple policies, OntologyRAG subclass validation, PROV-O dual named graphs, and Laya entropy decision scoring. Do not use for relational SQL queries or generic web scraping.

★ 0
SpectreDeath
SpectreDeath/Brain-Harness

shim-harness-governor

Govern universal CLI agent loops, 4-tier tool permissions, ancestor-symlink workspace sandboxes, deterministic-first command routing, collision-safe MCP namespacing, and layered skill loading. Do not use for static UI styling or external SQL analytics.

★ 0
SpectreDeath
SpectreDeath/Brain-Harness

graphiti-zep-memory-governor

Govern bi-temporal knowledge graphs with Graphiti future-edge clamping, MinHash/LSH entity dedup, RRF/MMR reranking, and Zep typed ontologies. Do not use for static SQL joins or generic web crawling.

★ 0
SpectreDeath
SpectreDeath/Brain-Harness

agora-mcp-workbench-architect

Architect, audit, and orchestrate Agora Workbench MCP servers, loopback sidecars, unified state graphs, gateway/dispatcher connectors, and policy-enforced data lakes. Do not use for static frontend CSS styling or non-MCP desktop GUI automation.

★ 0
SpectreDeath
SpectreDeath/Brain-Harness

skill-eval-assurance-runner

Evaluate and assure agent skills using small-N Wilson confidence intervals, unbiased pass^k reliability, deterministic trajectory graders, preflight boundary honesty, and sealed digest verification. Do not use for subjective prose review or unconstrained production deployment.

★ 0