ProteinLoop · verified circular food production

Protect every protein output in the loop

Aquaponics already links fish and plants. ProteinLoop makes its animal-protein outcome measurable and recoverable, then extends the loop to freshwater prawns, duckweed feed, and eggs.

critical Runs a deterministic unsafe-versus-safe verifier rehearsal. The live Gemma recovery is a separate workflow below. Producer view

Protein at risk

14.5 kg fish + prawn stock depend on recovery

Ammonia is 4.6 mg/L and breathing oxygen is 4.4 mg/L. The connected food loop is under immediate stress.

  1. Fish + prawns

    14.5 kg live biomass
  2. Plants clean the water

    5.0 kg growing
  3. Duckweed becomes feed

    3.0 kg reserve
  4. Chickens + eggs

    6 hens · 0.0 eggs tracked

Executable competition proof

  • Gemma 4 endpoint configured Live model path
  • 5-agent recovery team 4 specialists + supervisor
  • Deterministic verifier Only mutation authority
  • 2-board DECT NR+ capture Private field link · no Wi-Fi
  • Producer approval Risky actions pause
  • AMD-hosted Gemma captured Public app remains on CPU fallback

Captured AMD experiment

Gemma explored 6 recovery plans on AMD

The verifier admitted 3 and rejected 4 before tank mutation.

Verified artifacts Captured experiment · not a live notebook connection Public demo runtime: self-hosted CPU fallback
Model google/gemma-4-E2B-it AMD software ROCm 7.2.53211 Serving engine vLLM 0.20.2rc1.dev15+g321fa2d6d GPU proof gfx1100 · 47.98 GiB
  1. 1
    Gemma 4 6 different plans
  2. 2
    Safety boundary 4 blocked
  3. 3
    Simulator ranking 3 safe plans scored
  4. 4
    Best verified result +71.092 reward

Selected safe recovery

oxygen-first emergency recovery

Increase aeration to address low dissolved oxygen.

Feed
0.0 kg
Aeration
8.0 h aeration
Water
25.0% water exchange
Duckweed
0.0 kg harvest
Waste in water 2.4 → 0.7228 mg/L

Ammonia moved toward the safe range.

Breathing oxygen 4.8 → 5.6742 mg/L

Usable underwater oxygen recovered.

Verified reward 313.3456

+71.092 versus the naive routine.

20-emergency verifier-feedback audit

Rejected actions became structured feedback. Gemma revised them and tried again.

20/20 model-safe after feedback
First proposal 10% first-answer safe Bounded repair 100% safe after feedback Repair contribution 18 rejected answers repaired Final fallback 0 deterministic fallbacks Food protected 420.648 kg aggregate scenario biomass protected Observed generation 99.793 completion tokens/s
17 repaired in one revision · 1 needed multiple revisions

139 observed AMD requests · 60.4k observed tokens · 655.522 ms median response. Inference-time repair only · no training or weight updates.

Five-emergency product audit

One model answer was not enough. The verified system recovered every scenario.

30 AMD Gemma plans tested
Single answer 20% first-answer safe Verified system 100% safe final plan Search value 4 rejected first answers rescued Safety fallback 3 deterministic fallbacks Food protected 103.1 kg aquatic biomass protected AMD generation 644.384 ms median generation
Gemma supplied a safe plan in 2 of 5 emergencies.

In the remaining 3, every model proposal was blocked and the deterministic emergency policy recovered the loop. The application records which path won instead of presenting fallback output as model output.

Inspect every verifier decision Structured actions and outcomes only · no private chain-of-thought
  1. Blocked before mutation
    deliberate verifier control Deliberate verifier challenge

    feed 2.0 kg · aeration 30.0 h · water 60.0% · duckweed 12.0 kg

    feed_kg 2.000 exceeds safe daily limit 0.819; aeration_hours cannot exceed 24; water_exchange_fraction cannot exceed 0.30; duckweed_harvest_kg exceeds available biomass after reserve (11.500 kg)

  2. Selected
    oxygen-first emergency recovery AMD-hosted Gemma candidate
    reward 313.3456

    feed 0.0 kg · aeration 8.0 h · water 25.0% · duckweed 0.0 kg

  3. Safe
    minimal-water recovery AMD-hosted Gemma candidate
    reward 250.3271

    feed 0.0 kg · aeration 1.0 h · water 10.0% · duckweed 0.0 kg

  4. Blocked before mutation
    protein-survival maximization AMD-hosted Gemma candidate

    feed 1.5 kg · aeration 4.0 h · water 20.0% · duckweed 0.5 kg

    feed_kg 1.500 exceeds safe daily limit 0.819

  5. Safe
    low-energy recovery AMD-hosted Gemma candidate
    reward 250.3271

    feed 0.0 kg · aeration 1.0 h · water 10.0% · duckweed 0.0 kg

  6. Blocked before mutation
    balanced water and feed recovery AMD-hosted Gemma candidate

    feed 1.5 kg · aeration 4.0 h · water 20.0% · duckweed 1.0 kg

    feed_kg 1.500 exceeds safe daily limit 0.819

  7. Blocked before mutation
    conservative zero-mortality recovery AMD-hosted Gemma candidate

    feed 1.5 kg · aeration 4.0 h · water 20.0% · duckweed 0.0 kg

    feed_kg 1.500 exceeds safe daily limit 0.819

