Skip to main content

🚀 Ridex — AI 智能助手系统

Ridex 是一个基于 Python 构建的全功能 AI 智能助手系统,拥有丰富的 TUI(终端用户界面)和强大的多代理协作架构。


✨ 项目概述

Ridex 不仅仅是一个 CLI 工具,它是一套完整的 AI 代理生态体系。通过与 DeepSeek API 深度集成,Ridex 能够:

  • 🤖 作为智能助手与用户进行自然对话
  • 🧩 动态创建和管理工具,扩展自身能力
  • 🔄 创建子代理来并行处理复杂任务
  • 📋 制定任务计划,有序执行多步骤流程
  • 🧠 积累和学习经验,持续优化服务质量
  • 🖥️ 执行终端命令,与环境交互

🏗️ 项目架构

Ridex/
├── 📁 configs/                    # 配置文件目录
│   ├── ridex.conf                 # 主配置文件(AI模型、日志、CLI等)
│   ├── tools.json                 # 工具注册表
│   └── experience_store.json      # 经验知识库
│
├── 📁 src/                        # 核心源代码
│   ├── 📁 cli/                    # 🖥️ TUI 终端界面层
│   │   ├── cli.py                 # CLI 主入口(987行)
│   │   ├── cursor.py              # 光标管理
│   │   ├── 📁 areas/              # 界面区域模块
│   │   │   ├── animation.py       # 🎬 动画系统(33KB)
│   │   │   ├── content.py         # 内容展示区
│   │   │   ├── messages.py        # 消息渲染区
│   │   │   ├── input_line.py      # 输入行区
│   │   │   ├── completion.py      # 自动补全区
│   │   │   ├── sub_agent_status.py# 子代理状态面板
│   │   │   └── border_renderer.py # 边框渲染器
│   │   └── 📁 utils/              # CLI 工具
│   │
│   ├── 📁 aitoolbox/              # 🧠 AI 核心工具箱
│   │   ├── builtin_tools.py       # 内置工具定义(40KB)
│   │   ├── config.py              # 系统配置与提示词
│   │   ├── 📁 core/               # 核心引擎
│   │   │   ├── 📁 agents/         # 🤖 代理系统
│   │   │   │   ├── master_agent.py # 主代理(协调器)
│   │   │   │   └── sub_agent.py    # 子代理(任务执行器)
│   │   │   ├── 📁 base/           # 基础组件
│   │   │   │   ├── base_agent.py  # 代理基类
│   │   │   │   ├── enums.py       # 枚举定义
│   │   │   │   ├── exceptions.py  # 自定义异常
│   │   │   │   ├── tool_decorator.py # 工具装饰器
│   │   │   │   └── tool_result.py # 工具结果封装
│   │   │   ├── 📁 config/         # 运行配置
│   │   │   └── 📁 services/       # 核心服务
│   │   ├── 📁 tools/              # 🛠️ 工具实现
│   │   │   ├── file_ops.py        # 文件操作工具
│   │   │   ├── web_search.py      # 联网搜索工具
│   │   │   └── get_weather.py     # 天气查询工具
│   │   └── 📁 utils/              # 工具箱工具
│   │       ├── experience_manager.py # 经验管理器
│   │       ├── terminal_command_runner.py # 终端命令运行器
│   │       └── sensitive_data_manager.py # 敏感数据管理器
│   │
│   ├── 📁 logger/                 # 日志系统
│   ├── 📁 utils/                  # 通用工具
│   ├── default_configs.py         # 默认配置加载
│   └── __init__.py                # 项目入口
│
├── 📁 tests/                      # 单元测试
│   ├── test_tool_decorator.py     # 工具装饰器测试
│   └── test_tool_result.py        # 工具结果测试
│
├── 📁 .venv/                      # Python 虚拟环境
├── requirements.txt               # 项目依赖
├── Ridex.cmd                      # Windows 启动脚本
├── run.bat                        # 备用启动脚本
├── clean.ps1                      # 缓存清理脚本
└── .gitignore                     # Git 忽略规则

🎯 核心功能

1. 🤖 多代理系统

组件 说明
主代理 (MasterAgent) 协调全局对话、工具调度、子代理管理
子代理 (SubAgent) 独立执行子任务,支持并行处理
任务计划 将复杂任务分解为有序执行计划

2. 🛠️ 动态工具系统

  • 支持运行时动态创建新工具
  • 内置工具:文件操作、联网搜索、天气查询
  • 工具参数自动校验与类型转换
  • 支持同步/异步/流式执行模式

3. 🧠 经验管理系统

  • 自动记录任务执行经验和最佳实践
  • 支持经验检索和分类浏览
  • 持续学习优化服务质量

4. 🖥️ 丰富的 TUI 界面

  • 🎬 实时动画系统:动态更新状态提示
  • 📝 智能输入补全:支持命令历史补全
  • 🔄 子代理状态面板:实时监控子任务进度
  • 🎨 彩色渲染:清晰的视觉分区

⚙️ 技术栈

技术 用途
Python 3.12+ 开发语言
DeepSeek API AI 模型服务
newrcc 终端彩色文本渲染
rich 富文本输出
aiohttp 异步 HTTP 请求
cryptography 数据加密
pytest 单元测试

🚀 快速开始

环境要求

  • Python 3.12+
  • Windows 系统(当前版本)

安装

# 克隆项目
git clone <your-repo-url>
cd Ridex

# 创建虚拟环境
python -m venv .venv

# 安装依赖
pip install -r requirements.txt

配置

编辑 configs/ridex.conf,配置 AI API 密钥:

[AI]
AI_API_KEY=your_api_key_here
BASE_URL=https://api.deepseek.com/v1
AI_MODEL=deepseek-v4-flash

启动

# 方式一:双击 Ridex.cmd
# 方式二:命令行运行
.\run.bat

📂 配置文件说明

文件 说明
configs/ridex.conf 主配置文件:AI模型、日志、CLI界面等
configs/tools.json 动态工具注册文件
configs/experience_store.json 经验知识库(请勿删除!)

🔮 未来规划

  • 支持更多 AI 模型提供商(OpenAI、Claude 等)
  • 插件系统扩展
  • Web 界面支持
  • 多用户/多会话管理
  • 更丰富的内置工具集
  • 跨平台支持(Linux/macOS)

📜 许可证

本项目仅供学习研究使用。


Ridex — 让 AI 成为你的得力助手 🤖✨

Metadata

Release files for ridex 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ridex 1.5.0
File Size Uploaded Provenance Actions
ridex-1.5.0.tar.gz 182.1 kB Without provenance Details for ridex-1.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ridex 1.5.0
File Interpreter ABI Platform Actions
ridex-1.5.0-py3-none-any.whl Python 3 none any Details for ridex-1.5.0-py3-none-any.whl

Total release size: 402.0 kB

Release files / ridex-1.5.0.tar.gz

Download URL ridex-1.5.0.tar.gz
Size 182.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4d11fba475f89ce1a88ae38e9d868b3dac736e0f7b0f1f09cf67a46265832f73
BLAKE2b-256 checksum
How to use checksums
0cee485535b1ef362a925f346778ddadf9c87cffaaa9a17b0ddbd2ff1f3e272a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.4

Release files / ridex-1.5.0-py3-none-any.whl

Download URL ridex-1.5.0-py3-none-any.whl
Size 219.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1a16dc68f80e26dcbf968f34cd3f53cc94cc9b8dbc7b44ab82ad7e674c72594
BLAKE2b-256 checksum
How to use checksums
ebc4071bc71ebec148a1bd51c9110beb84abc4b166f6371be768f6382f3e44b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.4

Security for ridex 1.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page