Skip to content

luongtt/GenericAgent

 
 

Repository files navigation


🌟 Overview

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 init to every commit message, was completed autonomously by GenericAgent. The author never opened a terminal once.

📋 Core Features

  • Self-Evolving: Automatically crystallizes each task into an skill. Capabilities grow with every use, forming your personal skill tree.
  • Minimal Architecture: ~3K lines of core code. Agent Loop is ~100 lines. No complex dependencies, zero deployment overhead.
  • Strong Execution: Injects into a real browser (preserving login sessions). 9 atomic tools take direct control of the system.
  • High Compatibility: Supports Claude / Gemini / Kimi / MiniMax and other major models. Cross-platform.

🧬 Self-Evolution Mechanism

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.

🎯 Demo Showcase
🧋 Food Delivery Order 📈 Quantitative Stock Screening
Order Tea Stock Selection
"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
Web Exploration Alipay Expense
Autonomously browses and periodically summarizes web content. "Find expenses over ¥2K in the last 3 months" — Drives Alipay via ADB.

📅 Latest News


🚀 Quick Start

Method 1: Standard Installation

# 1. Clone the repo
git clone https://github.com/lsdefine/GenericAgent.git
cd GenericAgent

# 2. Install minimal dependencies
pip install 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

Full guide: GETTING_STARTED.md


🤖 Bot Interface (Optional)

Telegram Bot

# mykey.py
tg_bot_token = 'YOUR_BOT_TOKEN'
tg_allowed_users = [YOUR_USER_ID]
python frontends/tgapp.py

Alternative App Frontends

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

📊 Comparison with Similar Tools

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

🧠 How It Works

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.

  • L0 — Meta Rules: Core behavioral rules and system constraints of the agent
  • L1 — Insight Index: Minimal memory index for fast routing and recall
  • L2 — Global Facts: Stable knowledge accumulated over long-term operation
  • L3 — Task Skills / SOPs: Reusable workflows for completing specific task types
  • L4 — Session Archive: Archived task records distilled from finished sessions for long-horizon recall

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.

GenericAgent Workflow
GenericAgent Workflow Diagram

⭐ Support

If this project helped you, please consider leaving a Star! 🙏

You're also welcome to join our GenericAgent Community Group for discussion, feedback, and co-building 👏

WeChat Group 4
WeChat Group 4 QR Code
WeChat Group 3
WeChat Group 3 QR Code
Feishu Group
Feishu Group QR Code

🚩 Friendly Links

Thanks for the support from the LinuxDo community!

LinuxDo

📄 License

MIT License — see LICENSE

📈 Star History

Star History Chart

About

Self-evolving agent: grows skill tree from 3.3K-line seed, achieving full system control with 6x less token consumption

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 95.2%
  • JavaScript 3.9%
  • Other 0.9%