Metadata-Version: 2.4
Name: leaper-agent
Version: 2.0.2
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

### The Agent Framework That Actually Remembers

### Hermes-Compatible Agent Orchestration + DeepBrain 6-Layer Evolving Memory

[![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) · [Why Memory Matters](#-why-memory-matters) · [中国版](https://github.com/deepleaper/leaper-agent-cn)

</div>

---

## 🤔 The Problem

Every agent framework gives you tool-calling and multi-model support. **None of them give you real memory.**

- CrewAI? Flat key-value store, resets between runs.
- AutoGen? Conversation history only, no knowledge evolution.
- LangGraph? Checkpoints, not understanding.
- Hermes Agent? Skill files on disk — smart, but static.

**Your agent forgets everything the moment the session ends.**

## 💡 The Solution

**Leaper Agent = [Hermes Agent](https://github.com/hermes-agent) base + [DeepBrain](https://github.com/deepleaper/opc-deepbrain) memory engine.**

We took the proven Hermes Agent architecture — its agent loop, tool runtime, and multi-provider support — and integrated DeepBrain's 6-layer self-evolving memory engine. The result: **an agent that gets smarter every time you talk to it.**

```
Session 1: "I'm building a SaaS product with FastAPI and React."
Session 2: "What stack should I use for the admin panel?"
→ Agent recalls your tech choices, suggests FastAPI Admin + React
→ No manual context injection. It just knows.
```

## 🧠 Why Memory Matters

| What happens | Without memory | With DeepBrain |
|-------------|---------------|----------------|
| You mention your tech stack | Forgotten next session | Remembered forever, evolves over time |
| You correct the agent | Same mistake tomorrow | Learns the correction, never repeats |
| You have 50 conversations | Each starts from zero | Agent builds a knowledge graph of YOU |
| Knowledge conflicts | Silently contradicts itself | 4-Gate system detects & resolves conflicts |

### 6-Layer Memory Architecture

```
┌─────────────────────────────────────────┐
│  Layer 5: Meta-Knowledge               │
│  "I know your tech preferences well,   │
│   but I'm uncertain about your budget"  │
├─────────────────────────────────────────┤
│  Layer 4: Archived — Historical ref     │
├─────────────────────────────────────────┤
│  Layer 3: Consolidated — Cross-session  │
├─────────────────────────────────────────┤
│  Layer 2: Long-Term — Validated facts   │
├─────────────────────────────────────────┤
│  Layer 1: Short-Term — Recent context   │
├─────────────────────────────────────────┤
│  Layer 0: Flash — Current session       │
└─────────────────────────────────────────┘
    ↑ Auto-promotion via 4-Gate QC ↑
    (Relevance · Novelty · Consistency · Utility)
```

This isn't RAG. This isn't vector search. This is **knowledge that evolves** — facts get validated, promoted, consolidated, and the agent develops meta-awareness of what it knows well and what it doesn't.

## 🚀 Quick Start

```bash
# Install
pip install leaper-agent

# Set your API key
export OPENAI_API_KEY=sk-xxx
# or: export ANTHROPIC_API_KEY=sk-ant-xxx
# or: export GEMINI_API_KEY=xxx

# Create an agent with the CEO Coach template
leaper create my-agent --template ceo-coach

# Start
leaper start my-agent
```

### Deploy as Telegram Bot

```bash
leaper create my-bot --template ceo-coach --bot-token YOUR_TELEGRAM_TOKEN
leaper start my-bot
```

## 🏗️ Architecture

```
┌─────────────────────────────────────────┐
│         Leaper Agent Runtime            │
│    (Hermes-compatible agent loop)       │
├─────────┬──────────┬──────────┬────────┤
│ OpenAI  │ Claude   │ Gemini   │ Ollama │
├─────────┴──────────┴──────────┴────────┤
│         Agent Orchestration             │
│    Role templates · Tool calling        │
├─────────────────────────────────────────┤
│      🧠 DeepBrain Memory Engine         │
│   6-Layer · 4-Gate · Zero Dependencies  │
│   SQLite-only · 100% Local · Evolving   │
└─────────────────────────────────────────┘
```

**Key difference from Hermes:** Hermes stores skills as static Markdown files. Leaper Agent's DeepBrain **automatically extracts, validates, and evolves knowledge** from every conversation — no manual curation needed.

## ⚡ Hermes Compatibility

Leaper Agent is built on the Hermes Agent foundation. If you're familiar with Hermes, you'll feel at home:

- Same agent loop architecture
- Same multi-provider model support
- Same tool runtime
- **Plus:** 6-layer evolving memory that Hermes doesn't have

## 🔌 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 | ✅ |

## 📊 vs Other Frameworks

| | Leaper Agent | Hermes | CrewAI | AutoGen | LangGraph |
|---|:---:|:---:|:---:|:---:|:---:|
| Memory that evolves | ✅ 6-layer | ❌ Static files | ❌ Flat KV | ❌ Chat history | ❌ Checkpoints |
| Knowledge quality control | ✅ 4-Gate | ❌ | ❌ | ❌ | ❌ |
| Meta-knowledge | ✅ | ❌ | ❌ | ❌ | ❌ |
| Multi-provider | ✅ | ✅ | ✅ | ✅ | ✅ |
| Zero memory dependencies | ✅ SQLite only | N/A | ❌ Redis/Qdrant | ❌ | ❌ Vector DB |
| Hermes compatible | ✅ | ✅ | ❌ | ❌ | ❌ |

## 🇨🇳 China Version / 中国版

For Chinese LLM providers (DeepSeek, 通义千问, 智谱, Moonshot) + 150 role templates:

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

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

## 🔗 Ecosystem

| Project | Description |
|---------|-------------|
| [OPC DeepBrain](https://github.com/deepleaper/opc-deepbrain) | Standalone memory engine (use in any framework) |
| [OPC Agent](https://github.com/deepleaper/opc-agent) | Local-first agent with Ollama |
| [Leaper Agent CN](https://github.com/deepleaper/leaper-agent-cn) | China-optimized with 150 templates |

## 📄 License

[BSL-1.1](LICENSE) — Free for non-competitive use. Converts to Apache-2.0 after 4 years.

## 🤝 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)**

*Other agents forget. Leaper Agent evolves.*

</div>
