Skip to content

Dr-Corgi/OpenPaw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenPaw Logo

OpenPaw

🤖 开源的 AI Agent 开发框架

功能特性快速开始架构设计使用指南贡献指南

License Release Python Version GitHub stars


📖 项目简介

OpenPaw (Open Python-based Agent for Windows) 是一个面向Windows环境的 AI Agent 框架。本项目基于 GLM-5 大语言模型驱动,采用 Vibe Coding 理念打造 —— 让 AI 理解开发者的意图与氛围,实现更自然、更智能的Human-Agent协作体验。

灵感来源于 Claude Code、OpenClaw 等现代 AI Agent 工具,OpenPaw 提供了:

  • 🧠 智能对话循环 - 自动处理多轮对话与工具调用
  • 🛠️ 丰富的工具生态 - 内置文件操作、代码执行、网络搜索等工具
  • 🔌 多渠道接入 - 支持 CLI、QQ机器人等多种交互方式
  • 🎭 人格系统 - 灵活配置 Agent 的身份、性格和行为准则
  • 🔐 安全可控 - 完善的权限管理和操作确认机制

✨ 功能特性

🔧 内置工具

工具 描述
file_read 读取文件内容
file_edit 编辑文件(搜索替换)
bash 执行 Shell 命令
glob 文件模式匹配搜索
grep 文件内容搜索
web_search 网络搜索
web_fetch 获取网页内容
todo_read 读取任务列表
todo_write 管理任务列表
load_skill 动态加载技能

🎯 核心能力

  • 多模型支持 - 兼容 OpenAI、Anthropic 等 LLM 提供商
  • 流式响应 - 实时输出,提升用户体验
  • 上下文压缩 - 智能压缩对话历史,优化 Token 使用
  • 技能系统 - 兼容适配 OpenClaw Skills 生态,两层懒加载机制,按需加载专业知识
  • 会话管理 - 持久化存储,支持多会话并发
  • Web 管理面板 - 可视化配置和监控

🚀 快速开始

环境要求

  • Python 3.11+
  • Windows

安装

# 克隆仓库
git clone https://github.com/Dr-Corgi/OpenPaw.git
cd openpaw

# 创建虚拟环境
python -m venv venv
source venv/bin/activate  # Linux/macOS
# venv\Scripts\activate  # Windows

# 安装依赖
pip install -e .

初始化配置

# 初始化 OpenPaw
openpaw init

# 配置 API Key
# 编辑配置文件: 
#   Windows: %APPDATA%/OpenPaw/openpaw.json
#   Linux/macOS: ~/.config/OpenPaw/openpaw.json

配置文件示例:

{
  "llm": {
    "default_model": "gpt-4o-mini",
    "models": [
      {
        "model_id": "gpt-4o-mini",
        "provider": "openai",
        "api_key": "your-api-key-here",
        "base_url": "https://api.openai.com/v1"
      }
    ]
  }
}

启动 CLI 聊天

openpaw chat

启动服务

# 一键启动(同时启动 API 服务和管理面板)
openpaw start

启动后可访问:

也可以单独启动各服务:

# 仅启动 API 服务
openpaw serve

# 仅启动管理面板
openpaw panel

🏗️ 架构设计

┌─────────────────────────────────────────────────────────────┐
│                      Gateway Server                          │
│  ┌─────────┐  ┌─────────┐  ┌─────────┐  ┌─────────┐        │
│  │   CLI   │  │ QQ Bot  │  │ Feishu  │  │   Web   │        │
│  │ Adapter │  │ Adapter │  │ Adapter │  │ Adapter │        │
│  └────┬────┘  └────┬────┘  └────┬────┘  └────┬────┘        │
│       │            │            │            │              │
│       └────────────┴─────┬──────┴────────────┘              │
│                          ▼                                   │
│                  ┌───────────────┐                          │
│                  │ Message Router │                          │
│                  └───────┬───────┘                          │
│                          ▼                                   │
│  ┌───────────────────────────────────────────────────────┐  │
│  │                    Agent Layer                         │  │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐   │  │
│  │  │ Agent Loop  │  │  Executor   │  │  Context    │   │  │
│  │  └──────┬──────┘  └──────┬──────┘  └──────┬──────┘   │  │
│  │         │                │                │           │  │
│  │         └────────────────┼────────────────┘           │  │
│  │                          ▼                             │  │
│  │                 ┌───────────────┐                     │  │
│  │                 │   LLM Client  │                     │  │
│  │                 └───────┬───────┘                     │  │
│  │                         │                              │  │
│  │  ┌──────────────────────┼──────────────────────┐     │  │
│  │  │                     Tools                    │     │  │
│  │  │  ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐  │     │  │
│  │  │  │File │ │Bash │ │Web  │ │Todo  │ │Skill│  │     │  │
│  │  │  │ I/O │ │Exec │ │Fetch│ │Manage│ │Load │  │     │  │
│  │  │  └─────┘ └─────┘ └─────┘ └─────┘ └─────┘  │     │  │
│  │  └────────────────────────────────────────────┘     │  │
│  └───────────────────────────────────────────────────────┘  │
│                                                              │
│  ┌───────────────────────────────────────────────────────┐  │
│  │                   Storage Layer                        │  │
│  │  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │  │
│  │  │ Database │ │ Message  │ │ Session  │ │  Record  │ │  │
│  │  │ (SQLite) │ │  Store   │ │  Store   │ │  Store   │ │  │
│  │  └──────────┘ └──────────┘ └──────────┘ └──────────┘ │  │
│  └───────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────┘

核心组件

组件 说明
Gateway 网关服务,负责消息路由和渠道适配
Agent 智能代理核心,处理对话循环和工具调用
LLM Client 大语言模型客户端,支持多提供商
Tools 工具集,扩展 Agent 的执行能力
Skills 技能系统,提供领域专业知识
Storage 存储层,持久化会话和消息

🔒 安全机制

OpenPaw 内置多层安全防护:

  • 操作确认 - 敏感操作需要用户确认
  • 路径控制 - 限制文件访问范围
  • 命令过滤 - 黑白名单控制可执行命令
  • 审计日志 - 记录所有操作行为

📁 项目结构

openpaw/
├── agent/           # Agent 核心实现
│   ├── base.py      # Agent 基类
│   ├── loop.py      # 对话循环
│   ├── executor.py  # 工具执行器
│   └── persona.py   # 人格管理
├── llm/             # LLM 客户端
│   ├── client.py    # 抽象客户端
│   ├── openai_client.py
│   └── anthropic_client.py
├── tools/           # 内置工具
├── skill/           # 技能系统
├── gateway/         # 网关服务
│   ├── adapter/     # 渠道适配器
│   └── server.py    # 网关服务器
├── storage/         # 存储层
├── security/        # 安全模块
├── context/         # 上下文管理
├── panel/           # Web 管理面板
└── cli/             # 命令行接口

🤝 贡献指南

我们欢迎所有形式的贡献!

如何贡献

  1. Fork 本仓库
  2. 创建特性分支 (git checkout -b feature/amazing-feature)
  3. 提交更改 (git commit -m 'Add some amazing feature')
  4. 推送到分支 (git push origin feature/amazing-feature)
  5. 创建 Pull Request

📄 许可证

本项目采用 MIT License 开源协议。


Made with ❤️ by Paw-Tech Team

About

OpenPaw 是一个纯 Python 实现的类 OpenClaw 开源 AI Agent 框架。它专注 Windows 桌面环境,集成工具调用、兼容OpenClaw Skills,支持多平台连接,打造智能的人机协作体验。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages