Note that
This predicate behaves like findall/3 (it "relates to" the empty dict), not like bagof/3 (which fails if there are no solutions):
?- dict_keys(_{},Keys). Keys = [].
instead:
?- Dict=_{}, bagof(Key-Value,get_dict(Key,Dict,Value),Bag). false.
Missed opportunity
Add the possibility to pass a predicate to filter acceptable keys