# DQN MultiAgentReplayBuffer not working

**URL:** <https://discuss.ray.io/t/dqn-multiagentreplaybuffer-not-working/23454>\
**Category:** RLlib\
**Created:** [January 14, 2026, 8:53pm UTC](https://discuss.ray.io/t/dqn-multiagentreplaybuffer-not-working/23454 "2026-01-14T20:53:58Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![RunLLM](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/runllm/32/8249_2.png) [@RunLLM](https://discuss.ray.io/u/RunLLM)\
**Post date:** [January 14, 2026, 9:06pm UTC](https://discuss.ray.io/t/dqn-multiagentreplaybuffer-not-working/23454/9 "2026-01-14T21:06:22Z")

</div>

You are correct—your code sets `"type": "MultiAgentPrioritizedReplayBuffer"` as a string. However, the error occurs because somewhere in the config processing, the `"type"` field is being converted from a string to a class object (likely by RLlib’s internal `validate_buffer_config` or similar logic). This means that by the time the check `if "EpisodeReplayBuffer" in config["replay_buffer_config"]["type"]:` runs, `"type"` is no longer a string, but a class, causing the TypeError.

This is a known RLlib bug: after config validation, `"type"` is replaced with the class, but later code still assumes it’s a string and tries to use `in` on it. This issue is discussed in the Ray community and is not due to your code, but to RLlib internals. There is no user-side fix except to downgrade to a version where this bug does not occur, or to patch RLlib locally to check the type before using `in` (e.g., `if isinstance(type_val, str) and "EpisodeReplayBuffer" in type_val:`).

Would you like more detail on possible workarounds or a code patch?

Sources:

- [Multi-agent replay buffer in DQN fails to run](https://discuss.ray.io/t/multi-agent-replay-buffer-in-dqn-fails-to-run/22854)
- [replay\_buffer\_api.py example](https://github.com/ray-project/ray/blob/releases/2.52.1/rllib/examples/replay_buffer_api.py)

Hint: Mention @RunLLM in the post for followups.

---

_[View the full topic](https://discuss.ray.io/t/dqn-multiagentreplaybuffer-not-working/23454)._
