@@ -32,20 +32,22 @@ from agentarium import Agent
32
32
agent1 = Agent(name = " agent1" )
33
33
agent2 = Agent(name = " agent2" )
34
34
35
- agent1.talk_to(agent2, " Hello, how are you? " )
36
- agent2 .talk_to(agent1 , " I'm fine, thank you! " )
35
+ # Direct communication between agents
36
+ alice .talk_to(bob , " Hello Bob! I heard you're working on some interesting ML projects. " )
37
37
38
- agent1.act() # Same as agent.talk_to but it's the agent who decides what to do
38
+ # Agent autonomously decides its next action based on context
39
+ bob.act()
39
40
```
40
41
41
42
## ✨ Features
42
43
43
44
- ** 🤖 Advanced Agent Management** : Create and orchestrate multiple AI agents with different roles and capabilities
44
- - ** 🔄 Robust Interaction Management** : Coordinate complex interactions between agents
45
- - ** 💾 Checkpoint System** : Save and restore agent states and interactions
46
- - ** 📊 Data Generation** : Generate synthetic data through agent interactions
45
+ - ** 🔄 Autonomous Decision Making** : Agents can make decisions and take actions based on their context
46
+ - ** 💾 Checkpoint System** : Save and restore agent states and interactions for reproducibility
47
+ - ** 🎭 Customizable Actions** : Define custom actions beyond the default talk/think capabilities
48
+ - ** 🧠 Memory & Context** : Agents maintain memory of past interactions for contextual responses
49
+ - ** ⚡ AI Integration** : Seamless integration with various AI providers through aisuite
47
50
- ** ⚡ Performance Optimized** : Built for efficiency and scalability
48
- - ** 🌍 Flexible Environment Configuration** : Define custom environments with YAML configuration files
49
51
- ** 🛠️ Extensible Architecture** : Easy to extend and customize for your specific needs
50
52
51
53
## 📚 Examples
@@ -54,56 +56,101 @@ agent1.act() # Same as agent.talk_to but it's the agent who decides what to do
54
56
Create a simple chat interaction between agents:
55
57
56
58
``` python
57
- # examples/basic_chat/demo.py
58
59
from agentarium import Agent
59
60
60
- alice = Agent.create_agent()
61
- bob = Agent.create_agent()
61
+ # Create agents with specific characteristics
62
+ alice = Agent.create_agent(name = " Alice" , occupation = " Software Engineer" )
63
+ bob = Agent.create_agent(name = " Bob" , occupation = " Data Scientist" )
64
+
65
+ # Direct communication
66
+ alice.talk_to(bob, " Hello Bob! I heard you're working on some interesting projects." )
62
67
63
- alice.talk_to(bob, " Hello Bob! I heard you're working on some interesting data science projects. " )
68
+ # Let Bob autonomously decide how to respond
64
69
bob.act()
65
70
```
66
71
67
- ### Synthetic Data Generation
68
- Generate synthetic data through agent interactions:
72
+ ### Adding Custom Actions
73
+ Add new capabilities to your agents:
74
+
75
+ ``` python
76
+ from agentarium import Agent, Action
77
+
78
+ # Define a simple greeting action
79
+ def greet (name : str , ** kwargs ) -> str :
80
+ return f " Hello, { name} ! "
81
+
82
+ # Create an agent and add the greeting action
83
+ agent = Agent.create_agent(name = " Alice" )
84
+ agent.add_action(
85
+ Action(
86
+ name = " GREET" ,
87
+ description = " Greet someone by name" ,
88
+ parameters = [" name" ],
89
+ function = greet
90
+ )
91
+ )
92
+
93
+ # Use the custom action
94
+ agent.execute_action(" GREET" , " Bob" )
95
+ ```
96
+
97
+ ### Using Checkpoints
98
+ Save and restore agent states:
69
99
70
100
``` python
71
- # examples/synthetic_data/demo.py
72
101
from agentarium import Agent
73
102
from agentarium.CheckpointManager import CheckpointManager
74
103
104
+ # Initialize checkpoint manager
75
105
checkpoint = CheckpointManager(" demo" )
76
106
77
- alice = Agent.create_agent()
78
- bob = Agent.create_agent()
107
+ # Create and interact with agents
108
+ alice = Agent.create_agent(name = " Alice" )
109
+ bob = Agent.create_agent(name = " Bob" )
79
110
80
111
alice.talk_to(bob, " What a beautiful day!" )
81
112
checkpoint.update(step = " interaction_1" )
82
113
114
+ # Save the current state
83
115
checkpoint.save()
84
116
```
85
117
86
118
More examples can be found in the [ examples/] ( examples/ ) directory.
87
119
88
120
## 📖 Documentation
89
121
90
- ### Environment Configuration
91
- Configure your environment using YAML files:
122
+ ### Agent Creation
123
+ Create agents with custom characteristics:
124
+
125
+ ``` python
126
+ agent = Agent.create_agent(
127
+ name = " Alice" ,
128
+ age = 28 ,
129
+ occupation = " Software Engineer" ,
130
+ location = " San Francisco" ,
131
+ bio = " A passionate developer who loves AI"
132
+ )
133
+ ```
134
+
135
+ ### LLM Configuration
136
+ Configure your LLM provider and credentials using a YAML file:
92
137
93
138
``` yaml
94
139
llm :
95
- provider : " openai" # any provider supported by aisuite
96
- model : " gpt-4o-mini " # any model supported by the provider
140
+ provider : " openai" # The LLM provider to use ( any provider supported by aisuite)
141
+ model : " gpt-4 " # The specific model to use from the provider
97
142
98
- aisuite : # optional, credentials for aisuite
99
- openai :
100
- api_key : " sk-..."
143
+ aisuite : # ( optional) Credentials for aisuite
144
+ openai : # Provider-specific configuration
145
+ api_key : " sk-..." # Your API key
101
146
` ` `
102
147
103
148
### Key Components
104
149
105
- - **Agent**: Base class for creating AI agents
106
- - **CheckpointManager**: Handles saving and loading of agent states
150
+ - **Agent**: Core class for creating AI agents with personalities and autonomous behavior
151
+ - **CheckpointManager**: Handles saving and loading of agent states and interactions
152
+ - **Action**: Base class for defining custom agent actions
153
+ - **AgentInteractionManager**: Manages and tracks all agent interactions
107
154
108
155
## 🤝 Contributing
109
156
@@ -122,11 +169,5 @@ This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENS
122
169
123
170
# # 🙏 Acknowledgments
124
171
125
- - Thanks to all contributors who have helped shape Agentarium
126
- - Special thanks to the open-source community
127
-
128
- ---
172
+ Thanks to all contributors who have helped shape Agentarium 🫶
129
173
130
- <div align="center">
131
- Made with ❤️ by <a href="https://github.com/thytu">thytu</a>
132
- </div>
0 commit comments