Are you trying to have two agents talk directly or is the goal for them to publish messages to a remote bus for the other agent to see? If it's the latter, you can see an example in the ForwardHistorian: https://github.com/VOLTTRON/volttron/blob/develop/services/core/ForwardHistorian/forwarder/agent.py
By default, agents can talk to their local message bus, in order to talk to a remote one they need to setup this connection (where "destination_vip" is the vip address of the remote VOLTTRON including the serverkey):
agent = Agent(address=destination_vip)
event = gevent.event.Event()
agent.core.onstart.connect(lambda *a, **kw: event.set(), event)
gevent.spawn(agent.core.run)
event.wait()
Then later they can use it to publish or subscribe to that bus:
self._target_platform.vip.pubsub.publish(peer='pubsub',
topic="MyTopic",
message="Some message").get()
Using these methods agents can publish and subscribe to a remote message bus and interact with it in the same way they could with their local bus.
If you are looking for how to call another agent directly, then the SchedulerExample interacting with the ActuatorAgent provides an example: https://github.com/VOLTTRON/volttron/blob/develop/examples/SchedulerExample/schedule_example/agent.py
The call is similar to the above pub/sub example except that it uses the rpc subsystem. The calling agent uses the target agent's VIP identity, the method it wants to call, and the parameters. The ActuatorAgent has a set vip identity making it easier to call and it has the "@RPC.export" decorator over the "set_point" method.
result = self._target_platform.vip.rpc.call(
'platform.actuator',
'set_point',
agent_id,
'campus/building/unit3/some_point',
'0.0').get(timeout=10)