Polaris
An open-source, self-hosted AI Agent system built for 2026+. Strictly follows the six architectural invariants of Polaris Engineering. Runs on a single machine with 8GB RAM, supports mainstream third-party platforms like Telegram / Discord / Slack / Feishu. End users can customize lifecycle behaviors via Shell Script Hooks without modifying source code.
Positioning & Constraints
| Dimension | Details |
|---|---|
| Positioning | Open-source self-hosted AI Agent (2026+) |
| Environment | Single-machine runnable, consumer laptop, 8GB+ RAM |
| Core Language | Go (orchestration/services) + Rust (performance-critical paths) |
| Storage | Multi-engine co-existence: Relational + Vector + Graph + KV + Full-text + Event Stream |
| Architecture | Multi-Agent Collaboration: Blackboard pattern + CAS atomic claim + supervisor tree |
| Core Capabilities | Self-learning / Self-evolution / Self-enhancement (Gradient-free mainline + Conditional gradient training) |
| LLM Pool | Provider-agnostic: Supports Flash-class and Reasoning-class models. Adapters implemented for OpenAI / Anthropic / DeepSeek protocols. |
Default Recommendation: Out-of-the-box configuration uses DeepSeek V4 series, extensively tested on Tier-0 baseline long-range benchmarks.
Six Invariants of Polaris Engineering
- 1. Observability First: Full-link traceability from line 0. Token_Burn_Rate + Surprise_Index are first-class metrics.
- 2. Verifiable Execution: Probabilistic filtering cannot act as a security boundary. Security decisions must be physically/cryptographically verifiable.
- 3. Composable Primitives: Minimal reusable units. Hot paths sync via interfaces, cold paths communicate via structured events.
- 4. Data-Driven Iteration: Self-evolution driven by Eval Harness. All changes gated through CI.
- 5. State Machine Owns Control Flow: Go deterministic state machine holds control flow, LLM only performs probabilistic fill-in-the-blanks.
- 6. State-in-DB: All states persisted to disk. Asynchronous events decouple cross-storage state changes. Crash recovery via EventLog replay.
Architecture Design
4-layer architecture / 13 modules / 6 code packages, divided into Infrastructure (L0), Cognitive Core (L1), Collaboration & Learning (L2), and Governance & Interface (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) │
└──────────────────────────────────────────────────────┘
Project Structure
polaris/
├── cmd/polaris/ # Entry point
├── pkg/ # Core modules
├── internal/ # Private shared: protocol, config, errors
├── rust/substrate/ # Rust FFI performance paths
├── skills/ # Built-in skills
├── policies/ # Cedar policies
├── configs/ # Default configurations
├── docs/arch/ # Architecture docs
└── Makefile
Installation & Uninstallation
macOS / Linux Install
Default:
curl -sSL https://raw.githubusercontent.com/polarisagi/polaris/main/scripts/install.sh | bash
China Region (Proxy):
curl -sSL https://mirror.ghproxy.com/https://raw.githubusercontent.com/polarisagi/polaris/main/scripts/install.sh | bash
macOS / Linux Uninstall
Default:
curl -sSL https://raw.githubusercontent.com/polarisagi/polaris/main/scripts/uninstall.sh | bash
China Region (Proxy):
curl -sSL https://mirror.ghproxy.com/https://raw.githubusercontent.com/polarisagi/polaris/main/scripts/uninstall.sh | bash
Run & Test
Prerequisites: Go 1.26+, Rust 1.94+
The global working directory is located at ~/.polarisagi/polaris/ in the user's home directory. All runtime state data (including polaris.db), log files, and caches are persisted here.
# Build
make build
# Run
make run
# Test
make test