Metadata-Version: 2.4
Name: exobrain
Version: 0.0.3
Summary: A personal AI assistant with agent capabilities, knowledge retrieval, and file system access
Project-URL: Homepage, https://github.com/visualDust/exobrain
Project-URL: Repository, https://github.com/visualDust/exobrain
Author-email: VisualDust <gavin@gong.host>
License-Expression: MIT
License-File: LICENSE
Keywords: agent,ai,assistant,cli,knowledge-base
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: <4,>=3.10
Requires-Dist: aiofiles<24,>=23.2.1
Requires-Dist: beautifulsoup4<5,>=4.12.0
Requires-Dist: click<9,>=8.1.7
Requires-Dist: httpx<0.27,>=0.26.0
Requires-Dist: lxml<6,>=5.0.0
Requires-Dist: pydantic-settings<3,>=2.1.0
Requires-Dist: pydantic<3,>=2.5.0
Requires-Dist: python-dotenv<2,>=1.0.0
Requires-Dist: pyyaml<7,>=6.0.1
Requires-Dist: rich<14,>=13.7.0
Provides-Extra: all
Requires-Dist: anthropic<0.9,>=0.8.0; extra == 'all'
Requires-Dist: openai<2,>=1.7.0; extra == 'all'
Provides-Extra: anthropic
Requires-Dist: anthropic<0.9,>=0.8.0; extra == 'anthropic'
Provides-Extra: openai
Requires-Dist: openai<2,>=1.7.0; extra == 'openai'
Description-Content-Type: text/markdown

# ExoBrain

![PyPI - Version](https://img.shields.io/pypi/v/exobrain)


一个具备 Agent 能力的个人 AI 助理，支持知识检索、文件系统访问和高度可配置的扩展性。

## 特性

- 🤖 **多模型支持**: 支持本地开源模型和云端 API (OpenAI, Anthropic 等)
- 🎯 **Agent Skills**: 集成 Anthropic Skills，包括文档处理 (PDF/Word/Excel/PPT)、MCP 开发、前端设计等
- 🌐 **联网搜索**: 内置 Web 搜索和网页获取工具，实时获取最新信息
- 📚 **知识库**: 基于向量数据库的语义搜索和检索增强生成 (RAG)
- 🛠️ **工具系统**: 丰富的内置工具和自定义工具支持
- 🔌 **MCP 支持**: 支持 Model Context Protocol 集成
- 📁 **文件系统访问**: 安全的文件读写能力（需授权）
- 🎨 **渐进式暴露**: 根据上下文智能暴露工具
- 💻 **本地 CLI**: 友好的命令行界面
- 🔒 **隐私优先**: 本地数据存储和可选的本地模型推理

## 快速开始

### 安装

使用 pip 安装 ExoBrain:

```bash
pip install exobrain
```

从源码安装（开发模式）:

```bash
# 克隆仓库
git clone https://github.com/visualdust/exobrain.git
cd exobrain

# 初始化 Skills submodule
git submodule update --init --recursive

# 安装
pip install -e .
```

### 基础使用

```bash
# 启动交互式对话
exobrain chat

# 单次问答
exobrain ask "今天天气怎么样？"

# 搜索知识库
exobrain knowledge search "Python 装饰器"

# 添加文档到知识库
exobrain knowledge add ~/Documents/notes/
```

### 选择模型

```bash
# 使用默认模型（config.yaml 中配置）
exobrain --config config.yaml ask "你好"

# 使用特定模型
exobrain --config config.yaml ask --model openai/gpt-4o "解释量子计算"
exobrain --config config.yaml chat --model gemini/gemini-pro

# 查看所有可用模型
exobrain --config config.yaml models list
```

### 联网搜索

```bash
# 启用联网搜索（在 config.yaml 中）
tools:
  web_access: true

permissions:
  web_access:
    enabled: true

# 使用示例
exobrain --config config.yaml ask "搜索最新的 AI 新闻"
exobrain --config config.yaml ask "获取 Python 官网的内容"

# Agent 会自动使用 web_search 和 web_fetch 工具
```

### Skills 管理

```bash
# 列出所有可用的 Skills
exobrain --config config.yaml skills list

# 搜索特定 Skills
exobrain --config config.yaml skills list --search "pdf"

# 查看 Skill 详情
exobrain --config config.yaml skills show mcp-builder

# Skills 会在对话中自动激活
exobrain --config config.yaml chat
You: 帮我创建一个 PDF 报告
# Agent 会自动使用 pdf skill
```

### 配置

首次运行时会在 `~/.exobrain/` 创建配置文件。编辑 `config.yaml` 配置你的模型和工具:

```yaml
models:
  default: openai/gpt-4-turbo

  providers:
    openai:
      api_key: ${OPENAI_API_KEY}
      models:
        - gpt-4-turbo
        - gpt-3.5-turbo

permissions:
  file_system:
    enabled: true
    allowed_paths:
      - ~/Documents/notes
      - ~/Documents/knowledge
```

## 文档

- [架构设计](docs/ARCHITECTURE.md) - 系统架构和设计原则
- [技术规范](docs/SPECIFICATIONS.md) - 详细的技术规范和 API
- [Skills 集成指南](docs/SKILLS_INTEGRATION.md) - Anthropic Skills 使用和开发指南
- [Skills 开发](exobrain/skills/README.md) - 创建自定义 Skills
- [Knowledge Base](exobrain/knowledge/README.md) - 知识库系统说明
- [MCP 集成](exobrain/mcp/README.md) - MCP 服务器集成指南
- [用户指南](docs/USER_GUIDE.md) - 详细使用说明（待完成）
- [开发者指南](docs/DEVELOPER_GUIDE.md) - 开发和贡献指南（待完成）

## 开发

### 设置开发环境

```bash
# 克隆仓库
git clone https://github.com/visualdust/exobrain.git
cd exobrain

# 安装依赖（包括开发依赖）
poetry install --with dev,docs

# 安装 pre-commit hooks
pre-commit install

# 运行测试
pytest

# 代码格式化
black .
ruff check --fix .

# 类型检查
mypy exobrain
```

### 项目结构

```
exobrain/
├── exobrain/              # 主要源码
│   ├── agent/            # Agent 核心
│   ├── models/           # 模型提供者
│   ├── tools/            # 工具系统
│   ├── knowledge/        # 知识库
│   ├── skills/           # Skills 系统
│   ├── mcp/              # MCP 集成
│   ├── cli/              # CLI 界面
│   └── utils/            # 工具函数
├── tests/                # 测试
├── docs/                 # 文档
├── examples/             # 示例
└── templates/            # 模板（Skills, MCP 等）
```

## 贡献

欢迎贡献！请查看 [CONTRIBUTING.md](CONTRIBUTING.md) 了解详情。

## 许可证

MIT License - 查看 [LICENSE](LICENSE) 文件了解详情。

## 致谢

本项目受到以下项目的启发：
- [LangChain](https://github.com/langchain-ai/langchain)
- [AutoGPT](https://github.com/Significant-Gravitas/AutoGPT)
- [Model Context Protocol](https://modelcontextprotocol.io/)

## 路线图

- [x] 基础架构设计
- [ ] 核心 Agent 实现
- [ ] 多模型支持
- [ ] 工具系统
- [ ] 知识库和 RAG
- [ ] Skills 系统
- [ ] MCP 集成
- [ ] CLI 界面
- [ ] 文档和示例
- [ ] 测试覆盖
- [ ] v0.1.0 发布

## 联系

- GitHub Issues: [提交问题](https://github.com/visualdust/exobrain/issues)
- Discussions: [参与讨论](https://github.com/visualdust/exobrain/discussions)