| name | genericagent-self-evolving-ai-agent |
| description | Self-evolving autonomous agent framework with skill tree growth, browser/desktop/mobile control, and hierarchical memory system |
| triggers | ["set up GenericAgent for autonomous task automation","create a self-evolving AI agent with GenericAgent","configure GenericAgent with browser and system control","build skills and memory layers with GenericAgent","automate desktop tasks using GenericAgent","integrate GenericAgent with Claude/Gemini/GPT models","implement autonomous web browsing with GenericAgent","create custom agent skills in GenericAgent"] |
GenericAgent Self-Evolving AI Agent
Skill by ara.so — AI Agent Skills collection.
GenericAgent is a minimal (~3K LOC) self-evolving autonomous agent framework that grants LLMs system-level control over computers. It features 9 atomic tools for browser, terminal, filesystem, keyboard/mouse, screen vision, and mobile (ADB) control. The core innovation is automatic skill crystallization: every solved task becomes a reusable skill, forming a personal skill tree that grows with usage while consuming 6x fewer tokens than traditional agents.
Installation
Quick Install (Recommended)
Windows PowerShell:
powershell -ExecutionPolicy Bypass -c "$env:GLOBAL=1; irm http://fudankw.cn:9000/files/ga_install.ps1 | iex"
Linux/macOS:
GLOBAL=1 bash -c "$(curl -fsSL http://fudankw.cn:9000/files/ga_install.sh)"
Developer Install
git clone https://github.com/lsdefine/GenericAgent.git
cd GenericAgent
uv venv
uv pip install -e ".[ui]"
cp mykey_template.py mykey.py
Important: Use Python 3.11 or 3.12. Python 3.14 is incompatible with pywebview and other dependencies.
Configuration
API Key Setup
Edit mykey.py:
ANTHROPIC_API_KEY = "your-key-here"
GEMINI_API_KEY = "your-key-here"
OPENAI_API_KEY = "your-key-here"
OPENAI_BASE_URL = "https://api.openai.com/v1"
MOONSHOT_API_KEY = "your-key-here"
MINIMAX_API_KEY = "your-key-here"
MINIMAX_GROUP_ID = "your-group-id"
Better practice using environment variables:
import os
ANTHROPIC_API_KEY = os.getenv("ANTHROPIC_API_KEY")
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")
Memory System Configuration
GenericAgent uses a 4-layer hierarchical memory system (L1-L4):
memory_config = {
"l1_working_memory": True,
"l2_episodic_memory": True,
"l3_skill_library": True,
"l4_session_archive": True
}
Core Architecture
Agent Loop (100 lines)
The core agent loop is minimal:
from genericagent import GenericAgent
agent = GenericAgent(
model="claude-sonnet-4.6",
working_dir="./workspace"
)
result = agent.run("Order me a milk tea from the delivery app")
9 Atomic Tools
GenericAgent provides 9 atomic tools for system control:
- Browser Control - Real browser injection (preserves sessions)
- Terminal Execution - Shell command execution
- File Operations - Read/write/search filesystem
- Screen Vision - Screenshot capture and analysis
- Keyboard Input - Direct keyboard control
- Mouse Control - Click, drag, move operations
- ADB Mobile - Android device control
- Python REPL - Interactive Python execution
- Memory Operations - Read/write skill library
Usage Patterns
Basic Task Execution
from genericagent import GenericAgent
agent = GenericAgent(
model="claude-sonnet-4.6",
verbose=True
)
agent.run("Find all PDF files in ~/Documents and move them to ~/PDFs")
agent.chat("Install the requests library")
agent.chat("Now use it to fetch https://api.github.com/repos/lsdefine/GenericAgent")
agent.chat("Save the star count to stars.txt")
Skill Crystallization
Skills are automatically created when tasks complete:
agent.run("Read my WeChat messages")
agent.run("Read my WeChat messages")
Browser Automation
from genericagent import GenericAgent
agent = GenericAgent(model="claude-sonnet-4.6")
agent.run("""
Navigate to gmail.com, compose an email to john@example.com
with subject 'Q4 Report' and attach the file ~/reports/q4.pdf
""")
agent.run("""
1. Go to Amazon
2. Search for 'wireless keyboard'
3. Filter by 4+ stars and under $50
4. Take screenshots of top 3 results
5. Save product names and prices to products.csv
""")
Desktop Automation
agent = GenericAgent(model="gemini-2.0-flash")
agent.run("""
Open my expense tracking spreadsheet,
find all transactions over $2000 in the last 3 months,
and create a summary chart
""")
agent.run("""
Set up a cron job that runs every day at 9 AM
to backup ~/Documents to ~/Backups
""")
Mobile Device Control (ADB)
agent = GenericAgent(model="claude-sonnet-4.6")
agent.run("""
Open Alipay on my phone,
navigate to transaction history,
find expenses over ¥2000 in last 3 months,
take screenshots
""")
Quantitative Analysis Example
agent = GenericAgent(model="claude-opus-4.6")
agent.run("""
Find GEM stocks with:
- EXPMA golden cross
- Turnover > 5%
- Save results to stocks.csv
""")
Frontends
Desktop GUI
frontends/GenericAgent.exe
python launch.pyw
Terminal UI (TUI v2)
python frontends/tuiapp_v2.py
TUI Commands:
Ctrl+N - New session
Ctrl+S - Save current session
Ctrl+L - Load session
/llm <model> - Switch LLM model
/export - Export conversation
/continue - Resume previous session
Streamlit Web UI
python launch.pyw
IM Bot Frontends
python frontends/tgapp.py
python frontends/wechatapp.py
python frontends/qqapp.py
python frontends/fsapp.py
python frontends/wecomapp.py
python frontends/dingtalkapp.py
Bot Commands:
/new - Start fresh conversation
/continue - List recoverable snapshots
/continue N - Restore snapshot N
Advanced Features
Conductor Sub-Agent Orchestration
from genericagent import GenericAgent, Conductor
main_agent = GenericAgent(model="claude-sonnet-4.6")
conductor = Conductor(main_agent)
conductor.spawn_agent("research", "Research competitors in AI agent space")
conductor.spawn_agent("analysis", "Analyze our user feedback from last month")
conductor.spawn_agent("report", "Draft Q1 roadmap based on research and analysis")
results = conductor.wait_all()
Custom Skill Creation
skill_code = """
def check_stock_alerts():
'''Monitor stocks and send alerts'''
import mootdx
from mootdx.quotes import Quotes
client = Quotes.factory(market='std')
# Custom screening logic
symbols = client.stocks(market='cyb')
for stock in symbols:
# Check conditions
if meets_criteria(stock):
send_alert(stock)
return results
"""
agent.save_skill("stock_monitoring", skill_code)
agent.run("Run my stock monitoring skill")
Session Management
agent.save_session("project_setup")
sessions = agent.list_sessions()
agent.load_session("project_setup")
agent.continue_from_archive(session_id=3)
Scheduler Integration
from genericagent import GenericAgent
import schedule
agent = GenericAgent(model="claude-sonnet-4.6")
def daily_report():
agent.run("Generate daily sales report and email to team@company.com")
schedule.every().day.at("09:00").do(daily_report)
agent.run("""
Set up a scheduled task that runs every morning at 9 AM
to generate a sales report and email it to the team
""")
Side Questions with /btw
agent.chat("Deploy the new feature to production")
agent.chat("/btw what's the current server load?")
Real-World Examples
Autonomous Web Data Collection
agent = GenericAgent(model="claude-sonnet-4.6")
agent.run("""
Visit techcrunch.com, browse the latest AI articles,
summarize the top 5 stories, and save summaries to ai_news.md.
Check back every hour and update the file.
""")
Expense Tracking with Mobile App
agent.run("""
Connect to my Android phone via ADB,
open Alipay, navigate to bill details,
extract all transactions from last quarter,
categorize by type (food, transport, shopping),
create a pie chart visualization,
save report as Q1_expenses.pdf
""")
Bulk Messaging
agent.run("""
Read contacts from team_contacts.csv,
send a WeChat message to each person:
'Reminder: Team meeting tomorrow at 2 PM'
""")
Custom Automation Workflow
agent.run("""
1. Monitor my Gmail for emails with 'URGENT' in subject
2. When found, extract key points
3. Create a task in my todo.txt file
4. Send me a desktop notification
5. Run this check every 15 minutes
""")
Troubleshooting
Python Version Issues
Problem: Installation fails with dependency conflicts
Solution: Ensure Python 3.11 or 3.12:
python --version
TUI Rendering Issues on Windows
Problem: TUI displays broken characters or doesn't respond to input
Solution:
pip install -U textual
python frontends/tuiapp_v2.py
Browser Automation Not Working
Problem: Browser control fails or doesn't preserve sessions
Solution:
agent.run("Install Chrome WebDriver for browser automation")
agent.run("Check if Chrome is installed and accessible")
agent.run("Configure Firefox profile for persistent sessions")
Skill Not Crystallizing
Problem: Task completes but no skill is saved
Solution:
agent.run("Save the last task execution as a skill named 'email_reports'")
agent.run("List all available skills in my library")
agent.config['l3_skill_library'] = True
Memory Context Issues
Problem: Agent forgets previous context or hallucinates
Solution:
agent.run("Show current memory configuration")
agent.clear_l1_memory()
agent.rebuild_l2_memory()
agent.archive_session()
ADB Device Not Found
Problem: Mobile automation fails with "device not found"
Solution:
adb devices
agent.run("Troubleshoot ADB connection to my Android device")
High Token Usage
Problem: Consuming too many tokens per task
Solution:
agent.run("List my most frequently used skills")
agent.run("Archive conversations older than 1 week")
agent = GenericAgent(model="gemini-2.0-flash")
agent.config['verbose'] = True
Best Practices
-
Let Skills Grow Organically: Don't pre-install everything. Let GenericAgent install dependencies as needed and crystallize skills.
-
Use Appropriate Models: Use lighter models (Gemini Flash) for simple tasks, heavier (Claude Opus) for complex reasoning.
-
Leverage Memory Layers: Regularly archive old sessions to L4 to keep L1/L2 context clean.
-
Session Management: Save important sessions with descriptive names for easy recovery.
-
Environment Variables: Always use env vars for API keys, never hardcode.
-
Incremental Complexity: Start with simple tasks, build to complex workflows as skills accumulate.
-
Monitor Token Usage: Track token consumption to optimize model selection and skill reuse.
Resources