genericagent-self-evolving-ai-agent

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GenericAgent Self-Evolving AI Agent

GenericAgent 自进化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.
ara.so提供的Skill — AI Agent技能合集。
GenericAgent是一个轻量型(约3K行代码)的自进化自主Agent框架,让大语言模型(LLM)获得对计算机的系统级控制权。它具备9种原子工具,可实现浏览器、终端、文件系统、键盘/鼠标、屏幕视觉以及移动设备(ADB)控制。核心创新点在于自动技能固化:每一个完成的任务都会成为可复用的技能,形成随使用不断成长的个人技能树,同时相比传统Agent,它的Token消耗减少了6倍。

Installation

安装

Quick Install (Recommended)

快速安装(推荐)

Windows PowerShell:
powershell
powershell -ExecutionPolicy Bypass -c "$env:GLOBAL=1; irm http://fudankw.cn:9000/files/ga_install.ps1 | iex"
Linux/macOS:
bash
GLOBAL=1 bash -c "$(curl -fsSL http://fudankw.cn:9000/files/ga_install.sh)"
Windows PowerShell:
powershell
powershell -ExecutionPolicy Bypass -c "$env:GLOBAL=1; irm http://fudankw.cn:9000/files/ga_install.ps1 | iex"
Linux/macOS:
bash
GLOBAL=1 bash -c "$(curl -fsSL http://fudankw.cn:9000/files/ga_install.sh)"

Developer Install

开发者安装

bash
undefined
bash
undefined

Clone repository

克隆仓库

Create virtual environment (Python 3.11 or 3.12 required)

创建虚拟环境(需要Python 3.11或3.12)

uv venv uv pip install -e ".[ui]"
uv venv uv pip install -e ".[ui]"

Configure API key

配置API密钥

cp mykey_template.py mykey.py
cp mykey_template.py mykey.py

Edit mykey.py with your LLM API credentials

编辑mykey.py,填入你的LLM API凭证


**Important:** Use Python 3.11 or 3.12. Python 3.14 is incompatible with `pywebview` and other dependencies.

**重要提示:** 使用Python 3.11或3.12版本。Python 3.14与`pywebview`及其他依赖不兼容。

Configuration

配置

API Key Setup

API密钥设置

Edit
mykey.py
:
python
undefined
编辑
mykey.py
:
python
undefined

For Claude

用于Claude

ANTHROPIC_API_KEY = "your-key-here"
ANTHROPIC_API_KEY = "your-key-here"

For Gemini

用于Gemini

GEMINI_API_KEY = "your-key-here"
GEMINI_API_KEY = "your-key-here"

For OpenAI-compatible APIs

用于兼容OpenAI的API

OPENAI_API_KEY = "your-key-here" OPENAI_BASE_URL = "https://api.openai.com/v1"
OPENAI_API_KEY = "your-key-here" OPENAI_BASE_URL = "https://api.openai.com/v1"

For Kimi

用于Kimi

MOONSHOT_API_KEY = "your-key-here"
MOONSHOT_API_KEY = "your-key-here"

For MiniMax

用于MiniMax

MINIMAX_API_KEY = "your-key-here" MINIMAX_GROUP_ID = "your-group-id"

Better practice using environment variables:

```python
import os

ANTHROPIC_API_KEY = os.getenv("ANTHROPIC_API_KEY")
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")
MINIMAX_API_KEY = "your-key-here" MINIMAX_GROUP_ID = "your-group-id"

更优实践:使用环境变量

```python
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):
python
undefined
GenericAgent采用4层分层记忆系统(L1-L4):
python
undefined

In your agent configuration

在Agent配置中