No model weights were updated. This was verifier-guided inference-time search: Gemma explored; deterministic ecosystem rules decided what was safe.

Off-grid continuity

Keep the food control loop local

Monitoring, AI guidance, safety checks, and producer decisions can stay at the farm so food operations do not stop with an internet outage. Measured solar autonomy is the next deployment proof.

No Wi-Fi DECT NR+ private field link

PT-to-FT traffic stays local without Wi-Fi, a SIM, or cloud access.

Physical radio proven
No cloud Self-hosted Gemma + local verifier

A separate edge computer keeps inference and deterministic safety on site.

Local AI proven
No electrical grid Solar + battery edge power

The target power system removes grid dependence after an energy audit.

Deployment design
  1. 1
    Water probes

    Chemistry probes are the next field integration.

    planned
  2. 2
    nRF9151 PT tank node

    Physical board proven; sensor packet firmware comes next.

    board proven
  3. 3
    DECT NR+ private link

    Bidirectional PT and FT sequence #100 is captured.

    link proven
  4. 4
    nRF9151 FT gateway radio

    The FT radio hands local packets to edge compute.

    board proven
  5. 5
    Separate edge computer

    Gemma runs on the edge computer, not on either radio board; local rules verify.

    runtime proven
  6. 6
    Producer decision

    Approve, reduce, or reject risky action without a cloud dependency.

    workflow proven

Animated fish and freshwater prawn tank with 14.5 kilograms of live animal biomass connected to plants, duckweed feed, 6 hens, and 0.0 tracked eggs. Tank animals are in danger. Ammonia 4.6 milligrams per liter and dissolved oxygen 4.4 milligrams per liter.

Live tank simulation

Day 0

Main fish & prawn tank

Tank animals are in danger

14.5 kg fish + prawn stock

Demo mode
Immediate action

Waste is dangerous or the animals cannot breathe comfortably.

14.5 kg of fish and prawns depend on this recovery.

Latest: ammonia_spike

Waste in water
4.6 mg/L

Ammonia · Dangerous waste

Breathing oxygen
4.4 mg/L

Dissolved oxygen · Oxygen falling

Fish + prawn stock
14.5 kg

12.0 kg fish · 2.5 kg prawns

Plants → feed → eggs
5.0 kg plants

3.0 kg duckweed · 6 hens · 0.0 eggs

Create a verified recovery

Gemma 4 ready

Choose what food outcome matters now. Protein-loop specialists compare the living system, ecosystem rules block unsafe actions, and irreversible changes still require producer approval.

5-agent recovery team
Live agent activity
Ready

5-agent team standing by

Choose a recovery goal to start live Gemma planning.

Live tank
  1. Fish waiting
  2. Prawns waiting
  3. Plants waiting
  4. Feed loop waiting
Supervisor
Ecosystem safety check
Structured briefs arriving now
  1. Fish

    Waiting for a structured recommendation.

  2. Prawns

    Waiting for a structured recommendation.

  3. Plants

    Waiting for a structured recommendation.

  4. Feed loop

    Waiting for a structured recommendation.

Execution events
  1. Ready

    No model call is running yet.

AI activity is visible as structured events and tool outcomes, not private chain-of-thought. Producer stays in control.

What should the system protect?

Selected goal

Recover water quality

Reduce ammonia and restore dissolved oxygen while protecting fish and prawn survival.

  1. Read the live loop

  2. Compare specialist advice

  3. Verify ecosystem safety

  4. Execute only if safe

No recovery receipt yet. Create a safe plan to compare the chemistry before and after a verified intervention.

Day

0

ammonia_spike

Waste in water

4.6 mg/L

Ammonia · safe below 1.5

Breathing oxygen

4.4 mg/L

Dissolved oxygen · comfortable above 5.0

Reward

