by lsdefine
Self-evolving agent: grows skill tree from 3.3K-line seed, achieving full system control with 6x less token consumption
# Add to your Claude Code skills
git clone https://github.com/lsdefine/GenericAgentLast scanned: 4/20/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-04-20T06:14:38.012Z",
"semgrepRan": false,
"npmAuditRan": true,
"pipAuditRan": true
}GenericAgent is a minimal, self-evolving autonomous agent framework. Its core is just ~3K lines of code. Through 9 atomic tools + a ~100-line Agent Loop, it grants any LLM system-level control over a local computer β covering browser, terminal, filesystem, keyboard/mouse input, screen vision, and mobile devices (ADB).
Its design philosophy: don't preload skills β evolve them.
Every time GenericAgent solves a new task, it automatically crystallizes the execution path into an skill for direct reuse later. The longer you use it, the more skills accumulate β forming a skill tree that belongs entirely to you, grown from 3K lines of seed code.
π€ Self-Bootstrap Proof β Everything in this repository, from installing Git and running
git initto every commit message, was completed autonomously by GenericAgent. The author never opened a terminal once.
No comments yet. Be the first to share your thoughts!
This is what fundamentally distinguishes GenericAgent from every other agent framework.
[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]
| What you say | What the agent does the 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.
| π§ Food Delivery Order | π Quantitative Stock Screening | |:---:|:---:| | | | | "Order me a milk tea" β Navigates the delivery app, selects items, and completes checkout automatically. | "Find GEM stocks with EXPMA golden cross, turnover > 5%" β Screens stocks with quantitative conditions. | | π Autonomous Web Exploration | π° Expense Tracking | π¬ Batch Messaging | | | | | | Autonomously browses and periodically summarizes web content. | "Find expenses over Β₯2K in the last 3 months" β Drives Alipay via ADB. | Sends bulk WeChat messages, fully driving the WeChat client. |
# 1. Clone the repo
git clone https://github.com/lsdefine/GenericAgent.git
cd GenericAgent
# 2. Install minimal dependencies
pip install requests streamlit pywebview
# 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
If you prefer a modern Python workflow, GenericAgent also provides a minimal pyproject.toml:
git clone https://github.com/lsdefine/GenericAgent.git
cd GenericAgent
uv pip install -e ".[ui]" # Core + GUI dependencies
cp mykey_template.py mykey.py
python launch.pyw
GenericAgent is meant to grow its environment through the Agent itself, not by pre-installing every possible package.
Full guide: GETTING_STARTED.md
# mykey.py
tg_bot_token = 'YOUR_BOT_TOKEN'
tg_allowed_users = [YOUR_USER_ID]
python frontends/tgapp.py
Besides the default Streamlit web UI, you can also try other frontend styles:
python frontends/qtapp.py # Qt-based desktop app
streamlit run frontends/stapp2.py # Alternative Streamlit UI
The default Streamlit desktop UI started by python launch.pyw, plus the QQ / Telegram / Feishu / WeCom / DingTalk frontends, support these chat commands:
/new - start a fresh conversation and clear the current context/continue - list recoverable conversation snapshots/continue N - restore the Nth recoverable conversation| Feature | GenericAgent | OpenClaw | Claude Code |
|------|:---:|:---:|:---:|
| Codebase | ~3K lines | ~530,000 lines | Open-sourced (large) |
| Deployment | pip install + API Key | Multi-service orchestration | CLI + subscription |
| Browser Control | Real browser (session preserved) | Sandbox / headless browser | Via MCP plugin |
| OS Control | Mouse/kbd, vision, ADB | Multi-agent delegation | File + terminal |
| Self-Evolution | Autonomous skill growth | Plugin ecosystem | Stateless between sessions |
| Out of the Box | A few core files + starter skills | Hundreds of modules | Rich CLI toolset |
GenericAgent accomplishes complex tasks through Layered Memory Γ Minimal Toolset Γ Autonomous Execution Loop, continuously accumulating experience during execution.
1οΈβ£ Layered Memory System
Memory crystallizes throughout task execution, letting the agent build stable, efficient working patterns over time.
2οΈβ£ Autonomous Execution Loop
Perceive environment state β Task reasoning β Execute tools β Write experience to memory β Loop
The entire core loop is just ~100 lines of code (agent_loop.py).
3οΈβ£ Minimal Toolset
GenericAgent provides only 9 atomic tools, forming the foundational capabilities for interacting with the outside world.
| Tool | Function |
|------|------|
| code_run | Execute arbitrary code |
| file_read | Read files |
| file_write | Write files |
| file_patch | Patch / modify files |
| web_scan | Perceive web content |
| web_execute_js | Control browser behavior |
| ask_user | Human-in-the-loop confirmation |
Additionally, 2 memory management tools (
update_working_checkpoint,start_long_term_update) allow the agent to persist context and accumulate experience across sessions.
4οΈβ£ Capability Extension Mechanism
Capable of dynamically creating new tools.
Via code_run, GenericAgent can dynamically install Python packages, write new scripts, call external APIs, or control hardware at runtime β crystallizing temporary abilities into permanent tools.
If this project helped you, please consider leaving a Star! π
You're also welcome to j