Metadata-Version: 2.4
Name: leaper-agent
Version: 2.0.1
Summary: 自进化 AI 员工框架 — 越用越聪明
Author: Deepleaper
License: Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: openai<3,>=2.21.0
Requires-Dist: anthropic<1,>=0.39.0
Requires-Dist: python-dotenv<2,>=1.2.1
Requires-Dist: fire<1,>=0.7.1
Requires-Dist: httpx[socks]<1,>=0.28.1
Requires-Dist: rich<15,>=14.3.3
Requires-Dist: tenacity<10,>=9.1.4
Requires-Dist: pyyaml<7,>=6.0.2
Requires-Dist: requests<3,>=2.33.0
Requires-Dist: jinja2<4,>=3.1.5
Requires-Dist: pydantic<3,>=2.12.5
Requires-Dist: prompt_toolkit<4,>=3.0.52
Requires-Dist: exa-py<3,>=2.9.0
Requires-Dist: firecrawl-py<5,>=4.16.0
Requires-Dist: parallel-web<1,>=0.4.2
Requires-Dist: fal-client<1,>=0.13.1
Requires-Dist: edge-tts<8,>=7.2.7
Requires-Dist: PyJWT[crypto]<3,>=2.12.0
Requires-Dist: inquirer<4,>=3.1.0
Requires-Dist: ddgs>=6.0
Provides-Extra: telegram
Requires-Dist: python-telegram-bot>=21.0; extra == "telegram"
Provides-Extra: discord
Requires-Dist: discord.py>=2.0; extra == "discord"
Provides-Extra: modal
Requires-Dist: modal<2,>=1.0.0; extra == "modal"
Provides-Extra: daytona
Requires-Dist: daytona<1,>=0.148.0; extra == "daytona"
Provides-Extra: dev
Requires-Dist: debugpy<2,>=1.8.0; extra == "dev"
Requires-Dist: pytest<10,>=9.0.2; extra == "dev"
Requires-Dist: pytest-asyncio<2,>=1.3.0; extra == "dev"
Requires-Dist: pytest-xdist<4,>=3.0; extra == "dev"
Requires-Dist: mcp<2,>=1.2.0; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Provides-Extra: messaging
Requires-Dist: python-telegram-bot[webhooks]<23,>=22.6; extra == "messaging"
Requires-Dist: discord.py[voice]<3,>=2.7.1; extra == "messaging"
Requires-Dist: aiohttp<4,>=3.13.3; extra == "messaging"
Requires-Dist: slack-bolt<2,>=1.18.0; extra == "messaging"
Requires-Dist: slack-sdk<4,>=3.27.0; extra == "messaging"
Requires-Dist: qrcode<8,>=7.0; extra == "messaging"
Provides-Extra: cron
Requires-Dist: croniter<7,>=6.0.0; extra == "cron"
Provides-Extra: slack
Requires-Dist: slack-bolt<2,>=1.18.0; extra == "slack"
Requires-Dist: slack-sdk<4,>=3.27.0; extra == "slack"
Provides-Extra: matrix
Requires-Dist: mautrix[encryption]<1,>=0.20; extra == "matrix"
Requires-Dist: Markdown<4,>=3.6; extra == "matrix"
Requires-Dist: aiosqlite>=0.20; extra == "matrix"
Requires-Dist: asyncpg>=0.29; extra == "matrix"
Provides-Extra: cli
Requires-Dist: simple-term-menu<2,>=1.0; extra == "cli"
Provides-Extra: tts-premium
Requires-Dist: elevenlabs<2,>=1.0; extra == "tts-premium"
Provides-Extra: voice
Requires-Dist: faster-whisper<2,>=1.0.0; extra == "voice"
Requires-Dist: sounddevice<1,>=0.4.6; extra == "voice"
Requires-Dist: numpy<3,>=1.24.0; extra == "voice"
Provides-Extra: pty
Requires-Dist: ptyprocess<1,>=0.7.0; sys_platform != "win32" and extra == "pty"
Requires-Dist: pywinpty<3,>=2.0.0; sys_platform == "win32" and extra == "pty"
Provides-Extra: honcho
Requires-Dist: honcho-ai<3,>=2.0.1; extra == "honcho"
Provides-Extra: mcp
Requires-Dist: mcp<2,>=1.2.0; extra == "mcp"
Provides-Extra: homeassistant
Requires-Dist: aiohttp<4,>=3.9.0; extra == "homeassistant"
Provides-Extra: sms
Requires-Dist: aiohttp<4,>=3.9.0; extra == "sms"
Provides-Extra: acp
Requires-Dist: agent-client-protocol<1.0,>=0.9.0; extra == "acp"
Provides-Extra: mistral
Requires-Dist: mistralai<3,>=2.3.0; extra == "mistral"
Provides-Extra: bedrock
Requires-Dist: boto3<2,>=1.35.0; extra == "bedrock"
Provides-Extra: dingtalk
Requires-Dist: dingtalk-stream<1,>=0.20; extra == "dingtalk"
Requires-Dist: alibabacloud-dingtalk>=2.0.0; extra == "dingtalk"
Requires-Dist: qrcode<8,>=7.0; extra == "dingtalk"
Provides-Extra: feishu
Requires-Dist: lark-oapi<2,>=1.5.3; extra == "feishu"
Requires-Dist: qrcode<8,>=7.0; extra == "feishu"
Provides-Extra: google
Requires-Dist: google-api-python-client<3,>=2.100; extra == "google"
Requires-Dist: google-auth-oauthlib<2,>=1.0; extra == "google"
Requires-Dist: google-auth-httplib2<1,>=0.2; extra == "google"
Provides-Extra: web
Requires-Dist: fastapi<1,>=0.104.0; extra == "web"
Requires-Dist: uvicorn[standard]<1,>=0.24.0; extra == "web"
Provides-Extra: all
Requires-Dist: leaper-agent[telegram]; extra == "all"
Requires-Dist: leaper-agent[discord]; extra == "all"
Requires-Dist: leaper-agent[modal]; extra == "all"
Requires-Dist: leaper-agent[daytona]; extra == "all"
Requires-Dist: leaper-agent[messaging]; extra == "all"
Requires-Dist: leaper-agent[matrix]; sys_platform == "linux" and extra == "all"
Requires-Dist: leaper-agent[cron]; extra == "all"
Requires-Dist: leaper-agent[cli]; extra == "all"
Requires-Dist: leaper-agent[dev]; extra == "all"
Requires-Dist: leaper-agent[tts-premium]; extra == "all"
Requires-Dist: leaper-agent[slack]; extra == "all"
Requires-Dist: leaper-agent[pty]; extra == "all"
Requires-Dist: leaper-agent[honcho]; extra == "all"
Requires-Dist: leaper-agent[mcp]; extra == "all"
Requires-Dist: leaper-agent[homeassistant]; extra == "all"
Requires-Dist: leaper-agent[sms]; extra == "all"
Requires-Dist: leaper-agent[acp]; extra == "all"
Requires-Dist: leaper-agent[voice]; extra == "all"
Requires-Dist: leaper-agent[dingtalk]; extra == "all"
Requires-Dist: leaper-agent[feishu]; extra == "all"
Requires-Dist: leaper-agent[google]; extra == "all"
Requires-Dist: leaper-agent[mistral]; extra == "all"
Requires-Dist: leaper-agent[bedrock]; extra == "all"
Requires-Dist: leaper-agent[web]; extra == "all"
Dynamic: license-file