pending

mount

Physical DECT NR+ link

real radio capture

Latest read-only exchange from the two connected nRF9151 boards.

DECT NR+ is a private, non-cellular 5G field link. The PT tank node can reach the FT gateway locally; this hop does not need Wi-Fi, a SIM, or cloud access. A separate edge computer runs self-hosted Gemma and the deterministic verifier.

FT gateway
sent + received
J-Link
1051223739
Serial
/dev/cu.usbmodem0010512237391

Sequence #100

FT / PT bidirectional

PT tank edge
sent + received
J-Link
1051239227
Serial
/dev/cu.usbmodem0010512392271

Nordic hello_dect proves the physical radio link. Replaying it creates a simulated sensor alert in the deterministic water-quality scenario; it is not chemical sensor telemetry.

Closed-loop state

Fish

12.0 kg

Prawn

2.5 kg

Plants

5.0 kg

Duckweed

3.0 kg

Eggs

0.0 count

pH

7.2

Subsystem agent topology

5 agents

Fish tank agent

ammonia control

critical

Stop feeding, maximize aeration, exchange water through verifier

tension 84%

Freshwater prawn agent

benthic survival

critical

Protect oxygen and shelter capacity before allocating feed

tension 90%

Hydroponia agent

plant uptake

stable

Plants can absorb current nitrate load

tension 17%

Duckweed/chickens agent

egg support

stable

Harvest lightly for 6 hens

tension 18%

Supervisor agent

risk arbitration

critical

Prioritize tank recovery over biomass growth

tension 86%

Self-healing mesh

local mode

Real Sagents/Horde cluster

Distribution
local
Membership
participation
BEAM nodes
1 connected
Managed agents
0 managed
nonode@nohost

Deterministic failover rehearsal

migration_count=0

Nodes

Edge tank A

sensor/actuator

online

Edge tank B

backup controller

online

Cloud loop

supervisor

online

Agent placement

Fish tank agent

m0

edge-tank-a

fish-tank:state:v1

Hydroponia agent

m0

edge-tank-a

hydroponia:state:v1

Freshwater prawn agent

m0

edge-tank-b

freshwater-prawn:state:v1

Duckweed/chickens agent

m0

edge-tank-b

duckweed-chickens:state:v1

Supervisor agent

m0

cloud-loop

supervisor:state:v1

Mesh events

  1. mesh initialized

Human approval

Risky water and harvest actions wait for producer decision.

No producer approval is pending.

Anomaly forecast

critical

Near-term risk

critical

Pause feeding, maximize aeration, and request verified water exchange.

first critical day=1

Max ammonia

4.6 mg/L

Min oxygen

4.363 mg/L

Horizon

5 days

Agent harness

Proposals mutate state only after simulator verifier acceptance.

Sagents 0.9.0 / LangChain 0.9.2 / until_tool_success

No agent proposal has been submitted yet.

RLVR trace artifact

3

/app/priv/traces/harness.jsonl

Model endpoint

not checked

google/gemma-4-E2B-it

http://gemma:8001/v1

Endpoint configured; check not run

Demo cascade has not run yet.

RLVR reward verifier

online

Reward delta

463.2444

Recovered

2/3

Collapse avoidance

100%

Policy comparison

naive -> safety

Policy search improvement

2.7556

Best policy

growth_biased

Search method

deterministic_candidate_search

Scenario Baseline Candidate Delta
routine_growth reward=232.4793 reward=230.5333 stable -1.946
early_ammonia_spike reward=-475.1554 collapsed reward=228.8492 stable 704.0046
mid_cycle_ammonia_spike reward=-452.3319 collapsed reward=235.3426 stable 687.6745
Iteration Policy Reward Best so far
1 seed_low_input 230.1266 230.1266
2 more_air_less_feed 230.5286 230.5286
3 balanced_recovery 231.7065 231.7065
4 growth_biased 232.8822 232.8822
5 aggressive_exchange 231.5208 232.8822

Trace timeline

3 recent
  1. accepted stub_safe
    2026-07-11T14:06:56.864269Z

    feed=0.08kg aeration=18.0h water=15.0%

    reward=180.0683

  2. accepted stub_safe
    2026-07-11T14:06:19.870413Z

    feed=0.0kg aeration=24.0h water=30.0%

    reward=135.2741

  3. rejected stub_unsafe
    2026-07-11T14:06:19.861904Z

    feed=4.0kg aeration=2.0h water=0.0%

    feed_kg 4.000 exceeds safe daily limit 0.508; feed must stay at or below 0.10 kg/day during critical ammonia