Your question is “how to test opaque nondeterministic databases”. I test my agents deterministically, because I know how to IoC. Check out this code [0] and follow the usage. In the rest of cases, you assert with embeds. Good luck.
[0] https://github.com/pancsta/secai/blob/74d79ad449c0f60a57b600...