<div align="center">

# 🚀 Leaper Agent

### Self-Evolving AI Agent Framework — Multi-Provider, Multi-Agent, with Built-in Memory

### 自进化 AI Agent 框架 — 多模型、多智能体、内置记忆引擎

[![PyPI version](https://img.shields.io/pypi/v/leaper-agent.svg)](https://pypi.org/project/leaper-agent/)
[![Downloads](https://img.shields.io/pypi/dm/leaper-agent.svg)](https://pypi.org/project/leaper-agent/)
[![GitHub stars](https://img.shields.io/github/stars/deepleaper/leaper-agent.svg)](https://github.com/deepleaper/leaper-agent/stargazers)
[![License](https://img.shields.io/badge/License-BSL--1.1-blue.svg)](LICENSE)
[![Python](https://img.shields.io/badge/Python-3.10+-blue.svg)](https://python.org)

[Website](https://www.deepleaper.com) · [Quick Start](#-quick-start) · [Features](#-features) · [中国版](https://github.com/deepleaper/leaper-agent-cn)

</div>

---

## ✨ Why Leaper Agent?

Most agent frameworks treat every conversation as a blank slate. **Leaper Agent** is different — it **learns from every interaction** and gets smarter over time, powered by [DeepBrain](https://github.com/deepleaper/opc-deepbrain)'s 6-layer self-evolving memory.

Built on top of [Hermes Agent](https://github.com/hermes-agent), enhanced with persistent memory, multi-agent orchestration, and production-ready integrations.

## 🎯 Features

- 🧠 **Self-Evolving Memory** — DeepBrain 6-layer memory: your agent remembers, consolidates, and evolves
- 🔌 **Multi-Provider** — OpenAI, Anthropic Claude, Google Gemini, and more. Switch with one line
- 🤝 **Multi-Agent** — Orchestrate multiple agents with different roles and specialties
- 🤖 **Telegram Integration** — Deploy as a Telegram bot in minutes
- 🎭 **Role Templates** — Pre-built personas (CTO, Analyst, Writer…) or create your own
- 🔧 **MCP Support** — Model Context Protocol for tool/plugin extensibility
- 📡 **Streaming** — Real-time streaming responses out of the box

## 🚀 Quick Start

```bash
# 1. Install
pip install leaper-agent

# 2. Set your API key (pick one)
export OPENAI_API_KEY=sk-xxx
# or: export ANTHROPIC_API_KEY=sk-ant-xxx
# or: export GEMINI_API_KEY=xxx

# 3. Initialize
leaper-agent init

# 4. Chat!
leaper-agent chat
```

### As a Telegram Bot

```bash
export TELEGRAM_BOT_TOKEN=your-token
leaper-agent serve --telegram
```

### Multi-Agent Setup

```python
from leaper_agent import Agent, Team

researcher = Agent(role="researcher", provider="openai", model="gpt-4o")
writer = Agent(role="writer", provider="anthropic", model="claude-sonnet-4-20250514")

team = Team(agents=[researcher, writer])
result = team.run("Research and write an article about quantum computing")
```

## 🏗️ Architecture

```
┌─────────────────────────────────────────┐
│           Leaper Agent Core             │
├─────────┬──────────┬───────────────────┤
│ OpenAI  │ Claude   │ Gemini  │ ...     │
├─────────┴──────────┴───────────────────┤
│         Role Templates & Tools          │
├─────────────────────────────────────────┤
│         Multi-Agent Orchestration       │
├─────────────────────────────────────────┤
│         🧠 DeepBrain Memory Engine      │
│    6-Layer Self-Evolving Knowledge      │
│    ┌──────────────────────────────┐     │
│    │  4-Gate Quality Control      │     │
│    │  Relevance → Novelty →       │     │
│    │  Consistency → Utility       │     │
│    └──────────────────────────────┘     │
└─────────────────────────────────────────┘
```

## 🔌 Supported Providers

| Provider | Models | Status |
|----------|--------|--------|
| OpenAI | GPT-4o, GPT-4o-mini, o1/o3 | ✅ |
| Anthropic | Claude Sonnet, Opus, Haiku | ✅ |
| Google | Gemini 2.0, 2.5 | ✅ |
| Ollama | Any local model | ✅ |

## 🎭 Built-in Role Templates

```bash
# Use a pre-built role
leaper-agent chat --role cto
leaper-agent chat --role analyst
leaper-agent chat --role writer

# Create your own
leaper-agent role create my-role
```

## 🧠 Memory in Action

```python
from leaper_agent import Agent

agent = Agent(provider="openai", model="gpt-4o", memory=True)

# Session 1
agent.chat("My name is Ray, I'm building an AI startup")

# Session 2 — agent remembers!
agent.chat("What's my name?")  # → "Your name is Ray..."
```

## 🇨🇳 China Version / 中国版

For users in China with Chinese LLM providers (通义千问、DeepSeek、文心一言):

```bash
pip install leaper-agent-cn
```

→ [Leaper Agent CN](https://github.com/deepleaper/leaper-agent-cn)

## 📄 License

[BSL-1.1](LICENSE) — see LICENSE for details.

## 🤝 Contributing

We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md).

📧 Contact: [tech@deepleaper.com](mailto:tech@deepleaper.com)

---

<div align="center">

**Built with ❤️ by [Deepleaper Technology / 跃盟科技](https://www.deepleaper.com)**

*Agents that learn. Agents that evolve. Agents that remember.*

</div>
