Metadata-Version: 2.4
Name: aser
Version: 0.1.9
Summary: An AI Agent
Author-email: rickey <hello_rickey@163.com>
License: MIT
Project-URL: Homepage, https://github.com/AmeNetwork/aser
Project-URL: Bug Tracker, https://github.com/AmeNetwork/aser/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.13.2
Description-Content-Type: text/markdown
Requires-Dist: openai>=1.63.2
Requires-Dist: web3>=7.8.0
Requires-Dist: discord-py-interactions>=5.14.0
Requires-Dist: python-telegram-bot>=21.10
Requires-Dist: tweepy>=4.15.0
Requires-Dist: supabase>=2.13.0
Requires-Dist: tinydb>=4.8.2
Requires-Dist: fastapi>=0.115.8
Requires-Dist: uvicorn>=0.34.0
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: chromadb>=0.6.3
Requires-Dist: tiktoken>=0.9.0
Requires-Dist: canonicaljson>=2.0.0
Requires-Dist: mastodon.py>=2.0.1
Requires-Dist: atproto>=0.0.59
Requires-Dist: rich>=13.9.4
Requires-Dist: semchunk>=3.2.3
Requires-Dist: fastmcp>=2.12.3
Requires-Dist: mscp>=0.1.4
Requires-Dist: a2a-sdk>=0.3.6

# Aser

Aser is a minimalist, modular, and versatile AI agent framework. You can assemble an agent with just a few lines of code.

![](./examples/images/architecture.png)

[Website](https://ame.network) | [Documentation](https://docs.ame.network/aser/overview) | [Get Support](https://t.me/hello_rickey) | [中文](./README_CN.md)

## Installation

**Install from pypi:**

```bash
pip install aser
```

**Or clone the repository:**

```bash
git clone https://github.com/AmeNetwork/aser.git
cd aser
pip install -r requirements.txt
```

## Set up environment variables

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.

**.env file example:**

```bash
#MODEL
MODEL_BASE_URL=<your model base url>
MODEL_KEY=<your model key>
```

## Usage

```python
#Basic
from aser.agent import Agent
agent=Agent(name="aser agent",model="gpt-4.1-mini")
response=agent.chat("what's bitcoin?")
print(response)
```

```python
# Full configuration
aser = Agent(
    name="aser",
    model="gpt-4o-mini",
    tools=[web3bio, exa],
    knowledge=knowledge,
    memory=memory,
    chat2web3=[connector],
    mcp=[price],
    trace=trace
)
```

## Get Started

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.

### Beginner:

- [Aser Agent](./examples/agent.py): Your First AI Agent
- [Model Config](./examples/agent_model.py): Customize the LLM configuration
- [Memory](./examples/agent_memory.py): Build an agent with memory storage
- [RAG](./examples/agent_knowledge.py): Build an agent with knowledge retrieval
- [Tools](./examples/agent_tools.py): Build an agent with tools
- [Toolkits](./examples/agent_toolkits.py): Use built-in toolkits
- [Trace](./examples/agent_trace.py): Build an agent with tracing
- [API](./examples/agent_api.py): Build an agent with API server
- [CLI](./examples/agent_cli.py): Interact with the agent using the CLI
- [Discord](./examples/agent_discord.py): Build an agent with Discord client
- [Telegram](./examples/agent_telegram.py): Build an agent with Telegram client
- [Farcaster](./examples/agent_farcaster.py): Build an agent with Farcaster client

### Intermediate:

- [CoT](./examples/agent_cot.py): Chain of Thought
- [MCP](./examples/agent_mcp.py): Model Context Protocol 
- [Text2SQL](./examples/agent_text2sql.py): Build an agent with Text2SQL
- [Workflow](./examples/agent_workflow.py): Custom Agent Workflows
- [Evaluation](./examples/agent_evaluation.py): Evaluate an AI Agent
- [Router Multi-Agent](./examples/router_multi_agent.py): Multiple agents distribute tasks based on routing
- [Sequential Multi-Agent](./examples/sequential_multi_agent.py): Multiple agents work sequentially
- [Parallel Multi-Agent](./examples/parallel_multi_agent.py): Multiple agents work simultaneously
- [Reactive Multi-Agent](./examples/reactive_multi_agent.py): Multiple agents respond to changes
- [Hierarchical Multi-Agent](./examples/hierarchical_multi_agent.py): Multiple agents work at different levels
- [Agent UI](https://github.com/AmeNetwork/ame-ui): Interact with the agent through the UI

### Advanced:

- [MSCP](./examples/agent_mcp.py): Model Smart Contract Protocol
- [A2Aser](./examples/a2a_server.py): Integrate Google Agent2Agent (A2A) Protocol
- [A2A Client](./examples/a2a_client.py): Agent to Agent Client

### Experiments:
- [ERC8004 Server Agent](./examples/a2a_erc8004_server.py): Server Agent Offers services and executes tasks
- [ERC8004 Identity](./examples/agent_mscp_erc8004.py): Identity registration is performed using the MSCP ERC8004 Connector
