GenericAgent - A3 Lab's universal self-evolving LLM agent system
GenericAgent (GA) is a general-purpose, self-evolving LLM agent system developed by A3 Lab, with 'maximizing contextual information density' as its core design principle. GenericAgent utilizes 9 atomic tools and a 30k context window...
What is GenericAgent?
GenericAgent (GA) is a general-purpose, self-evolving LLM agent system developed by A3 Lab, with "maximizing context information density" as its core design principle. Through 9 atomic tools, a 30k context window, and a four-layer hierarchical memory architecture, GenericAgent achieves 100% task completion on Lifelong AgentBench, with token consumption at 27.7% of Claude Code and 15.5% of OpenClaw. GenericAgent supports the evolution of experience into reusable SOPs and executable code, possesses cross-task self-evolution capabilities, has only 3300 lines of code, and runs as a self-hosted CLI.
Main functions of GenericAgent
-
Minimalist Atom ToolsetIt provides nine atomic tools: file_read, file_patch, file_write, code_run, web_scan, web_execute_js, update_working_checkpoint, start_long_term_update, and ask_user, covering five major capability domains: file operation, code execution, web page interaction, memory management, and manual intervention.
-
Layered on-demand memoryIt adopts a four-level architecture: L0 meta-rules, L1 index layer, L2 fact layer, L3 SOP layer, and L4 raw archive layer, using L1 resident context and deep memory for explicit reading on demand.
-
Self-evolution abilityThe verified execution trajectory is stored as a reusable SOP file and executable script, following the "No Execution, No Memory" principle, to achieve cross-task experience accumulation and capability evolution.
-
Context compression managementBy employing a four-stage strategy of tool output truncation, tag-level compression, message eviction, and working memory anchors, the active context is kept below 30k tokens.
-
Dual-mode executionIt supports Interact mode for handling user-initiated tasks, and Reflect mode for automatically monitoring environmental changes and triggering tasks as a watchdog.
The technical principle of GenericAgent
-
Maximizing contextual information densityThe context quality is broken down into three dimensions: completeness, conciseness, and naturalness. Through minimalist tools, hierarchical memory, self-evolution, and compression mechanisms, the proportion of decision-related information is maximized within a limited window.
-
Tool minimization and compositional generalizationBased on the two conditions of atomicity (cannot be further decomposed) and combinatorial generalization (complex behaviors are achieved through sequence combination), 9 atomic tools are retained to avoid prompt overhead and policy ambiguity caused by tool expansion.
-
Hierarchical memory architectureThe L1 index layer only records "the existence of a certain type of knowledge" rather than the content itself, and the LLM acts as a decoder to retrieve it on demand; a meta-memory layer is introduced to define global rules and update boundaries; triggered commits are used instead of immediate writes, and the experience is incrementally written to long-term memory only after it has been verified.
-
Self-evolutionary pipelineThe tool layer and knowledge layer are separated, so that learning new tasks does not interfere with existing skills; during the integration phase triggered by milestone events, the content verified by successful tool execution is retained; a three-level failure escalation mechanism (partial repair → strategy switching → manual intervention) is introduced to prevent error loops.
-
Four-stage context truncationPhase 1: Prune the tool's return value according to the character threshold; Phase 2: Replace recurring working memory blocks and truncate tag content approximately every 5 rounds; Phase 3: Evict the oldest message according to FIFO; Phase 4: Attach working memory anchors as the sole source of long-term memory.
How to use GenericAgent
-
Environmental preparationEnsure you have a local Python runtime environment and a compatible LLM API Key (supporting backends such as Claude, GPT, and Gemini).
-
Get codeWe obtained approximately 3,300 lines of core source code and deployment instructions through the paper publication channel (arXiv:2604.17091).
-
Configuration and installationComplete dependency installation and LLM backend configuration locally, and set the context budget and character budget thresholds to 30k tokens.
-
Start running: Start GA as a self-hosted CLI, enter Interact mode to directly input task commands, or configure Reflect mode trigger scripts to achieve automatic monitoring.
-
Task executionThe agent constructs an execution context based on the current task and related memories, generates tool calls or outputs, and updates the system state through structured feedback.
-
Experience accumulationAfter the task is completed, the system automatically compresses and archives the verified execution trajectory to L4. After being triggered and integrated, it is stored in L2/L3 long-term memory for reuse in subsequent tasks.
Key information and usage requirements for GenericAgent
-
Development TeamDeveloped by A3 Lab (Advantage AI Agent Lab, a joint research team of Shenzhen Aquaintelling Technology and Fudan University).
-
Open source formThe core code consists of approximately 3300 lines, with the central Agent Loop consisting of only 92 lines. It is deployed as a self-hosted CLI program, with the command line serving as the native execution interface.
-
Model compatibilityModel-independent architecture, supports mainstream LLM backends such as Claude, GPT, and Gemini, and can be replaced without affecting execution logic and tool interfaces.
-
Context budgetBy default, the active context is limited to 30k tokens, and a character field heuristic (α≈3 chars/token) is used for budget management.
-
Execution BoundaryThe default execution limit for a single session is 30 rounds. It supports multi-process isolation and long-term task splitting through sub-Agent dispatch.
-
Usage thresholdRequires configuration of an LLM API Key and local computing environment running permissions; suitable for self-hosted deployment by users with technical backgrounds.
GenericAgent's core advantages
-
Ultimate Token EfficiencyAchieve 100% completion rate on Lifelong AgentBench with 222k input tokens, a 72.3% reduction compared to Claude Code and an 84.5% reduction compared to OpenClaw.
-
Continuous self-evolutionAfter 9 rounds of repetitive tasks, token consumption decreased by 89.6%, and LLM calls converged from 32 to 5, achieving the compounding effect of "cold start-fast convergence".
-
Minimalist architecture3,300 lines of core code vs. 530,000 lines of OpenClaw: The minimalist design gives the Agent the potential to understand and modify its own architecture.
-
High-density memoryAfter loading 20 skills, the complete prompt only requires 2298 tokens, which is an order of magnitude lower than Claude Code (22821), Codex (23932), and OpenClaw (43321).
-
Strong web page capabilitiesIt outperforms OpenClaw in WebCanvas, BrowseComp-ZH, and Custom Tasks, while its token consumption is only 1/4 to 1/3 of OpenClaw's.
GenericAgent project address
- GitHub repositoryhttps://github.com/lsdefine/GenericAgent
- arXiv technical paper: https://arxiv.org/pdf/2604.17091
Comparison of GenericAgent with similar products
| Dimension | GenericAgent | OpenClaw | Claude Code |
|---|---|---|---|
| Core code size | ~3,300 lines | ~530,000 lines | Not disclosed |
| Number of atomic tools | 9 | 18 tool factories + plugins | 53 |
| Contextual strategy | 30k compressed window | Depends on 1M extended window | Depends on long context |
| Lifelong AgentBench completion rate | 100% | 70% | 75% |
| Enter Token in Lifelong AgentBench | 222k | 1.43M | 800k |
| Self-evolution ability | Experience is distilled into SOPs/code | No significant convergence trend | No cross-session memory |
| Memory architecture | Four-layer hierarchical loading on demand | Retrieval Enhancement of Raw Logs | No persistent memory |
| Web browsing token efficiency | 0.18M (WebCanvas) | 0.71M | Untested |
Application scenarios of GenericAgent
-
Long-term software engineeringGenericAgent supports development tasks that require continuous multi-round interactions, such as GitHub repository research, multi-file code refactoring, and complex code editing and debugging.
-
Automated web browsingGenericAgent can perform information retrieval tasks that require cross-page operations, such as e-commerce price comparison, extraction of listed company reports, export of flight queries, and verification of news subscription streams.
-
Financial and Business AnalysisComplete data-intensive research tasks such as dynamic financial data crawling and financial statement analysis in scenarios such as RealFin-benchmark.
-
Government and Educational Institutions Service NavigationAutomate complex processes that require cross-page state transfer, such as navigation of government service websites and archiving of university courses.
-
Lifetime personal assistantAs a personal agent that accumulates user preferences, work habits, and external service knowledge across sessions, it continuously evolves to adapt to users' long-term needs.