$git clone https://github.com/AmeNetwork/aserAser is a minimalist, modular, and versatile AI agent framework. You can assemble an agent with just a few lines of code.
| 1 | # Aser |
| 2 | |
| 3 | Aser is a minimalist, modular, and versatile AI agent framework. You can assemble an agent with just a few lines of code. |
| 4 | |
| 5 |  |
| 6 | |
| 7 | [Twitter](https://x.com/Web3Rickey) | [Documentation](https://docs.ame.network/aser/overview) | [Get Support](https://t.me/hello_rickey) | [中文](./README_CN.md) |
| 8 | |
| 9 | ## Installation |
| 10 | |
| 11 | **Install from pypi:** |
| 12 | |
| 13 | ```bash |
| 14 | pip install aser |
| 15 | ``` |
| 16 | |
| 17 | **Or clone the repository:** |
| 18 | |
| 19 | ```bash |
| 20 | git clone https://github.com/AmeNetwork/aser.git |
| 21 | cd aser |
| 22 | pip install -r requirements.txt |
| 23 | ``` |
| 24 | |
| 25 | ## Set up environment variables |
| 26 | |
| 27 | Please refer to `.env.example` file, and create a `.env` file with your own settings. You don't need to configure all environment variables, just select the ones you use. |
| 28 | |
| 29 | **.env file example:** |
| 30 | |
| 31 | ```bash |
| 32 | #MODEL |
| 33 | MODEL_BASE_URL=<your model base url> |
| 34 | MODEL_KEY=<your model key> |
| 35 | ``` |
| 36 | |
| 37 | ## Usage |
| 38 | |
| 39 | ```python |
| 40 | #Basic |
| 41 | from aser.agent import Agent |
| 42 | agent=Agent(name="aser agent",model="gpt-4.1-mini") |
| 43 | response=agent.chat("what's bitcoin?") |
| 44 | print(response) |
| 45 | ``` |
| 46 | |
| 47 | ```python |
| 48 | # Full configuration |
| 49 | aser = Agent( |
| 50 | name="aser", |
| 51 | model="gpt-4o-mini", |
| 52 | tools=[web3bio, exa], |
| 53 | knowledge=knowledge, |
| 54 | memory=memory, |
| 55 | chat2web3=[connector], |
| 56 | mcp=[price], |
| 57 | trace=trace |
| 58 | ) |
| 59 | ``` |
| 60 | |
| 61 | ## Get Started |
| 62 | |
| 63 | If you clone the project source code, before running the examples, please run `pip install -e .` in the root directory, which allows Python to find and import the aser module from the local source code. If you install it via `pip install aser` , you can run the examples directly. |
| 64 | |
| 65 | ### Beginner: |
| 66 | |
| 67 | - [Aser Agent](./examples/agent.py): Your First AI Agent |
| 68 | - [Model Config](./examples/agent_model.py): Customize the LLM configuration |
| 69 | - [Character](./examples/agent_character.py): Build an agent with character |
| 70 | - [Memory](./examples/agent_memory.py): Build an agent with memory storage |
| 71 | - [RAG](./examples/agent_knowledge.py): Build an agent with knowledge retrieval |
| 72 | - [Tools](./examples/agent_tools.py): Build an agent with tools |
| 73 | - [Toolkits](./examples/agent_toolkits.py): Use built-in toolkits |
| 74 | - [Trace](./examples/agent_trace.py): Build an agent with tracing |
| 75 | - [API](./examples/agent_api.py): Build an agent with API server |
| 76 | - [CLI](./examples/agent_cli.py): Interact with the agent using the CLI |
| 77 | - [Discord](./examples/agent_discord.py): Build an agent with Discord client |
| 78 | - [Telegram](./examples/agent_telegram.py): Build an agent with Telegram client |
| 79 | - [Farcaster](./examples/agent_farcaster.py): Build an agent with Farcaster client |
| 80 | |
| 81 | ### Intermediate: |
| 82 | |
| 83 | - [CoT](./examples/agent_cot.py): Chain of Thought |
| 84 | - [MCP](./examples/agent_mcp.py): Model Context Protocol |
| 85 | - [Text2SQL](./examples/agent_text2sql.py): Build an agent with Text2SQL |
| 86 | - [Workflow](./examples/agent_workflow.py): Custom Agent Workflows |
| 87 | - [Evaluation](./examples/agent_evaluation.py): Evaluate an AI Agent |
| 88 | - [Router Multi-Agent](./examples/router_multi_agent.py): Multiple agents distribute tasks based on routing |
| 89 | - [Sequential Multi-Agent](./examples/sequential_multi_agent.py): Multiple agents work sequentially |
| 90 | - [Parallel Multi-Agent](./examples/parallel_multi_agent.py): Multiple agents work simultaneously |
| 91 | - [Reactive Multi-Agent](./examples/reactive_multi_agent.py): Multiple agents respond to changes |
| 92 | - [Hierarchical Multi-Agent](./examples/hierarchical_multi_agent.py): Multiple agents work at different levels |
| 93 | - [Agent UI](https://github.com/AmeNetwork/ame-ui): Interact with the agent through the UI |
| 94 | |
| 95 | ### Advanced: |
| 96 | |
| 97 | - [MSCP](./examples/agent_mcp.py): Model Smart Contract Protocol |
| 98 | - [A2Aser](./examples/a2a_server.py): Integrate Google Agent2Agent (A2A) Protocol |
| 99 | - [A2A Client](./examples/a2a_client.py): Agent to Agent Client |
| 100 | - [Self-Coding Tool](./examples/self_coding_tool.py): Agent can self-code to build tools |
| 101 | |
| 102 | ### Experiments: |
| 103 | - [ERC8004 Server Agent](./examples/a2a_erc8004_server.py): Server Agent Offers services and executes tasks |
| 104 | - [ERC8004 Identity](./examples/agent_mscp_erc8004.py): Identity registration is performed using the MSCP ERC8004 Connector |