Who it is forA developer debugging a Cadence brain who needs to see how it would respond to a sequence of observations without disturbing its ongoing experience.
The problemProbing a live learning agent often changes its memory or random state, which makes the probe itself corrupt the experiment.
The outcomeA list of imagined phases that can be inspected, with live memory, random state and pending feedback left as they were.
What you need first
- Python 3.11 or newer
- NumPy installed through pip
- A toy environment or task that can supply an observation and a measured reward after each action
Steps
python -m pip install cadence-net==0.84.3- Compose a brain with
brain = Brain.compose(inputs=4, actions=2, arousal=True)and run a fewlivecalls to build some experience. - Pass a list of observation arrays to
brain.imagine([observation, next_observation]). - Inspect each returned phase, reading
phase.qualifiedbefore using any imagined response. - Continue the live loop and confirm that the next live action is consistent with a run without the imagine call.
Prompt for your agent
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.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for muellerberndt/cadence and "Preview a brain's responses without altering live memory"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer