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 coreAgent
struct 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 theAgentEvent
structure andEventContent
enuminstruction.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
EventSource
s generateAgentEvent
s 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
Strategy
trait for customizable action selection logic. - Event Sources: Components that generate events for the agent to process. They implement the
EventSource
trait 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
AgentEvent
struct, 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
AgentEvent
s which are external stimuli, Agent Actions are implemented as ECS events (using theevenio
library'sEvent
trait). These events represent internal state changes and behaviors within the agent's world model. The Strategy component translates externalAgentEvent
s 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