A distributed actor-based framework built on Microsoft Orleans for building scalable event-sourced applications.
The GAgent Framework provides a base implementation for creating distributed agents (actors) that support:
- Event sourcing
- Pub/sub messaging
- State management
- Hierarchical agent relationships
The GAgentBase<TState, TEvent> class is the foundation of the framework, providing:
- Event Sourcing: Built on Orleans'
JournaledGrainfor reliable event storage and replay - State Management: Manages agent state with automatic persistence
- Event Publishing: Supports publishing and subscribing to events between agents
- Hierarchical Structure: Allows agents to register with and subscribe to other agents
-
Event Handling
- Automatic event forwarding
- Custom event handler registration
- Support for base and specialized event handlers
-
State Management
- Strongly-typed state containers
- Automatic state persistence
- State change notifications
-
Agent Registration
- Dynamic agent registration/unregistration
- Hierarchical agent relationships
- Subscription management
-
Stream Processing
- Built-in stream provider integration
- Automatic stream subscription management
- Event forwarding capabilities
[GAgent]
public class MyAgent : GAgentBase<MyState, MyEvent>
{
public MyAgent(ILogger logger) : base(logger)
{
}
public override async Task<string> GetDescriptionAsync()
{
return "My Custom Agent";
}
}[EventHandler]
public async Task HandleCustomEventAsync(CustomEvent event)
{
// Handle the event
}await agent.RegisterAsync(otherAgent);- Always inherit from
GAgentBasewhen creating new agents - Implement proper error handling in event handlers
- Use strongly-typed events and states
- Properly manage registrations
If you encounter a bug or have a feature request, please use the Issue Tracker. The project is also open to contributions, so feel free to fork the project and open pull requests.
Distributed under the Apache License. See License for more information. Distributed under the MIT License. See License for more information.