The Problem

Most agent frameworks ship with pre-baked skills and consume 200K–1M token context windows. GenericAgent takes the opposite approach: a ~3.3K-line core with 9 atomic tools and a ~100-line agent loop. It solves tasks by exploring, then crystallizes each successful execution path into a reusable skill stored in memory/. The longer it runs, the more capable it becomes—without retraining or redeployment.

What This Does

The core lives in ga.py (36 functions, 1 class). It defines code_run, stream_reader, first_init_driver, and web_scan—the primitives that give an LLM control over browser, terminal, filesystem, keyboard/mouse, screen vision, and ADB. agentmain.py (10 functions, 1 class) is the hub: 9 modules import it, and it owns load_tool_schema, get_system_prompt, and next_llm.

llmcore.py is the largest file at 869 lines, handling LLM sessions, history compression, and key management. memory/skill_search/skill_search/engine.py implements the skill-search mechanism with quality_score and _run. Frontends in frontends/ connect to WeChat, DingTalk, QQ, Telegram, and a desktop pet.

How It Is Wired

Execution starts at main in memory/skill_search/skill_search/__main__.py:60, reaching 22 functions. The deepest path is run in TMWebDriver.py:104, reaching 65 functions—the browser driver is the most far-reaching component. From there, the shortest path to an external effect is run -> consume_file which hits the filesystem via os.remove.

The call graph shows 570 internal edges. set is called from 15 places, LLMSession from 12, StepOutcome from 11. agentmain is the most-imported module (9 importers, instability 0.25), followed by llmcore (8 importers, instability 0). No circular dependencies exist. The frontends (fsapp, dingtalkapp, qqapp, tgapp) have instability 1.0—pure leaves that depend on everything else.

Key file responsibilities: ga.py runs external commands and reads/writes files; frontends/wechatapp.py performs cryptographic operations and makes network calls; memory/keychain.py manages secrets and is imported by 9 files; llmcore.py makes outbound network calls and reads/writes files. Nine functions make network calls, 19 touch the filesystem, 6 run external commands.

How To Use It

Setup: No pyproject.toml, requirements.txt, or lockfile exists. Install dependencies manually based on imports (Flask, requests, websockets, Pillow). Configuration: Copy mykey_template.py to mykey.py and populate API keys. Running: Launch launch.pyw or hub.pyw; for the CLI skill search, run python -m memory.skill_search.skill_search. The README documents no formal install command.

Real-World Use

A user asks "Order me a milk tea." The agent drives a browser via TMWebDriver, navigates the delivery app, completes checkout, then crystallizes the execution path into a skill stored under memory/. Next time, "Order me a milk tea" triggers a one-line skill invocation instead of full exploration.

Code Health & Issues

Static analysis found 62 findings: 8 high, 53 medium, 1 low across 7 kinds.

  • High - Deep nesting (max depth 8) in agentmain.py, llmcore.py, TMWebDriver.py—control flow is hard to follow. Fix with early returns.
  • High - Oversized files: llmcore.py at 869 lines, frontends/qtapp.py, simphtml.py. Split by responsibility.
  • Medium - Broad exception handling (21 cases) in agentmain.py, llmcore.py, engine.py—swallows errors. Catch specific exceptions.
  • Medium - High branching density (89 branches/241 lines) in agentmain.py, llmcore.py, agent_loop.py.
  • Medium - Empty catch blocks in assets/tmwd_cdp_bridge/background.js and disable_dialogs.js.
  • Medium - Files opened without context managers in frontends/stapp2.py, tgapp.py, wechatapp.py.
  • Medium - Duplicated 6-line blocks across 6 frontend files.
  • High - No CI pipeline (39 source files, zero automation). Add a build/test workflow.
  • Medium - assets/demo/selectstock.gif is 5.3MB; move to LFS.

The Bottom Line

The self-evolving skill tree is a genuinely different approach—token-efficient and practical. The architecture is sound with no circular dependencies, but the code needs refactoring (deep nesting, oversized files) and CI before production use. Best suited for developers who want an autonomous agent that grows with their workflows and are willing to invest in cleanup.