Amico Core
This crate is a part of the Amico project, a powerful and flexible AI agent framework.
What does this crate do
This crate provides the core engine for the Amico AI Agent Framework, including the following features:
- Event-driven agent architecture with a robust event handling system
- Entity Component System (ECS) integration for efficient state management
- Flexible event dispatching and action selection mechanisms
- World state management and delegation for agent operations
Directory Structure
The crate is organized as follows:
Source Code (src/)
agent.rs: Defines the coreAgentstruct that manages the event loop and event sourcesecs.rs: Provides Entity Component System (ECS) integrationerrors/: Defines error types and handling for the frameworktraits/: Core interfaces including:Strategy: Action selection strategiesEventSource: Event generation interfacesSystem: ECS system interfaceshandlers: Event handling mechanisms
types/: Contains concrete type definitions for events, instructions, and data structuresagent_event.rs: Defines theAgentEventstructure andEventContentenuminstruction.rs: Defines agent instructions likeTerminate
world/: World state management components including:manager.rs: Core world management functionalitydelegate.rs: Delegation patterns for world operations
Key Concepts
- Event-Driven Architecture: The framework operates on an event-based model where
EventSources generateAgentEvents that are processed by the agent. - Entity Component System: Uses an ECS pattern for efficient state management and component organization.
- Strategy Pattern: Flexible event dispatching through the
Strategytrait for customizable action selection logic. - Event Sources: Components that generate events for the agent to process. They implement the
EventSourcetrait and can be any source of information or stimuli for the agent, such as user input, timers, or external APIs. - Agent Events: Represented by the
AgentEventstruct, these are high-level events that carry information from event sources to the agent. They contain metadata (name, source), optional content (data or instructions), and can have an expiry time. - Agent Actions: Unlike
AgentEvents which are external stimuli, Agent Actions are implemented as ECS events (using theeveniolibrary'sEventtrait). These events represent internal state changes and behaviors within the agent's world model. The Strategy component translates externalAgentEvents into appropriate ECS events that modify the world state.
NOTE The ECS Events will be used only in the crate's internal APIs and be hidden behind Actions in future versions.
Documents
See Amico's website https://amico.dev
License
This crate is released under the MIT License OR the Apache-2.0 License