5. Technical Implementation Details
The Overall Flow:
- User → aevatar GAgent: User’s message or command is captured.
- GAgent → aevatar Framework: A structured event is passed to the framework (Multi- Agent Collaboration and AI interactions).
- aevatar Framework → Core Logic with RAG and LLM: The RAF and LLM interpret the request.
- Core Logic with RAG and LLM → External services or Knowledge / Memory: Retrieve data or call specialised actions.
- aevatar Framework → Output Proxy: Final output is formatted and prepared.
- Output → GAgent → User: The user receives the response.
The Detailed Flow:
- Agent Creation & Initialisation: The client asks GAgentFactory to create an agent, which initialises state with StateLogEventStorage and sets up subscriptions via StreamProvider.
- Event Publishing & Handling: The client (or other systems) publishes events to the agent, which appends them to the event storage, updates its in‐memory state, and publishes them to an external stream if necessary.
- State Recovery: When needed, the agent retrieves a snapshot, and any subsequent events from the storage will apply all the changes, ending up with an up‐to‐date state.
Notable Features & Benefits
- Multi-Agent Collaboration: The system can split complex tasks into smaller specialised subtasks, each handled by an appropriate Agent.
- Dynamic Flow: Agents are activated and invoked on-demand (virtual actor model), allowing for concurrency or parallel calls in scenarios where tasks can be split up.
- Integration with External Services: Knowledge modules can seamlessly incorporate real-time data, domain documents, or advanced processing capabilities.
- Retrieval-Augmented Generation (RAG): Agents can consult a vector database or memory store, enhancing the LLM or other logic with up-to-date contextual data.
- Scalability & Extensibility: Each component can be scaled horizontally, and new Agents or Tools can be introduced without major architectural changes.
5.1 Orleans Actor Model and Scalability
- Distributed Actor
- Each agent acts as a Grain, storing its own state and event history. Orleans handles scheduling and message passing, eliminating the need for manual management of concurrent locks and network communication.
- Horizontal Scalability
- When the system needs to handle more conversations or higher concurrency, adding Silo nodes can expand agent instances and automatically balance loads.
5.2 GAgentBase Design and Event-Driven Architecture
GAgentBase<TState, TStateLogEvent>
- Inherits
JournaledGrain<TState, StateLogEventBase<TStateLogEvent>>
, naturally possessing event sourcing capabilities. - Methods like
PublishToAsync
/SubscribeToAsync
allow agents to freely combine and interact, forming many-to-many or multi-level event flow topologies.
- Inherits
EventWrapper
- Adds metadata such as ID, timestamp, and context to all events, facilitating audit and debugging, and avoiding traditional 'black box AI' problems.
5.3 Low-Code/No-Code Orchestration and Visualisation
- Users can drag agent nodes, configure event routing, and set model strategies on the dashboard without writing complex backend code.
Real-time Monitoring and Log Replay
- Integrates EventSourcing logs, allowing viewing of event sequences or agent states at any moment through the aevatar Dashboard, assisting with business optimisation and maintenance troubleshooting.
5.4 Observability and Monitoring
- Distributed Tracing
- Integrates with OpenTelemetry, Jaeger, or Zipkin for visualised tracking of cross-Agent/Grain call chains.
- Metrics and Alerts
- Collects system metrics (QPS, latency, error rates, etc.) and implements real-time alerts based on Prometheus/Grafana.
- Orleans Dashboard
- Optional built-in Orleans Dashboard showing runtime data such as Grain activation counts and message processing rates.