Skip to content

Commit 82b22e6

Browse files
Complete Amico V2 redesign - remove V1, add new architecture
Co-authored-by: takasaki404 <193405421+takasaki404@users.noreply.github.com>
1 parent f0c7681 commit 82b22e6

143 files changed

Lines changed: 2296 additions & 20748 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ARCHITECTURE.md

Lines changed: 647 additions & 0 deletions
Large diffs are not rendered by default.

Cargo.lock

Lines changed: 190 additions & 10135 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
11
[workspace]
2-
members = ["amico", "amico-*"]
2+
members = [
3+
"amico",
4+
"amico-models",
5+
"amico-system",
6+
"amico-runtime",
7+
"amico-workflows",
8+
]
39
resolver = "2"
410

511
[workspace.dependencies]
6-
thiserror = "2.0.12"
7-
serde = "1.0.219"
8-
serde_json = "1.0.140"
9-
async-trait = "0.1.88"
10-
tokio = { version = "1.44.2", default-features = false }
11-
rig-core = { version = "0.12.0", default-features = false }
12-
tracing = "0.1.41"
13-
solana-sdk = "2.1.21"
14-
solana-client = "2.1.21"
15-
anyhow = "1.0.98"
16-
evenio = "0.6.0"
17-
nostr-sdk = "0.38.0"
18-
nostr = "0.38.0"
19-
chrono = { version = "0.4.41", features = ["serde"] }
20-
tokio_with_wasm = { version = "0.8.5", features = ["rt"] }
12+
# Amico V2 crates
13+
amico-models = { path = "./amico-models", version = "2.0.0" }
14+
amico-system = { path = "./amico-system", version = "2.0.0" }
15+
amico-runtime = { path = "./amico-runtime", version = "2.0.0" }
16+
amico-workflows = { path = "./amico-workflows", version = "2.0.0" }
2117

22-
# Released Amico crates
23-
amico-core = "1.0.2"
24-
amico-sdk = "1.0.0"
25-
26-
# Dev releases
27-
amico-hal = { version = "0.0.2", default-features = false }
18+
# Core dependencies
19+
futures = "0.3"
20+
tokio = { version = "1.44", default-features = false }

README.md

Lines changed: 106 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
# Amico AI Agent Framework
1+
# Amico V2 AI Agent Framework
22

3-
Amico is a next-generation Autonomous AI Agent Framework designed for embedded AI devices and multi-agent systems.
3+
**⚠️ MAJOR VERSION UPDATE: This is a complete rewrite of Amico (V2)**
4+
5+
Amico V2 is a platform-agnostic **runtime** for AI agents built in Rust. As a framework, it provides a platform for developers to develop their business logic - just like web frameworks like Axum or Rocket.
6+
7+
## 📚 Documentation
8+
9+
For detailed architecture design, see [ARCHITECTURE.md](./ARCHITECTURE.md).
410

511
## Links
612

