Files
KiloStar/README.md
T

107 lines
4.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<div align="center">
# KiloStar (千星)
一款基于 Python 的分布式多 Agent 协作系统
[![Python 3.13+](https://img.shields.io/badge/python-3.13+-blue.svg)](https://www.python.org/)
[![Ray](https://img.shields.io/badge/Distributed-Ray-0288d1.svg)](https://docs.ray.io/)
[![Pydantic-AI](https://img.shields.io/badge/Framework-Pydantic--AI-ff69b4.svg)](https://ai.pydantic.dev/)
[![License](https://img.shields.io/badge/license-Apache--2.0-green.svg)](LICENSE)
[**项目架构**](./docs/ARCHITECTURE.md) | [**更新日志**](./changelogs/CHANGELOG.md) | [**未来展望**](./changelogs/ROADMAP.md)
</div>
---
**KiloStar** 是一款基于 **Ray** 构建的下一代分布式多 Agent 协作系统。项目采用“中心监管 + 边缘执行”的异构集群模式,通过大参数 MoE 模型进行高层逻辑推理,并协同微调后的轻量化模型高效完成具体任务。借助 **Pydantic-AI** 提供的强类型约束与 FastAPI 异步网关,kilostar 实现了任务从需求拆解、资源调度到自动化执行的全链路闭环,为个人提供可靠的人工智能助手服务。
---
## ✨ 核心特性
### 🧠 异构协作体系
- **多智能体集群**:内置监控 (Regulatory)、意识 (Consciousness)、控制 (Control) 、 生长(Growth)核心节点,实现比单 Agent 系统更严谨的决策链。
- **Worker 动态派生**:根据任务需求动态拉起 Ordinary 或 Skill 类型的 Worker Individual,实现资源的按需分配。
### 🚀 分布式性能保障
- **Ray 驱动**:底层基于 Ray 构建,支持跨进程、跨机器的 Actor 通讯,轻松应对高并发任务流。
- **本地化优先**:深度适配 **vLLM**,支持本地私有化模型部署,在保障隐私的同时大幅降低 API 调用成本。
### 🛠️ 工业级工程设计
- **强类型契约**:基于 Pydantic-AI 实现 Tool 与 Agent 的接口定义,确保 AI 输出的确定性与安全性。
- **自动化流**:内置工作流引擎 (Workflow Engine),实现从需求发现到自动化执行的闭环。
### 📦 KiloStar 生态子项目 (Sub-projects)
| 项目名称 | 代号 | 功能定位 | 当前状态 |
|:-----------------------------------------------------------|:--------| :--- | :--- |
| **[kilostar-viceroy](https://github.com/zhaoxi826/viceroy)** | **总督** | **资源管理**:负责系统 Skill 的动态安装、元数据解析与全集群分发。 | ✅ 已发布 |
| **[kilostar-thought](https://github.com/zhaoxi826/thought)** | **思绪** | **记忆系统**:增强agent的记忆系统。 | 开发中 |
---
## 🚀 快速开始 (Quick Start)
> **当前版本**`v0.1.0-alpha` (开发预览版)
> 本项目目前处于快速迭代阶段,欢迎提交 Issue 或 Pull Request。
### 方式一:使用 Docker Compose (推荐)
这是部署 **kilostar 应用** 及其配套 **PostgreSQL 数据库** 最简单、最完整的方式。
1. **准备配置文件**:在本地创建一个目录,并新建 `docker-compose.yml`
```yaml
services:
db:
image: postgres:16-alpine
container_name: kilostar_db
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgrespassword
POSTGRES_DB: kilostar
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d kilostar"]
interval: 5s
timeout: 5s
retries: 5
kilostar:
image: zhaoxi5699/kilostar:v0.1.0alpha
container_name: kilostar
ports:
- "8000:8000"
- "8265:8265"
depends_on:
db:
condition: service_healthy
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgrespassword
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
- POSTGRES_DB=kilostar
- SECRET_KEY=changethiskey12345 # 请在生产环境中修改此密钥
```
2. **启动服务**
```bash
docker compose up -d
```
### 方式二:使用 Docker
1. **启动服务**
```bash
docker run -d \
--name kilostar \
-p 8000:8000 \
-p 8265:8265 \
-e POSTGRES_HOST=你的数据库IP \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgrespassword \
-e POSTGRES_DB=kilostar \
-e SECRET_KEY=your_secret_key \
zhaoxi5699/kilostar:v0.1.0alpha
```
## 🔍 访问与验证
服务启动后,可以通过以下地址进行操作:
- Web 控制台 / API 文档: http://localhost:8000
- Ray 任务仪表盘: http://localhost:8265