🧬 GenericAgent:11K Stars 的自进化 AI Agent,3K 行种子代码长出专属技能树
一句话:一个极简的自进化 Agent 框架,核心只有 ~3000 行代码 + ~100 行 Agent 循环,9 个原子工具就能让 LLM 完全控制你的电脑——而且每次完成任务都会自动长出新 skill,越用越强。
GenericAgent 是 lsdefine 团队开源的「自进化」Agent 框架。和那些动不动就几万行代码、预装几百个工具的 Agent 不同,它只有 3K 行核心代码。但它有个杀手级特性:每次完成任务,会自动把执行路径结晶成一个 skill,下次遇到类似任务直接复用。
它的 README 里有个很狂的声明:这个仓库里的一切——从装 Git、跑 git init 到每条 commit 信息——都是 GenericAgent 自己完成的,作者从来没打开过终端。
为什么它值得关注
| 维度 | GenericAgent | 其他 Agent 框架 |
|------|-------------|----------------|
| 核心代码量 | ~3,000 行 | 通常 5 万+ |
| 上下文消耗 | <30K tokens | 200K–1M |
| skill 管理 | 自动结晶(自进化) | 手动预装 |
| 系统控制 | 9 个原子工具全掌控 | 需单独配置 |
最惊艳的是它的自进化机制:
[新任务] → [自主探索(装依赖、写脚本、调试验证)]
→ [把执行路径结晶为 skill] → [写入记忆层]
→ [下次遇到类似任务直接调用]
用作者的话说:"不要预装 skill——让它们自己长出来。"
快速上手
# 1. 克隆仓库
git clone https://github.com/lsdefine/GenericAgent.git
cd GenericAgent
# 2. 安装依赖
pip install requests streamlit pywebview # 桌面 GUI
pip install requests textual # 终端 UI
# 3. 配置 API Key
cp mykey_template.py mykey.py
# 编辑 mykey.py,填入你的 LLM API Key
# 4. 启动
python launch.pyw
你也可以用 uv 来跑(现代 Python 用户首选):
git clone https://github.com/lsdefine/GenericAgent.git
cd GenericAgent
uv venv
uv pip install -e ".[ui]"
cp mykey_template.py mykey.py
python launch.pyw
自进化有多强?
看这个表格就懂了:
| 你说什么 | 第一次 | 之后每次 |
|---------|-------|---------|
| "读我的微信消息" | 装依赖→逆向数据库→写读取脚本→保存 skill | 一行调用 |
| "监控股票,有异动提醒我" | 装 mootdx→搭建选股流程→配 cron→保存 skill | 一键启动 |
| "用 Gmail 发这个文件" | 配置 OAuth→写发送脚本→保存 skill | 随时可用 |
几周后,你的 Agent 实例就会拥有一个全世界独一无二的 skill 树——全部从 3K 行种子代码长出来的。
实用场景
技术报告
团队已在 arXiv 发表技术报告:GenericAgent: A Token-Efficient Self-Evolving LLM Agent via Contextual Information Density Maximization
📊 数据速览:⭐ 11.1K stars | 🐍 Python | 📄 arXiv 论文 | 🗓️ 2026 年 1 月开源
🧬 GenericAgent: 11K Stars Self-Evolving AI Agent — 3K Lines Seed, Grows Your Personal Skill Tree
The pitch: A minimal self-evolving autonomous agent framework with ~3,000 lines of core code and 9 atomic tools. Every time it completes a task, it automatically crystallizes the execution path into a reusable skill — the more you use it, the smarter it gets.
GenericAgent is a self-evolving autonomous agent framework by lsdefine. Unlike bloated alternatives packing tens of thousands of lines and hundreds of pre-loaded tools, its core is just ~3K lines of code. The killer feature: every solved task is automatically crystallized into a skill for direct reuse later.
The README makes a bold claim: Everything in this repository — from installing Git and running git init to every commit message — was completed autonomously by GenericAgent. The author never opened a terminal once.
Why It Stands Out
| Dimension | GenericAgent | Other Frameworks |
|-----------|-------------|------------------|
| Core code | ~3,000 lines | 50K+ typical |
| Context window | <30K tokens | 200K–1M |
| Skill management | Auto-crystallization (self-evolving) | Manual pre-loading |
| System control | 9 atomic tools | Separate config needed |
The self-evolution mechanism in action:
[New Task] → [Autonomous Exploration (install deps, write scripts, debug & verify)]
→ [Crystallize Execution Path into Skill] → [Write to Memory Layer]
→ [Direct Recall on Next Similar Task]
The philosophy: "Don't preload skills — evolve them."
Quick Start
# 1. Clone the repo
git clone https://github.com/lsdefine/GenericAgent.git
cd GenericAgent
# 2. Install dependencies
pip install requests streamlit pywebview # Desktop GUI
pip install requests textual # Terminal UI
# 3. Configure API Key
cp mykey_template.py mykey.py
# Edit mykey.py and fill in your LLM API Key
# 4. Launch
python launch.pyw
For modern Python users with uv:
git clone https://github.com/lsdefine/GenericAgent.git
cd GenericAgent
uv venv
uv pip install -e ".[ui]"
cp mykey_template.py mykey.py
python launch.pyw
Real-World Evolution
| You Say | First Time | Every Time After |
|---------|-----------|-----------------|
| "Read my WeChat messages" | Install deps → reverse DB → write read script → save skill | one-line invoke |
| "Monitor stocks and alert me" | Install mootdx → build selection flow → configure cron → save skill | one-line start |
| "Send this file via Gmail" | Configure OAuth → write send script → save skill | ready to use |
After a few weeks, your agent instance will have a skill tree no one else in the world has — all grown from 3K lines of seed code.
Key Features
Technical Report
The team published on arXiv: GenericAgent: A Token-Efficient Self-Evolving LLM Agent via Contextual Information Density Maximization
📊 Quick Stats:⭐ 11.1K stars | 🐍 Python | 📄 arXiv paper | 🗓️ Jan 2026 release