# AI use cases for Cadence (muellerberndt/cadence)

Repo: [muellerberndt/cadence](https://github.com/muellerberndt/cadence) | Use cases: 3 | Page: https://dedupedai.com/use-cases/muellerberndt-cadence/

Cadence is a Python library for building simulated animal-like brains that keep learning from live experience, with an optional self-observing System 2.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Run a continuing brain that learns from live rewards: https://dedupedai.com/use-cases/muellerberndt-cadence/run-continuing-brain-on-live-feedback/
- Preview a brain's responses without altering live memory: https://dedupedai.com/use-cases/muellerberndt-cadence/imagine-responses-without-changing-live-memory/
- Test whether System 2 observers help a task: https://dedupedai.com/use-cases/muellerberndt-cadence/compare-system-2-observers-against-plain-brain/

## How to run a continuing brain that learns from live rewards with Cadence

Repo: [muellerberndt/cadence](https://github.com/muellerberndt/cadence) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Compose a System 1 brain and feed it observations and measured rewards in one ongoing stream.

**Who it is for:** A researcher or developer testing an agent that must keep learning as its environment changes, with no separate training and inference phases.

**The problem:** Most learning setups split training from use, so an agent cannot keep adapting to a stream of outcomes in one continuing run.

**The outcome:** A running brain that returns one action per observation, takes the previous action's reward on each call, and reports its settlement work.

### Steps

1. `python -m pip install cadence-net==0.84.3`
2. Create a Python file that runs `brain = Brain.compose(inputs=4, actions=2, arousal=True)` from `cadence`.
3. Call `action = brain.live(observation)` with one observation row, execute the action in your environment, and measure the reward.
4. Call `action = brain.live(next_observation, reward=reward)` for each following step, passing the reward of the preceding action.
5. Read `brain.last_settlement` after each call to check residual, qualification and sweeps.

### Prompt to paste into your agent

```text
Using the Python package cadence-net (repo muellerberndt/cadence), write a loop that drives Brain.compose(inputs=4, actions=2, arousal=True) through live() calls on the toy environment at <environment file>. Expected output: a printed log of actions, rewards and last_settlement values for 200 steps. Verify that each call after the first passes the reward of the previous action.
```

### Caveat

Cadence is alpha research software, so the first run tests the library's mechanisms rather than delivering a production controller.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/muellerberndt-cadence/run-continuing-brain-on-live-feedback/

## How to preview a brain's responses without altering live memory with Cadence

Repo: [muellerberndt/cadence](https://github.com/muellerberndt/cadence) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Use imagination to inspect possible responses while the live trace and pending feedback stay unchanged.

**Who it is for:** A developer debugging a Cadence brain who needs to see how it would respond to a sequence of observations without disturbing its ongoing experience.

**The problem:** Probing a live learning agent often changes its memory or random state, which makes the probe itself corrupt the experiment.

**The outcome:** A list of imagined phases that can be inspected, with live memory, random state and pending feedback left as they were.

### Steps

1. `python -m pip install cadence-net==0.84.3`
2. Compose a brain with `brain = Brain.compose(inputs=4, actions=2, arousal=True)` and run a few `live` calls to build some experience.
3. Pass a list of observation arrays to `brain.imagine([observation, next_observation])`.
4. Inspect each returned phase, reading `phase.qualified` before using any imagined response.
5. Continue the live loop and confirm that the next live action is consistent with a run without the imagine call.

### Prompt to paste into your agent

```text
Using the Python package cadence-net (repo muellerberndt/cadence), compose a brain with inputs=4 and actions=2, run live() for 50 steps, then call imagine() on <observation sequence> and print each phase's qualified flag. Expected output: the qualified flags and the live action taken afterward. Verify that the live action sequence matches a control run that skips imagine().
```

### Caveat

The README says imagined responses must be checked for qualification before use, so treat unqualified phases as unreliable.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/muellerberndt-cadence/imagine-responses-without-changing-live-memory/

## How to test whether System 2 observers help a task with Cadence

Repo: [muellerberndt/cadence](https://github.com/muellerberndt/cadence) | Difficulty: Advanced | Time: 1 hour | Basis: From the README

Build a System 1 brain and a recursive brain with observers, then compare them on the same task.

**Who it is for:** A cognitive-architecture researcher who wants to know whether self-observing regions change acquisition or recovery on a fixed task.

**The problem:** The value of recursive feedback is unclear, so a fair test needs two brains with matched wiring except for the observer regions.

**The outcome:** A side-by-side record of reward over time for a plain System 1 brain and a System 2 brain with observers, on the same seed and task.

### Steps

1. `python -m pip install cadence-net==0.84.3`
2. Compose the plain brain with `brain = Brain.compose(inputs=4, actions=2, arousal=True)`.
3. Compose the recursive brain with `recursive = Brain.compose(inputs=4, actions=2, modules=(16, 8), observers=(8,), seed=7, arousal=True)`. (inferred, check the README)
4. Run both brains through the same environment loop with `live`, recording the reward at each step.
5. Compare reward curves across the run, including after a changed condition in the environment.

### Prompt to paste into your agent

```text
Using the Python package cadence-net (repo muellerberndt/cadence), run Brain.compose with and without observers=(8,) on the environment at <task file> using live() for 500 steps each. Expected output: two reward-by-step series and a summary of their averages. Verify that both brains receive identical observations and rewards at each step.
```

### Caveat

The README says whether recursive feedback helps on a task is a question for experience and evaluation, so a single run does not settle it.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/muellerberndt-cadence/compare-system-2-observers-against-plain-brain/