memory_config = { "l1_working_memory": True, # Current conversation context "l2_episodic_memory": True, # Recent task history "l3_skill_library": True, # Crystallized skills "l4_session_archive": True # Long-term archives }
undefined
memory_config = { "l1_working_memory": True, # 当前对话上下文 "l2_episodic_memory": True, # 近期任务历史 "l3_skill_library": True, # 已固化的技能 "l4_session_archive": True # 长期存档 }
undefined

Core Architecture

核心架构

Agent Loop (100 lines)

Agent循环(100行代码)

The core agent loop is minimal:
python
from genericagent import GenericAgent
核心Agent循环非常简洁:
python
from genericagent import GenericAgent

Initialize agent

初始化Agent

agent = GenericAgent( model="claude-sonnet-4.6", # or gpt-5.4, gemini-2.0-flash, etc. working_dir="./workspace" )
agent = GenericAgent( model="claude-sonnet-4.6", # 或gpt-5.4, gemini-2.0-flash等 working_dir="./workspace" )

Execute task

执行任务

result = agent.run("Order me a milk tea from the delivery app")
undefined
result = agent.run("在配送APP上帮我点一杯奶茶")
undefined

9 Atomic Tools

9种原子工具

GenericAgent provides 9 atomic tools for system control:
  1. Browser Control - Real browser injection (preserves sessions)
  2. Terminal Execution - Shell command execution
  3. File Operations - Read/write/search filesystem
  4. Screen Vision - Screenshot capture and analysis
  5. Keyboard Input - Direct keyboard control
  6. Mouse Control - Click, drag, move operations
  7. ADB Mobile - Android device control
  8. Python REPL - Interactive Python execution
  9. Memory Operations - Read/write skill library
GenericAgent提供9种用于系统控制的原子工具:
  1. 浏览器控制 - 真实浏览器注入(保留会话)
  2. 终端执行 - Shell命令执行
  3. 文件操作 - 文件系统的读/写/搜索
  4. 屏幕视觉 - 截图捕获与分析
  5. 键盘输入 - 直接键盘控制
  6. 鼠标控制 - 点击、拖拽、移动操作
  7. ADB移动设备控制 - Android设备控制
  8. Python REPL - 交互式Python执行
  9. 记忆操作 - 读写技能库

Usage Patterns

使用模式

Basic Task Execution

基础任务执行

python
from genericagent import GenericAgent
python
from genericagent import GenericAgent

Create agent instance

创建Agent实例

agent = GenericAgent( model="claude-sonnet-4.6", verbose=True )
agent = GenericAgent( model="claude-sonnet-4.6", verbose=True )

Single-turn task

单轮任务

agent.run("Find all PDF files in ~/Documents and move them to ~/PDFs")
agent.run("找到~/Documents下所有PDF文件,并移动到~/PDFs")

Multi-turn conversation

多轮对话

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")
undefined
agent.chat("安装requests库") agent.chat("现在用它获取https://api.github.com/repos/lsdefine/GenericAgent的数据") agent.chat("将star数量保存到stars.txt")
undefined

Skill Crystallization

技能固化

Skills are automatically created when tasks complete:
python
undefined
任务完成时会自动创建技能:
python
undefined

First time: Agent explores and learns

第一次执行:Agent探索并学习

agent.run("Read my WeChat messages")
agent.run("读取我的微信消息")

Agent installs deps, reverses DB schema, writes script, saves skill

Agent安装依赖、解析数据库结构、编写脚本、保存技能

Every subsequent time: Direct skill invocation

后续每次执行:直接调用技能

agent.run("Read my WeChat messages")
agent.run("读取我的微信消息")

Agent loads existing skill, executes instantly

Agent加载已有技能,立即执行

undefined
undefined

Browser Automation

浏览器自动化

python
from genericagent import GenericAgent

agent = GenericAgent(model="claude-sonnet-4.6")
python
from genericagent import GenericAgent

agent = GenericAgent(model="claude-sonnet-4.6")

Browser tasks preserve login sessions

浏览器任务保留登录会话

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(""" 导航到gmail.com,撰写邮件发送给john@example.com 主题为'Q4 Report',并附上文件~/reports/q4.pdf """)

Multi-step web workflows

多步骤网页工作流

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 """)
undefined
agent.run("""
  1. 访问亚马逊
  2. 搜索'wireless keyboard'
  3. 筛选4星以上且价格低于50美元的商品
  4. 对前3个结果截图
  5. 将商品名称和价格保存到products.csv """)
undefined

Desktop Automation

桌面自动化

python
agent = GenericAgent(model="gemini-2.0-flash")
python
agent = GenericAgent(model="gemini-2.0-flash")

Combine vision + mouse/keyboard

结合视觉+鼠标/键盘控制

agent.run(""" Open my expense tracking spreadsheet, find all transactions over $2000 in the last 3 months, and create a summary chart """)
agent.run(""" 打开我的费用跟踪表格, 找出过去3个月中所有超过2000美元的交易, 并创建一个汇总图表 """)

System-level automation

系统级自动化

agent.run(""" Set up a cron job that runs every day at 9 AM to backup ~/Documents to ~/Backups """)
undefined
agent.run(""" 设置一个每天上午9点运行的cron任务, 将~/Documents备份到~/Backups """)
undefined

Mobile Device Control (ADB)

移动设备控制(ADB)

python
agent = GenericAgent(model="claude-sonnet-4.6")
python
agent = GenericAgent(model="claude-sonnet-4.6")

Android automation via ADB

通过ADB实现Android自动化

agent.run(""" Open Alipay on my phone, navigate to transaction history, find expenses over ¥2000 in last 3 months, take screenshots """)
undefined
agent.run(""" 打开我手机上的支付宝, 导航到交易记录, 找出过去3个月中超过2000元的支出, 并截图 """)
undefined

Quantitative Analysis Example

量化分析示例

python
agent = GenericAgent(model="claude-opus-4.6")
python
agent = GenericAgent(model="claude-opus-4.6")

First run: Agent installs mootdx, builds screening logic

第一次运行:Agent安装mootdx,构建筛选逻辑

agent.run(""" Find GEM stocks with:
  • EXPMA golden cross
  • Turnover > 5%
  • Save results to stocks.csv """)
agent.run(""" 找出符合以下条件的创业板股票:
  • EXPMA金叉
  • 换手率>5%
  • 将结果保存到stocks.csv """)

Skill is crystallized, future runs are instant

技能已固化,后续运行可立即执行

The screening logic is now in your personal skill tree

筛选逻辑已存入你的个人技能树

undefined
undefined

Frontends

前端界面

Desktop GUI

桌面GUI

bash
undefined
bash
undefined

Launch desktop app (after one-line install)

启动桌面应用(一键安装后)

frontends/GenericAgent.exe
frontends/GenericAgent.exe

Or for developers

开发者方式启动

python launch.pyw
undefined
python launch.pyw
undefined

Terminal UI (TUI v2)

终端UI(TUI v2)

bash
undefined
bash
undefined

Textual-based interface with streaming support

基于Textual的界面,支持流式输出

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
python frontends/tuiapp_v2.py

**TUI命令:**
- `Ctrl+N` - 新建会话
- `Ctrl+S` - 保存当前会话
- `Ctrl+L` - 加载会话
- `/llm <model>` - 切换LLM模型
- `/export` - 导出对话
- `/continue` - 恢复之前的会话

Streamlit Web UI

Streamlit Web UI

bash
python launch.pyw
bash
python launch.pyw

IM Bot Frontends

即时通讯机器人前端

bash
undefined
bash
undefined

Telegram bot

Telegram机器人

python frontends/tgapp.py
python frontends/tgapp.py

WeChat bot

微信机器人

python frontends/wechatapp.py
python frontends/wechatapp.py

QQ bot

QQ机器人

python frontends/qqapp.py
python frontends/qqapp.py

Feishu/Lark bot

飞书机器人

python frontends/fsapp.py
python frontends/fsapp.py

WeCom bot

企业微信机器人

python frontends/wecomapp.py
python frontends/wecomapp.py

DingTalk bot

钉钉机器人

python frontends/dingtalkapp.py

**Bot Commands:**
- `/new` - Start fresh conversation
- `/continue` - List recoverable snapshots
- `/continue N` - Restore snapshot N
python frontends/dingtalkapp.py

**机器人命令:**
- `/new` - 开始新对话
- `/continue` - 列出可恢复的快照
- `/continue N` - 恢复第N个快照

Advanced Features

高级功能

Conductor Sub-Agent Orchestration

指挥者子Agent编排

python
from genericagent import GenericAgent, Conductor
python
from genericagent import GenericAgent, Conductor

Main agent spawns sub-agents for parallel tasks

主Agent生成子Agent执行并行任务

main_agent = GenericAgent(model="claude-sonnet-4.6")
main_agent = GenericAgent(model="claude-sonnet-4.6")

Conductor manages sub-agent lifecycle

Conductor管理子Agent生命周期

conductor = Conductor(main_agent)
conductor = Conductor(main_agent)

Parallel task execution

并行任务执行

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")
conductor.spawn_agent("research", "调研AI Agent领域的竞争对手") conductor.spawn_agent("analysis", "分析我们上个月的用户反馈") conductor.spawn_agent("report", "基于调研和分析起草Q1路线图")

Auto-cleanup and result aggregation

自动清理并汇总结果

results = conductor.wait_all()
undefined
results = conductor.wait_all()
undefined

Custom Skill Creation

自定义技能创建

python
undefined
python
undefined

Skills are stored in memory/L3_skills/

技能存储在memory/L3_skills/目录下

Create custom skill manually:

手动创建自定义技能:

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
"""
skill_code = """ def check_stock_alerts(): '''监控股票并发送警报''' import mootdx from mootdx.quotes import Quotes
client = Quotes.factory(market='std')
# 自定义筛选逻辑
symbols = client.stocks(market='cyb')

for stock in symbols:
    # 检查条件
    if meets_criteria(stock):
        send_alert(stock)

return results
"""

Save to skill library

保存到技能库

agent.save_skill("stock_monitoring", skill_code)
agent.save_skill("stock_monitoring", skill_code)

Invoke skill

调用技能

agent.run("Run my stock monitoring skill")
undefined
agent.run("运行我的股票监控技能")
undefined

Session Management

会话管理

python
undefined
python
undefined

Save current session

保存当前会话

agent.save_session("project_setup")
agent.save_session("project_setup")

List available sessions

列出可用会话

sessions = agent.list_sessions()
sessions = agent.list_sessions()

Load previous session

加载之前的会话

agent.load_session("project_setup")
agent.load_session("project_setup")

Continue from L4 archive

从L4存档恢复

agent.continue_from_archive(session_id=3)
undefined
agent.continue_from_archive(session_id=3)
undefined

Scheduler Integration

调度器集成

python
from genericagent import GenericAgent
import schedule

agent = GenericAgent(model="claude-sonnet-4.6")
python
from genericagent import GenericAgent
import schedule

agent = GenericAgent(model="claude-sonnet-4.6")

Define recurring task

定义周期性任务

def daily_report(): agent.run("Generate daily sales report and email to team@company.com")
def daily_report(): agent.run("生成每日销售报告并发送邮件给team@company.com")

Schedule with cron-like syntax

使用类cron语法设置调度

schedule.every().day.at("09:00").do(daily_report)
schedule.every().day.at("09:00").do(daily_report)

Or let agent set it up

或者让Agent自动设置

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 """)
undefined
agent.run(""" 设置一个每天上午9点运行的定时任务, 生成销售报告并发送给团队 """)
undefined

Side Questions with /btw

使用/btw询问附加问题

python
undefined
python
undefined

During complex task, ask side questions without losing context

在复杂任务执行过程中,询问附加问题而不丢失上下文

agent.chat("Deploy the new feature to production")
agent.chat("将新功能部署到生产环境")

Mid-task: check something

任务中途:检查其他内容

agent.chat("/btw what's the current server load?")
agent.chat("/btw 当前服务器负载是多少?")

Returns to main task automatically

自动返回主任务继续执行

undefined
undefined

Real-World Examples

实际应用示例

Autonomous Web Data Collection

自主网页数据采集

python
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.
""")
python
agent = GenericAgent(model="claude-sonnet-4.6")

agent.run("""
访问techcrunch.com,浏览最新的AI相关文章,
总结前5篇报道,并将摘要保存到ai_news.md。
每小时检查一次并更新文件。
""")

Expense Tracking with Mobile App

移动应用费用跟踪

python
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
""")
python
agent.run("""
通过ADB连接我的Android手机,
打开支付宝,导航到账单详情,
提取上个季度的所有交易记录,
按类型(餐饮、交通、购物)分类,
创建饼图可视化,
将报告保存为Q1_expenses.pdf
""")

Bulk Messaging

批量消息发送

python
agent.run("""
Read contacts from team_contacts.csv,
send a WeChat message to each person:
'Reminder: Team meeting tomorrow at 2 PM'
""")
python
agent.run("""
从team_contacts.csv读取联系人,
给每个人发送微信消息:
'提醒:明天下午2点召开团队会议'
""")

Custom Automation Workflow

自定义自动化工作流

python
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
""")
python
agent.run("""
1. 监控我的Gmail,查找主题包含'URGENT'的邮件
2. 找到后提取关键点
3. 在我的todo.txt文件中创建任务
4. 给我发送桌面通知
5. 每15分钟检查一次
""")

Troubleshooting

故障排除

Python Version Issues

Python版本问题

Problem: Installation fails with dependency conflicts
Solution: Ensure Python 3.11 or 3.12:
bash
python --version  # Should show 3.11.x or 3.12.x
问题: 安装时出现依赖冲突
解决方案: 确保使用Python 3.11或3.12:
bash
python --version  # 应显示3.11.x或3.12.x

If wrong version, install correct Python and recreate venv

如果版本错误,安装正确的Python版本并重新创建虚拟环境

undefined
undefined

TUI Rendering Issues on Windows

Windows下TUI渲染问题

Problem: TUI displays broken characters or doesn't respond to input
Solution:
bash
undefined
问题: TUI显示乱码或不响应输入
解决方案:
bash
undefined

Update textual

更新textual

pip install -U textual
pip install -U textual

Use Git Bash instead of PowerShell/cmd

使用Git Bash替代PowerShell/cmd

Or ask GenericAgent to fix it:

或者让GenericAgent自动修复:

python frontends/tuiapp_v2.py
python frontends/tuiapp_v2.py

In chat: "Fix TUI rendering issues for Windows terminal"

在对话中输入:"修复Windows终端下的TUI渲染问题"

undefined
undefined

Browser Automation Not Working

浏览器自动化无法工作

Problem: Browser control fails or doesn't preserve sessions
Solution:
python
undefined
问题: 浏览器控制失败或无法保留会话
解决方案:
python
undefined

Check if browser driver is installed

检查浏览器驱动是否已安装

agent.run("Install Chrome WebDriver for browser automation")
agent.run("安装Chrome WebDriver用于浏览器自动化")

Verify browser path

验证浏览器路径

agent.run("Check if Chrome is installed and accessible")
agent.run("检查Chrome是否已安装且可访问")

For Firefox users

Firefox用户

agent.run("Configure Firefox profile for persistent sessions")
undefined
agent.run("配置Firefox配置文件以保留会话")
undefined

Skill Not Crystallizing

技能未固化

Problem: Task completes but no skill is saved
Solution:
python
undefined
问题: 任务完成但未保存技能
解决方案:
python
undefined

Manually save skill after successful execution

任务成功执行后手动保存技能

agent.run("Save the last task execution as a skill named 'email_reports'")
agent.run("将上次任务执行保存为名为'email_reports'的技能")

Check skill library

检查技能库

agent.run("List all available skills in my library")
agent.run("列出我的技能库中所有可用技能")

Verify L3 memory is enabled

验证L3记忆是否启用

agent.config['l3_skill_library'] = True
undefined
agent.config['l3_skill_library'] = True
undefined

Memory Context Issues

记忆上下文问题

Problem: Agent forgets previous context or hallucinates
Solution:
python
undefined
问题: Agent忘记之前的上下文或产生幻觉
解决方案:
python
undefined

Check active memory layers

检查激活的记忆层

agent.run("Show current memory configuration")
agent.run("显示当前记忆配置")

Clear and rebuild memory

清理并重建记忆

agent.clear_l1_memory() # Working memory agent.rebuild_l2_memory() # Episodic memory
agent.clear_l1_memory() # 工作记忆 agent.rebuild_l2_memory() # 情景记忆

Reduce context by archiving old sessions

通过存档旧会话减少上下文

agent.archive_session()
undefined
agent.archive_session()
undefined

ADB Device Not Found

ADB设备未找到

Problem: Mobile automation fails with "device not found"
Solution:
bash
undefined
问题: 移动设备自动化提示"device not found"
解决方案:
bash
undefined

Check ADB connection

检查ADB连接

adb devices
adb devices

Enable USB debugging on Android device

在Android设备上启用USB调试

Connect device and authorize computer

连接设备并授权计算机

Let agent diagnose

让Agent诊断问题

agent.run("Troubleshoot ADB connection to my Android device")
undefined
agent.run("排查我的Android设备的ADB连接问题")
undefined

High Token Usage

Token消耗过高

Problem: Consuming too many tokens per task
Solution:
python
undefined
问题: 每个任务消耗过多Token
解决方案:
python
undefined

GenericAgent is designed for efficiency, but check:

GenericAgent专为效率设计,但可以按以下方式优化:

1. Ensure skills are being reused

1. 确保技能被复用

agent.run("List my most frequently used skills")
agent.run("列出我最常用的技能")

2. Archive old sessions to L4

2. 将旧会话存档到L4

agent.run("Archive conversations older than 1 week")
agent.run("存档超过1周的对话")

3. Use lighter model for simple tasks

3. 简单任务使用轻量模型

agent = GenericAgent(model="gemini-2.0-flash") # vs claude-opus-4.6
agent = GenericAgent(model="gemini-2.0-flash") # 对比claude-opus-4.6

4. Check if unnecessary tools are being called

4. 检查是否调用了不必要的工具

agent.config['verbose'] = True # Log tool calls
undefined
agent.config['verbose'] = True # 记录工具调用
undefined

Best Practices

最佳实践

  1. Let Skills Grow Organically: Don't pre-install everything. Let GenericAgent install dependencies as needed and crystallize skills.
  2. Use Appropriate Models: Use lighter models (Gemini Flash) for simple tasks, heavier (Claude Opus) for complex reasoning.
  3. Leverage Memory Layers: Regularly archive old sessions to L4 to keep L1/L2 context clean.
  4. Session Management: Save important sessions with descriptive names for easy recovery.
  5. Environment Variables: Always use env vars for API keys, never hardcode.
  6. Incremental Complexity: Start with simple tasks, build to complex workflows as skills accumulate.
  7. Monitor Token Usage: Track token consumption to optimize model selection and skill reuse.
  1. 让技能自然成长: 不要预先安装所有内容。让GenericAgent根据需要安装依赖并固化技能。
  2. 使用合适的模型: 简单任务使用轻量模型(Gemini Flash),复杂推理使用重型模型(Claude Opus)。
  3. 利用记忆层: 定期将旧会话存档到L4,保持L1/L2上下文整洁。
  4. 会话管理: 使用描述性名称保存重要会话,方便后续恢复。
  5. 环境变量: 始终使用环境变量存储API密钥,切勿硬编码。
  6. 逐步增加复杂度: 从简单任务开始,随着技能积累再构建复杂工作流。
  7. 监控Token消耗: 跟踪Token使用情况,优化模型选择和技能复用。

Resources

资源