Polaris

面向 2026+ 的开源自托管 AI Agent 系统。严格遵循 Polaris Engineering 六条架构不变量构建。单机 8GB 内存可运行,支持 Telegram / Discord / Slack / 飞书等主流第三方接入,终端用户无需修改源码即可通过 Shell Script Hooks 自定义生命周期行为。

定位与约束

维度内容
定位开源自托管 AI Agent(2026+)
运行环境单机可运行,消费级笔记本,8GB+ 内存
底座语言Go(编排/服务)+ Rust(性能关键路径)
存储多引擎并存:关系型 + 向量 + 图 + KV + 全文检索 + 事件流
形态多 Agent 协同:黑板模式 + CAS 原子认领 + supervisor tree
核心能力自学习 / 自进化 / 自增强(无梯度主线 + 条件梯度训练)
LLM 池Provider-agnostic:支持 Flash-class 和 Reasoning-class。Adapter 已实现 OpenAI / Anthropic / DeepSeek 等主流协议。
默认推荐:开箱即用配置使用 DeepSeek V4 系列,已在 Tier-0 基线长程测试。

Polaris Engineering 六条不变量

架构设计

四层架构 / 13 模块 / 6 代码包,分为基础设施层 (L0)、认知核心层 (L1)、协同与学习层 (L2)、治理与接口层 (L3)。

┌──────────────────────────────────────────────────────┐
│ L3  Interface & Scheduler (M13) │ Eval Harness (M12) │
├──────────────────────────────────────────────────────┤
│ L2  Orchestrator (M8) │ Self-Improve (M9) │ RAG (M10)│
├──────────────────────────────────────────────────────┤
│ L1  Agent Kernel (M4) │ Memory (M5) │ Skill (M6) │   │
│     Tool & Action (M7)                               │
├──────────────────────────────────────────────────────┤
│ L0  Inference (M1) │ Storage (M2) │ Observability    │
│     (M3) │ Policy & Safety (M11)                     │
└──────────────────────────────────────────────────────┘

项目结构

polaris/
├── cmd/polaris/              # 入口
├── pkg/                      # 核心模块
├── internal/                 # 私有共享: protocol, config, errors
├── rust/substrate/           # Rust FFI 性能路径
├── skills/                   # 内置技能
├── policies/                 # Cedar 策略
├── configs/                  # 默认配置
├── docs/arch/                # 架构设计文档
└── Makefile

快速安装与卸载

macOS / Linux 安装

默认安装:

curl -sSL https://raw.githubusercontent.com/polarisagi/polaris/main/scripts/install.sh | bash

中国地区 (代理加速):

curl -sSL https://mirror.ghproxy.com/https://raw.githubusercontent.com/polarisagi/polaris/main/scripts/install.sh | bash

macOS / Linux 卸载

默认卸载:

curl -sSL https://raw.githubusercontent.com/polarisagi/polaris/main/scripts/uninstall.sh | bash

中国地区 (代理加速):

curl -sSL https://mirror.ghproxy.com/https://raw.githubusercontent.com/polarisagi/polaris/main/scripts/uninstall.sh | bash

运行与测试

前置条件: Go 1.26+, Rust 1.94+

项目的全局工作目录位于用户根目录下的 ~/.polarisagi/polaris/。系统运行时的所有状态数据(包括数据库 polaris.db)、日志文件、运行时缓存等均持久化保存在该目录下。

# 构建
make build

# 运行
make run

# 测试
make test