What Is GenericAgent
GenericAgent (GA) is a general self-evolving LLM Agent system launched by A3 Lab, with "maximizing contextual information density" as its core design principle. Through 9 atomic tools, a 30k context window, and a four-layer hierarchical memory architecture, GenericAgent achieves a 100% task completion rate on Lifelong AgentBench, with token consumption at 27.7% of Claude Code and 15.5% of OpenClaw. GenericAgent supports the consolidation 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.
GenericAgent's Main Features
-
Minimalist Atomic Tool Set: Provides a total of 9 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 operations, code execution, web interaction, memory management, and human intervention.
-
Hierarchical On-Demand Memory: Adopts a four-level architecture consisting of L0 meta-rules, L1 index layer, L2 fact layer, L3 SOP layer, and L4 raw archive layer, with L1 kept resident in context and deeper memory explicitly read on demand.
-
Self-Evolution Capability: Consolidates verified execution traces into reusable SOP files and executable scripts, follows the "No Execution, No Memory" principle, and enables cross-task experience accumulation and capability evolution.
-
Context Compression Management: Through a four-stage strategy of tool output truncation, tag-level compression, message eviction, and working memory anchors, keeps the active context stably within 30k tokens.
-
Dual-Mode Execution: Supports Interact mode for handling user-initiated tasks, and Reflect mode, which acts as a Watchdog to automatically monitor environmental changes and trigger tasks.
GenericAgent's Technical Principles
-
Maximizing Contextual Information Density: Decomposes context quality into three dimensions—Completeness, Conciseness, and Naturalness—and, through minimalist tools, hierarchical memory, self-evolution, and compression mechanisms, maximizes the proportion of decision-relevant information within a limited window.
-
Tool Minimization and Compositional Generalization: Based on the two conditions of atomicity (cannot be further decomposed) and compositional generalization (complex behaviors are achieved through sequential composition), retains 9 atomic tools to avoid the prompt overhead and policy ambiguity caused by tool proliferation.
-
Hierarchical Memory Architecture: The L1 index layer records only "the existence of a certain type of knowledge" rather than its content, with the LLM acting as a decoder to retrieve it on demand; introduces a meta-memory layer to define global rules and update boundaries; and adopts trigger-based commits rather than immediate writes, with experience incrementally written to long-term memory only after verification.
-
Self-Evolution Pipeline: Separates the tool layer from the knowledge layer, so that learning new tasks does not interfere with existing skills; triggers a consolidation phase at milestone events, retaining content verified by successful tool execution; and introduces a three-level failure escalation mechanism (local repair → strategy switch → human intervention) to prevent error loops.
-
Four-Stage Context Truncation: Stage one trims tool return values according to a character threshold; stage two replaces duplicate working memory blocks approximately every 5 turns and truncates tag content; stage three evicts the oldest messages on a FIFO basis; stage four appends working memory anchors as the sole source of long-term memory.
How to Use GenericAgent
-
Environment Preparation: Ensure a local Python runtime environment is available and prepare a compatible LLM API Key (supporting backends such as Claude, GPT, and Gemini).
-
Get the code: Obtain approximately 3,300 lines of core source code and deployment guidance through the paper's publication channel (arXiv:2604.17091).
-
Configure and install: Complete dependency installation and LLM backend configuration locally, setting a 30k token context budget and character budget thresholds.
-
Launch and run: Launch GA as a self-hosted CLI; enter Interact mode to directly input task instructions, or configure a trigger script for Reflect mode to enable automatic monitoring.
-
Task execution: The Agent builds an execution context based on the current task and relevant memories, generates tool calls or outputs, and updates the system state through structured feedback.
-
Experience consolidation: After task completion, the system automatically compresses and archives the verified execution trajectory to L4; after triggered integration, it is consolidated into L2/L3 long-term memory for reuse in subsequent tasks.
Key information and usage requirements of GenericAgent
-
Development team: Developed by A3 Lab (Advantage AI Agent Lab, a joint research team of Shenzhen Aquaintelling Technology and Fudan University).
-
Open-source form: About 3,300 lines of core code, with the central Agent Loop only 92 lines; deployed as a self-hosted CLI program, with the command line as the native execution interface.
-
Model compatibility: Model-agnostic architecture, supporting mainstream LLM backends such as Claude, GPT, and Gemini, which can be replaced without affecting execution logic and tool interfaces.
-
Context budget: By default, the active context is kept within 30k tokens, using a character-domain heuristic (α≈3 chars/token) for budget management.
-
Execution boundaries: A default limit of 30 execution rounds per session, supporting multi-process isolation and long-horizon task decomposition through sub-Agent dispatch.
-
Usage threshold: Requires configuring an LLM API Key and having permission to run in a local computing environment; suitable for users with a technical background to self-host and deploy.
Core advantages of GenericAgent
-
Extreme Token efficiency: Achieves a 100% completion rate on Lifelong AgentBench with 222k input tokens, 72.3% lower than Claude Code and 84.5% lower than OpenClaw.
-
Continuous self-evolution: After 9 rounds of repeated tasks, token consumption drops by 89.6%, and LLM calls converge from 32 to 5, realizing the compounding effect of "cold start - rapid convergence".
-
Minimalist architecture: 3,300 lines of core code vs. 530,000 lines for OpenClaw; the minimalist design gives the Agent the potential to understand and modify its own architecture.
-
High-density memory: After loading 20 skills, the complete prompt is only 2,298 tokens, an order of magnitude lower than Claude Code (22,821), Codex (23,932), and OpenClaw (43,321).
-
Strong web capabilities: Scores on WebCanvas, BrowseComp-ZH, and Custom Tasks all exceed OpenClaw, while token consumption is only 1/4-1/3 of it.
Project addresses of GenericAgent
- GitHub repository:https://github.com/lsdefine/GenericAgent
- arXiv technical paper:https://arxiv.org/pdf/2604.17091
Comparison of GenericAgent with similar competing 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 |
| Context strategy | 30k compression window | Relies on 1M extended window | Relies on long context |
| Lifelong AgentBench completion rate | 100% | 70% | 75% |
| Lifelong AgentBench input tokens | 222k | 1.43M | 800k |
| Self-evolution capability | Experience distilled into SOP/code | No significant convergence trend | No cross-session memory |
| Memory architecture | Four-layer hierarchical on-demand loading | Retrieval-augmented raw logs | No persistent memory |
| Web browsing token efficiency | 0.18M (WebCanvas) | 0.71M | Not evaluated |
Application scenarios of GenericAgent
-
Long-horizon software engineering: GenericAgent supports development tasks that require sustained multi-turn interaction, such as GitHub repository research, multi-file code refactoring, and complex code editing and debugging.
-
Automated web browsing: GenericAgent can perform information retrieval tasks that require cross-page operations, such as e-commerce price comparison, listed company report extraction, flight query export, and news subscription feed verification.
-
Financial and business analysis: In scenarios such as RealFin-benchmark, it completes data-intensive research tasks such as dynamic financial data crawling and financial statement analysis.
-
Government and educational institution service navigation: Completes complex process automation that requires cross-page state transitions, such as government service website navigation and university course archiving.
-
Lifelong personal assistant: As a personal agent that accumulates user preferences, work habits, and knowledge of external services across sessions, it continuously evolves to adapt to users' long-term needs.