Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

leaper-agent-cn

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaper-agent-cn

瞬知自学习智能体 — 纯国内 AI Agent 框架

latest
npmnpm
Version
0.7.2
Version published
Maintainers
1
Created
Source

🧠 瞬知自学习智能体 (Leaper Agent CN)

纯国内、零依赖、自进化的 AI Agent 框架

✨ 特性

  • 🇨🇳 纯国内闭环 — 支持 DeepSeek / 通义千问 / 智谱GLM / Moonshot / 百度文心
  • 🔌 四大渠道 — 飞书 / 钉钉 / 企业微信 / 微信公众号
  • 🧠 六层自进化记忆 — 从短期记忆到长期知识的自动进化
  • 🛠️ 28+ 内置工具 — 终端/文件/代码/搜索/记忆/图片/文档...
  • 🔄 Tool Calling 循环 — 完整的多轮工具调用 Agent Loop
  • 🎭 Mixture of Agents — 多模型并行生成,择优输出
  • 📸 视觉理解 — 通义千问 VL 图片分析 + OCR
  • 🔒 安全优先 — 隐私脱敏 / 危险命令拦截 / 操作审批
  • 📦 零外部依赖 — 纯 Node.js 原生模块,开箱即用
  • TypeScript — 完整类型系统,编译后 JS 发布

🚀 快速开始

安装

npm install leaper-agent-cn

配置

创建 leaper.yaml

model: deepseek-chat

providers:
  deepseek:
    apiKey: sk-xxx

gateway:
  feishu:
    appId: cli_xxx
    appSecret: xxx

或使用初始化向导:

npx leaper-cn init

启动

npx leaper-cn start

📊 架构

┌─────────────────────────────────────────────────┐
│                   用户消息                        │
└────────────────────┬────────────────────────────┘
                     ▼
┌─────────────────────────────────────────────────┐
│          渠道层 (Gateway)                        │
│   飞书 │ 钉钉 │ 企业微信 │ 微信公众号            │
└────────────────────┬────────────────────────────┘
                     ▼
┌─────────────────────────────────────────────────┐
│              Agent Loop                          │
│   消息 → LLM → Tool Call → LLM → ... → 响应     │
│                                                  │
│   ┌──────────┐    ┌──────────────┐              │
│   │ 安全层    │    │ MoA 择优     │              │
│   │ 脱敏/审批 │    │ 多模型并行   │              │
│   └──────────┘    └──────────────┘              │
└──────┬──────────────────┬───────────────────────┘
       ▼                  ▼
┌─────────────┐   ┌─────────────────┐
│  LLM 提供商  │   │   工具集 (28+)   │
│  DeepSeek   │   │  终端/文件/代码   │
│  通义千问    │   │  搜索/记忆/图片   │
│  智谱GLM    │   │  飞书/视觉/补丁   │
│  Moonshot   │   └────────┬────────┘
└─────────────┘            ▼
                   ┌─────────────────┐
                   │  LeaperBrain    │
                   │  六层自进化记忆   │
                   │  BM25 + 时间衰减 │
                   └─────────────────┘

🛠️ 工具列表

工具描述
web_search多引擎搜索(Bing/百度/DuckDuckGo)
web_fetch抓取网页提取纯文本
read_file读取文件内容
write_file写入文件
list_files列出目录文件
search_files正则搜索文件内容
create_dir创建目录
delete_file删除文件
move_file移动/重命名文件
code_execute执行代码片段
terminal_exec执行终端命令
terminal_bg后台执行命令
process_list查看进程列表
process_kill终止进程
memory_search搜索记忆库
memory_store存储新知识
memory_recall回忆特定主题
memory_forget遗忘错误信息
memory_stats记忆统计
memory_evolve触发记忆进化
create_diff生成 diff 补丁
apply_patch应用补丁
feishu_doc创建飞书文档
feishu_upload上传文件到飞书
generate_imageAI 生图
analyze_image图片分析(视觉)
ocr_image图片文字识别
delegate_task委派子任务

🧠 记忆系统

六层自进化架构:

层级名称生命周期说明
L0对话上下文会话内当前对话历史
L1短期记忆小时级最近交互摘要
L2工作记忆天级跨会话知识
L3长期记忆周级稳定知识点
L4核心知识月级高置信事实
L5元认知永久推理模式和策略

特性:

  • 4-Gate 质量过滤(相关性/新颖性/置信度/一致性)
  • BM25 召回 + 时间衰减 + MMR 去重
  • 自动进化:高频访问提升,长期未用衰减

🔒 安全机制

  • 隐私脱敏: 手机号/身份证/银行卡/API Key 自动识别并脱敏
  • 危险命令拦截: rm -rf /format C:、Fork bomb 等
  • 操作审批: 高危操作需人工确认
  • 凭证池: API Key 轮转,耗尽自动切换

🔧 开发

# 编译
npm run build

# 测试
npx tsx tests/test-core.ts

# 开发模式
npm run dev

# 类型检查
npx tsc --noEmit

📁 项目结构

src/
├── agent/          # Agent 核心(循环、安全、调度)
├── brain/          # LeaperBrain 记忆引擎
├── providers/      # LLM 提供商适配器
├── gateway/        # 渠道接入(飞书等)
├── tools/          # 28+ 工具实现
├── cron/           # 定时任务
└── cli.ts          # CLI 入口

📄 License

Apache-2.0

Keywords

ai-agent

FAQs

Package last updated on 05 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts