Development Q&A
Framework-Related#
Q: How should the Group concept in Agent communication be understood?
A: A Group is a logical communication boundary with the following characteristics:
Messages are broadcast only within the Group.It adopts a tree structure, comprising one parent node and multiple child nodes.Each node can have only one parent but multiple children.Child nodes can recursively have their own sub-nodes.Messages between Groups are isolated and do not interfere with one another.
Q: What is the mechanism for message passing between Agents?
A: Message transmission between Agents adheres to the following rules:
Agents must belong to the same Group to communicate.Messages are broadcast within the Group.Messages between different Groups are isolated.Message transmission is asynchronous.Currently, only broadcast mode is supported.Messages propagate upward only to the parent node and downward to all child nodes.GAgent-Related#
Reference for GAgent Development: Creating Your First Agent
Q: How to handle large-scale data storage in GAgent?
A: The recommended approach is:
Use the Event Sourcing pattern for data storage instead of directly storing it in the State.For query requirements, employ the CQRS pattern:- The Command side handles event writing.
- The Query side maintains a dedicated read model.
- Event-driven synchronization ensures data consistency between read and write models.
Utilise storage systems for bulk data.Store only essential runtime data in the State.
Q: How to manage event requests and responses?
A: Suggested approach:
Subscribe to the required response event types.Include a unique correlation ID in the request event.Attach the same correlation ID to the response event.Match requests and responses using the correlation ID.Implement a timeout mechanism to handle delayed responses.
Q: How to return real-time responses to clients?
A: For scenarios requiring real-time responses:
Avoid event-driven approaches.Directly invoke Grain interfaces instead.Rationale:- Grain calls provide synchronous semantics.
- Reduces event propagation overhead.
- Simplifies system complexity.
Q: How to send events to a specific Agent?
A: Implement the following:
Add a target Agent identifier field to the event.The receiver must validate if the event is intended for them.Discard the event if the target identifier does not match.Use Agent IDs or other unique identifiers for targeting.Station-Related#
Station Interface Documentation: Aevatar StationVI Interface Documentation
Q: How can applications provide external web services?
A: Use one of the following methods:
Leverage the WebHook mechanism provided by Station.Refer to the WebHook section in the Station interface documentation.Review the WebhookTemplate sample code:
https://github.com/aevatarAI/aevatar-station/blob/dev/templates/WebhookTemplate/src/WebhookTemplate/Handler/TelegramWebhookHandlers.cs
Q: Does creating a GAgent interface support specifying GrainId?
A: Current status:
The current version does not support specifying GrainId.GrainId is auto-generated by the system.Future versions may include this feature.Ensure GrainId uniqueness if implementing custom logic.
Q: Can Station's Webhook invoke Grains in Silo?
A: Yes, interaction is supported:
Webhooks can invoke Grains within Silo.Ensure proper configuration of Silo connection details.Edited on: 24 February 2025 07:00:59 GMT+0