Skip to content

Commit 576d5ec

Browse files
echo-yiyiyiWendong-Fanzechengz
authored
doc: pdate readme.md with features and some main feature code sinppets (#1154)
Co-authored-by: Wendong <[email protected]> Co-authored-by: Wendong-Fan <[email protected]> Co-authored-by: Zecheng Zhang <[email protected]>
1 parent 4ac7246 commit 576d5ec

File tree

1 file changed

+122
-77
lines changed

1 file changed

+122
-77
lines changed

README.md

Lines changed: 122 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,37 @@ ______________________________________________________________________
3636

3737
Join us ([*Discord*](https://discord.camel-ai.org/), [*WeChat*](https://ghli.org/camel/wechat.png) or [*Slack*](https://join.slack.com/t/camel-ai/shared_invite/zt-2g7xc41gy-_7rcrNNAArIP6sLQqldkqQ)) in pushing the boundaries of finding the scaling laws of agents.
3838

39-
## Try it yourself
39+
## What Can You Build With CAMEL?
40+
41+
### 🤖 Customize Agents
42+
- Customizable agents are the fundamental entities of the CAMEL architecture. CAMEL empowers you to customize agents using our modular components for specific tasks.
43+
44+
### ⚙️ Build Multi-Agent Systems
45+
- We propose a multi-agent framework to address agents' autonomous cooperation challenges, guiding agents toward task completion while maintaining human intentions.
46+
47+
### 💻 Practical Applications
48+
- The CAMEL framework serves as a generic infrastructure for a wide range of multi-agent applications, including task automation, data generation, and world simulations.
49+
50+
51+
## Why Should You Use CAMEL?
52+
53+
1. Comprehensive Customization and Collaboration:
54+
55+
- Integrates over 20 advanced model platforms (e.g., commercial models like OpenAI, open-source models such as Llama3, and self-deployment frameworks like Ollama.).
56+
57+
- Supports extensive external tools (e.g., Search, Twitter, Github, Google Maps, Reddit, Slack utilities).
58+
- Includes memory and prompt components for deep customization.
59+
- Facilitates complex multi-agent systems with advanced collaboration features.
60+
61+
62+
2. User-Friendly with Transparent Internal Structure:
63+
- Designed for transparency and consistency in internal structure.
64+
65+
- Offers comprehensive [tutorials and detailed docstrings](https://docs.camel-ai.org/) for all functions.
66+
- Ensures an approachable learning curve for newcomers.
67+
68+
69+
## Try It Yourself
4070
We provide a [![Google Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1AzP33O8rnMW__7ocWJhVBXjKziJXPtim?usp=sharing) demo showcasing a conversation between two ChatGPT agents playing roles as a python programmer and a stock trader collaborating on developing a trading bot for stock market.
4171

4272
<p align="center">
@@ -105,8 +135,6 @@ exit
105135
> ```
106136

107137

108-
109-
110138
Install `CAMEL` from source with conda and pip:
111139
```sh
112140
# Create a conda virtual environment
@@ -134,13 +162,58 @@ Detailed guidance can be find [here](https://github.com/camel-ai/camel/blob/mast
134162

135163
## Documentation
136164

137-
[CAMEL package documentation pages](https://camel-ai.github.io/camel/).
138-
139-
## Example
140-
141-
You can find a list of tasks for different sets of assistant and user role pairs [here](https://drive.google.com/file/d/194PPaSTBR07m-PzjS-Ty6KlPLdFIPQDd/view?usp=share_link).
142-
143-
As an example, to run the `role_playing.py` script:
165+
The [complete documentation](https://camel-ai.github.io/camel/) pages for the CAMEL package. Also, detailed tutorials for each part are provided below:
166+
167+
### Agents
168+
Explore different types of agents, their roles, and their applications.
169+
170+
- **[Creating Your First Agent](https://docs.camel-ai.org/cookbooks/create_your_first_agent.html)**
171+
- **[Creating Your First Agent Society](https://docs.camel-ai.org/cookbooks/create_your_first_agents_society.html)**
172+
- **[Embodied Agents](https://docs.camel-ai.org/cookbooks/embodied_agents.html)**
173+
- **[Critic Agents](https://docs.camel-ai.org/cookbooks/critic_agents_and_tree_search.html)**
174+
175+
---
176+
177+
### Key Modules
178+
Core components and utilities to build, operate, and enhance CAMEL-AI agents and societies.
179+
180+
| Module | Description |
181+
|:---|:---|
182+
| **[Models](https://docs.camel-ai.org/key_modules/models.html)** | Model architectures and customization options for agent intelligence. |
183+
| **[Messages](https://docs.camel-ai.org/key_modules/messages.html)** | Messaging protocols for agent communication. |
184+
| **[Memory](https://docs.camel-ai.org/key_modules/memory.html)** | Memory storage and retrieval mechanisms. |
185+
| **[Tools](https://docs.camel-ai.org/key_modules/tools.html)** | Tools integration for specialized agent tasks. |
186+
| **[Prompts](https://docs.camel-ai.org/key_modules/prompts.html)** | Prompt engineering and customization. |
187+
| **[Tasks](https://docs.camel-ai.org/key_modules/tasks.html)** | Task creation and management for agent workflows. |
188+
| **[Loaders](https://docs.camel-ai.org/key_modules/loaders.html)** | Data loading tools for agent operation. |
189+
| **[Storages](https://docs.camel-ai.org/key_modules/storages.html)** | Storage solutions for agent. |
190+
| **[Society](https://docs.camel-ai.org/key_modules/society.html)** | Components for building agent societies and inter-agent collaboration. |
191+
| **[Embeddings](https://docs.camel-ai.org/key_modules/embeddings.html)** | Embedding models for RAG. |
192+
| **[Retrievers](https://docs.camel-ai.org/key_modules/retrievers.html)** | Retrieval methods for knowledge access. |
193+
---
194+
195+
### Cookbooks
196+
Practical guides and tutorials for implementing specific functionalities in CAMEL-AI agents and societies.
197+
198+
| Cookbook | Description |
199+
|:---|:---|
200+
| **[Creating Your First Agent](https://docs.camel-ai.org/cookbooks/create_your_first_agent.html)** | A step-by-step guide to building your first agent. |
201+
| **[Creating Your First Agent Society](https://docs.camel-ai.org/cookbooks/create_your_first_agents_society.html)** | Learn to build a collaborative society of agents. |
202+
| **[Society Cookbook](https://docs.camel-ai.org/cookbooks/agents_society.html)** | Advanced configurations for agent societies. |
203+
| **[Model Speed Comparison Cookbook](https://docs.camel-ai.org/cookbooks/model_speed_comparison.html)** | Benchmarking models for performance. |
204+
| **[Message Cookbook](https://docs.camel-ai.org/cookbooks/agents_message.html)** | Best practices for message handling in agents. |
205+
| **[Tools Cookbook](https://docs.camel-ai.org/cookbooks/agents_with_tools.html)** | Integrating tools for enhanced functionality. |
206+
| **[Memory Cookbook](https://docs.camel-ai.org/cookbooks/agents_with_memory.html)** | Implementing memory systems in agents. |
207+
| **[RAG Cookbook](https://docs.camel-ai.org/cookbooks/agents_with_rag.html)** | Recipes for Retrieval-Augmented Generation. |
208+
| **[Prompting Cookbook](https://docs.camel-ai.org/cookbooks/agents_prompting.html)** | Techniques for effective prompt creation. |
209+
| **[Task Generation Cookbook](https://docs.camel-ai.org/cookbooks/task_generation.html)** | Automating task generation for agents. |
210+
| **[Graph RAG Cookbook](https://docs.camel-ai.org/cookbooks/knowledge_graph.html)** | Leveraging knowledge graphs with RAG. |
211+
| **[Role-Playing Scraper for Report & Knowledge Graph Generation](https://docs.camel-ai.org/cookbooks/roleplaying_scraper.html)** | Create role-playing agents for data scraping and reporting. |
212+
| **[Video Analysis](https://docs.camel-ai.org/cookbooks/video_analysis.html)** | Techniques for agents in video data analysis. |
213+
| **[Track CAMEL Agents with AgentOps](https://docs.camel-ai.org/cookbooks/agents_tracking.html)** | Tools for tracking and managing agents in operations. |
214+
| **[Create A Hackathon Judge Committee with Workforce](https://docs.camel-ai.org/cookbooks/workforce_judge_committee.html)** | Building a team of agents for collaborative judging. |
215+
216+
## Examples
144217

145218
First, you need to add your OpenAI API key to system environment variables. The method to do this depends on your operating system and the shell you're using.
146219
@@ -170,83 +243,41 @@ $env:OPENAI_API_BASE_URL="<inert your OpenAI API BASE URL>" #(Should you utiliz
170243
171244
Replace `<insert your OpenAI API key>` with your actual OpenAI API key in each case. Make sure there are no spaces around the `=` sign.
172245
173-
After setting the OpenAI API key, you can run the script:
246+
247+
Please note that the environment variable is session-specific. If you open a new terminal window or tab, you will need to set the API key again in that new session.
248+
249+
After setting the OpenAI API key, you can run the `role_playing.py` script. Find tasks for various assistant-user roles [here](https://drive.google.com/file/d/194PPaSTBR07m-PzjS-Ty6KlPLdFIPQDd/view?usp=share_link).
174250
175251
```bash
176252
# You can change the role pair and initial prompt in role_playing.py
177253
python examples/ai_society/role_playing.py
178254
```
179255
180-
Please note that the environment variable is session-specific. If you open a new terminal window or tab, you will need to set the API key again in that new session.
256+
Also feel free to run any scripts below that interest you:
181257
258+
```bash
259+
# You can change the role pair and initial prompt in these python files
182260
183-
## Use Open-Source Models as Backends (ex. using Ollama to set Llama 3 locally)
261+
# Examples of two agents role-playing
262+
python examples/ai_society/role_playing.py
184263
185-
- Download [Ollama](https://ollama.com/download).
186-
- After setting up Ollama, pull the Llama3 model by typing the following command into the terminal:
187-
```bash
188-
ollama pull llama3
189-
```
190-
- Run the script. Enjoy your Llama3 model, enhanced by CAMEL's excellent agents.
191-
```python
192-
from camel.agents import ChatAgent
193-
from camel.messages import BaseMessage
194-
from camel.models import ModelFactory
195-
from camel.types import ModelPlatformType
196-
197-
ollama_model = ModelFactory.create(
198-
model_platform=ModelPlatformType.OLLAMA,
199-
model_type="llama3",
200-
model_config_dict={"temperature": 0.4},
201-
)
202-
203-
assistant_sys_msg = BaseMessage.make_assistant_message(
204-
role_name="Assistant",
205-
content="You are a helpful assistant.",
206-
)
207-
agent = ChatAgent(assistant_sys_msg, model=ollama_model, token_limit=4096)
208-
209-
user_msg = BaseMessage.make_user_message(
210-
role_name="User", content="Say hi to CAMEL"
211-
)
212-
assistant_response = agent.step(user_msg)
213-
print(assistant_response.msg.content)
214-
```
264+
# The agent answers questions by utilizing code execution tools.
265+
python examples/toolkits/code_execution_toolkit.py
215266
216-
## Use Open-Source Models as Backends (ex. using vLLM to set Phi-3 locally)
217-
- [Install vLLM](https://docs.vllm.ai/en/latest/getting_started/installation.html)
218-
- After setting up vLLM, start an OpenAI compatible server for example by
219-
```bash
220-
python -m vllm.entrypoints.openai.api_server --model microsoft/Phi-3-mini-4k-instruct --api-key vllm --dtype bfloat16
221-
```
222-
- Create and run following script (more details please refer to this [example](https://github.com/camel-ai/camel/blob/master/examples/models/vllm_model_example.py))
223-
```python
224-
from camel.agents import ChatAgent
225-
from camel.messages import BaseMessage
226-
from camel.models import ModelFactory
227-
from camel.types import ModelPlatformType
228-
229-
vllm_model = ModelFactory.create(
230-
model_platform=ModelPlatformType.VLLM,
231-
model_type="microsoft/Phi-3-mini-4k-instruct",
232-
url="http://localhost:8000/v1",
233-
model_config_dict={"temperature": 0.0},
234-
api_key="vllm",
235-
)
236-
237-
assistant_sys_msg = BaseMessage.make_assistant_message(
238-
role_name="Assistant",
239-
content="You are a helpful assistant.",
240-
)
241-
agent = ChatAgent(assistant_sys_msg, model=vllm_model, token_limit=4096)
242-
243-
user_msg = BaseMessage.make_user_message(
244-
role_name="User",
245-
content="Say hi to CAMEL AI",
246-
)
247-
assistant_response = agent.step(user_msg)
248-
print(assistant_response.msg.content)
249-
```
267+
# Generating a knowledge graph with an agent
268+
python examples/knowledge_graph/knowledge_graph_agent_example.py
269+
270+
# Multiple agents collaborating to decompose and solve tasks
271+
python examples/workforce/multiple_single_agents.py
272+
273+
# Use agent to generate creative image
274+
python examples/vision/image_crafting.py
275+
```
276+
For additional feature examples, see the [`examples`](https://github.com/camel-ai/camel/tree/master/examples) directory.
277+
278+
## Utilize Various LLMs as Backends
279+
280+
For more details, please see our [`Models Documentation`](https://docs.camel-ai.org/key_modules/models.html#).
250281
251282
## Data (Hosted on Hugging Face)
252283
| Dataset | Chat format | Instruction format | Chat format (translated) |
@@ -270,7 +301,21 @@ Please note that the environment variable is session-specific. If you open a new
270301
We implemented amazing research ideas from other works for you to build, compare and customize your agents. If you use any of these modules, please kindly cite the original works:
271302
- `TaskCreationAgent`, `TaskPrioritizationAgent` and `BabyAGI` from *Nakajima et al.*: [Task-Driven Autonomous Agent](https://yoheinakajima.com/task-driven-autonomous-agent-utilizing-gpt-4-pinecone-and-langchain-for-diverse-applications/). [[Example](https://github.com/camel-ai/camel/blob/master/examples/ai_society/babyagi_playing.py)]
272303
304+
## Other Research Works Based on Camel
305+
- [Agent Trust](http://agent-trust.camel-ai.org/): Can Large Language Model Agents Simulate Human Trust Behavior?
306+
307+
- [CRAB](https://crab.camel-ai.org/): Cross-environment Agent Benchmark for Multimodal Language Model Agents.
308+
309+
- OASIS: Open Agents Social Interaction Simulations on a Large Scale.
310+
311+
We warmly invite you to use CAMEL for your impactful research.
312+
273313
## News
314+
📢 Added the Workforce module to the 🐫 CAMEL framework! For more details, see the [post](https://x.com/CamelAIOrg/status/1851682063830720912). (Oct 31, 2024)
315+
- Added subprocess support for Ollama and vLLM models. (Oct, 29, 2024)
316+
- Integrated Firecrawl's Map into the 🐫 CAMEL framework. (Oct, 22, 2024)
317+
- Integrated Nvidia's Llama-3.1-Nemotron-70b-Instruct! (Oct, 17, 2024)
318+
- ...
274319
- Released AI Society and Code dataset (April 2, 2023)
275320
- Initial release of `CAMEL` python library (March 21, 2023)
276321

0 commit comments

Comments
 (0)