@@ -9,107 +15,115 @@ Amico is a next-generation Autonomous AI Agent Framework designed for embedded A
915
[![Paper](https://img.shields.io/badge/Paper-arXiv-red?style=for-the-badge&logo=arxiv)](http://arxiv.org/abs/2507.14513)
1016
[![Discord](https://img.shields.io/badge/Discord-Join%20Community-7289da?style=for-the-badge&logo=discord)](https://discord.gg/MkeG9Zwuaw)
1117

12-
## 🚧 Stability Notice: Early Development Phase
13-
14-
This project is currently in its early development stage. While we are excited to share our progress, please be aware of the following:
15-
16-
1. **Sparse Documentation**: Our documentation is currently limited and may not cover all aspects of the framework. We are actively working to improve it.
17-
2. **Frequent Breaking Changes**: The API and internal structures are subject to change as we iterate rapidly. Breaking changes may occur without notice.
18-
3. **Limited Test Coverage**: Our test suite is not yet comprehensive, which may lead to undetected bugs or regressions.
19-
20-
We welcome contributions and feedback to help improve the project.
21-
22-
## Modules
23-
24-
1. **`amico`**: The main executable crate.
25-
2. **`amico-core`**: Interfaces and workflows for the Engine Layer.
26-
3. **`amico-sdk`**: Interfaces and workflows for the AI Agent and Interaction Layers.
27-
4. **`amico-mods`**: Pluggable implementation modules.
28-
5. **`amico-hal`**: Hardware Abstraction Layer.
29-
6. **`amico-wasm`**: WASM library for the Amico AI Agent Framework.
18+
## 🚀 What's New in V2
3019

31-
## Development Plans
20+
Amico V2 is a **complete redesign** from the ground up, incorporating modern AI agent framework patterns and best practices:
3221

33-
- **Agent Networking**: Supports peer-to-peer networking using decentralized messaging networks.
34-
- **Agent NFT Integration**: Enables agents to be represented as NFTs on blockchains.
35-
- **Verifiable Memory Layer**: Enables agents to store memory locally with vector embeddings and verify their memory on blockchains.
22+
- **Platform-Agnostic Runtime**: Run on any platform - OS, browsers, mobile, embedded devices
23+
- **Model Abstraction Layer**: Provider-agnostic model interface inspired by Vercel's AI SDK
24+
- **Workflow Runtime**: Support for both long-lived and short-lived runtimes
25+
- **Zero-Cost Abstractions**: Uses traits and generics instead of dynamic dispatch
26+
- **Type-Safe**: Extensive compile-time verification
27+
- **Event-Driven Architecture**: Framework-like event handler interface
3628

3729
## Architecture Overview
3830

39-
### Core Concepts
40-
41-
![Framework](https://raw.githubusercontent.com/AIMOverse/amico/refs/heads/main/images/framework-v2.png)
42-
43-
#### Framework Layers
44-
45-
- **Interaction Layer**: Manages communication between agents and the environment. This includes:
46-
47-
- **Sensors**: Acquire the current state of the environment.
48-
- **Effectors**: Execute actions.
49-
- The environment can be physical (real-world) or virtual (the Internet, blockchain, etc.).
50-
- Hardware sensor and effector drivers are implemented in the `amico-firmware` crate.
51-
- **Future Plans**: Decoupling into:
52-
- **Environment Layer**: Passively receives/responds to environmental inputs.
53-
- **Interaction Layer**: Actively handles actions and state changes from users and agents.
54-
55-
- **Agent Layer**: Encapsulates core agent logic, including state management, decision-making, and action execution. Key components:
56-
57-
- **LLM Providers** and **RAG Systems** implemented as plugins.
58-
- **Task execution models** (see _Model-Based Agents_ below) implemented in `amico-std`, with plugin support for custom models.
31+
Amico V2 consists of four layers:
32+
33+
```
34+
┌─────────────────────────────────────────┐
35+
│ Application / Event Handlers │ ← Your business logic
36+
├─────────────────────────────────────────┤
37+
│ Workflows Layer (Presets) │ ← Tool loop agents, ReAct, etc.
38+
├─────────────────────────────────────────┤
39+
│ Runtime Layer │ ← Workflow execution
40+
├─────────────────────────────────────────┤
41+
│ Models Layer │ ← Model abstractions
42+
├─────────────────────────────────────────┤
43+
│ System Layer │ ← Tools, side-effects, I/O
44+
└─────────────────────────────────────────┘
45+
```
5946

60-
- **Engine Layer**: Handles task scheduling, event generation, and action selection. The default **Action Selector** is in `amico-std`, but custom implementations can be added via plugins.
61-
62-
#### Pluggable Modules
63-
64-
- **LLM Services**: Provides content generation, integrating LLM calls, RAG knowledge base, tool calling, etc.
65-
- **LLM Providers**: API integrations for services like OpenAI, DeepSeek, etc.
66-
- **Effectors**: Execute actions such as hardware control, transactions, content posting, and messaging.
67-
- **Sensors**: Capture environmental data, such as sensor readings and social media content.
68-
- **Hardware Abstraction**: Low-level interface for embedded device interaction.
69-
70-
#### Low-Level Plugins
71-
72-
- **RAG Systems**: Implements retrieval-augmented generation.
73-
- **Task Executors**: Provides task execution workflows (e.g., Model-Based Agents).
74-
- **Action Selectors**: Implements action selection algorithms.
75-
- **Event Generators**: Generates events based on the current environment state.
76-
77-
### Model-Based Agents: Basic Design
78-
79-
![Basic Design](https://raw.githubusercontent.com/AIMOverse/amico/refs/heads/main/images/model_based.png)
80-
81-
- **State Representation**: The agent perceives and represents the current environment state.
82-
- **World Evolution**: Predicts the impact of actions.
83-
- **Condition-Action Rules**: Guides decision-making.
84-
85-
### Task Execution Workflow
86-
87-
![Task Execution Workflow](https://raw.githubusercontent.com/AIMOverse/amico/refs/heads/main/images/task_exec.png)
88-
89-
- **Event-Triggered Tasks**
90-
91-
- Tasks initiate based on events (e.g., timers, on-chain/off-chain signals, messages from other agents).
92-
- Each event carries context, providing additional knowledge for decision-making.
93-
94-
- **Knowledge Acquisition**
95-
96-
- The agent gathers information from its internal knowledge base and real-time data sources.
97-
- Information is synthesized into a comprehensive report to support decision-making.
47+
### Core Concepts
9848

99-
- **Decision Making**
49+
1. **Models Layer** (`amico-models`): Abstracts AI models by capability (language, image, video, speech, embedding)
50+
2. **System Layer** (`amico-system`): Defines how agents interact with the world through tools and side-effects
51+
3. **Runtime Layer** (`amico-runtime`): Executes workflows on different runtime types (long-lived or short-lived)
52+
4. **Workflows Layer** (`amico-workflows`): Preset workflow patterns (tool loops, ReAct, chain-of-thought, etc.)
10053

101-
- The agent evaluates potential actions and selects the most informed response.
102-
- Possible responses include executing a task, responding to a user, or both.
103-
- In SWARM systems, agents may seek consensus before executing critical actions.
54+
## Design Principles
10455

105-
- **Execution of Decision**
56+
- **Traits + Generics over Boxing**: Always use traits and generics for abstractions, avoid dynamic dispatch
57+
- **Compile-time Safety**: Extensive use of types to catch errors early
58+
- **Zero-cost Abstractions**: No runtime overhead from abstraction layers
59+
- **Lifetime-aware**: Explicit lifetime management instead of `Box` or `Arc`
60+
- **Async-native**: All async operations use `impl Future`, not `Pin<Box<dyn Future>>`
10661

107-
- Actions can range from executing transactions to posting content.
108-
- If required, the agent communicates with other agents before execution.
62+
## Modules
10963

110-
- **Agent Response**
111-
- Provides human-readable feedback after execution.
112-
- Responses may include tool calls for embedded devices (e.g., triggering a motor).
64+
1. **`amico`**: The main entry crate that ties everything together
65+
2. **`amico-models`**: Model abstractions categorized by capability
66+
3. **`amico-system`**: System layer for tools and side-effects
67+
4. **`amico-runtime`**: Runtime layer for executing workflows
68+
5. **`amico-workflows`**: Preset workflow patterns
69+
70+
## Example Usage
71+
72+
```rust
73+
use amico::{
74+
EventHandler, EventRouter,
75+
runtime::Runtime,
76+
workflows::ToolLoopAgent,
77+
};
78+
79+
// Define your event handler
80+
struct MyAgentHandler {
81+
agent: ToolLoopAgent<MyModel, MyTools, MyContext>,
82+
}
83+
84+
impl EventHandler<MessageEvent> for MyAgentHandler {
85+
type Context = AgentContext;
86+
type Response = MessageResponse;
87+
type Error = HandlerError;
88+
89+
async fn handle(&self, event: MessageEvent, context: &Self::Context)
90+
-> Result<Self::Response, Self::Error>
91+
{
92+
let response = self.agent
93+
.execute(context, event.content)
94+
.await?;
95+
Ok(MessageResponse::from(response))
96+
}
97+
}
98+
99+
// Create runtime and register handlers
100+
async fn main() {
101+
let runtime = create_runtime();
102+
let mut router = EventRouter::new();
103+
104+
// Register event handlers
105+
router.register("message", MyAgentHandler::new());
106+
router.register("timer", TimerHandler::new());
107+
108+
// Start runtime
109+
runtime.start().await.unwrap();
110+
}
111+
```
112+
113+
## Migration from V1
114+
115+
**V1 is completely deprecated and not compatible with V2.**
116+
117+
V2 is a total rewrite that keeps some good concepts from V1 (event-based architecture, platform-agnostic design) while:
118+
119+
- Removing all dynamic dispatch in favor of static generics
120+
- Clarifying separation between models, runtime, system, and workflows
121+
- Providing clearer abstractions inspired by modern frameworks like Vercel's AI SDK
122+
- Focusing on compile-time safety and zero-cost abstractions
123+
124+
## 🚧 Development Status
125+
126+
**V2 is currently in design phase.** The architecture and traits are defined, but implementations are placeholders. We're building the conceptual framework first before implementing functionality.
113127

114128
## License
115129

amico-core/Cargo.toml

Lines changed: 0 additions & 30 deletions
This file was deleted.

amico-core/README.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)