Skip to main content

English | 简体中文

BoarAI

A minimal, hot-pluggable, cross-platform microkernel AI agent framework for Python 3.10+.

Dashboard

Sessions

What is BoarAI?

BoarAI splits an AI agent into a tiny kernel and hot-swappable extensions. The kernel (boarai/core/) provides only essential services — event bus, configuration, extension loading, session management, prompt assembly, LLM abstraction, tool registry, task system and security guards. Everything business-facing (file tools, shell, web access, memory tools, task tools, skill tools, the WebUI itself) ships as an extension that can be installed, removed, enabled, disabled or hot-reloaded at runtime without restarting the kernel.

Features

  • Microkernel + extensions — one-way dependency (core never imports extensions); extensions talk via the event bus or service calls; unloading one never breaks another.
  • Hot-pluggable — routes, hooks, services, middleware and tools can be added/removed at runtime; external MCP tool servers are bridged from a manifest declaration.
  • Event-driven — one async event bus with a centrally registered catalogue covering runs, tools, thinking, tasks, memory and extensions.
  • Multi-model LLM layer — OpenAI-compatible and Anthropic providers on aiohttp, with streaming, reasoning modes, vision routing and failure fallback.
  • Sessions & run loop — append-only journals, session tree with forks, batched tool execution, approval gating, file-change tracking with snapshot revert, context compression.
  • Self-improvement — synaptic memory mesh, idle-time distillation, failure lessons, automatic SKILL.md creation and management.
  • Built-in WebUI — Vue 3 single-port interface for chat, tasks, extensions, data browsing, file management and settings; English/Chinese.
  • Layered security — access-key gate, path sandbox, tool permission guard, shell command classification, log/audit redaction, soft-delete recycle bin.
  • Cross-platform — Linux / Docker / WSL / Windows; runtime data anchored at ~/.boarai/, separate from the source tree.

Requirements

  • Python 3.10 or newer
  • No database, no external services required

Installation

From PyPI

pip install boarai

From source

cd <repo checkout>
pip install -r requirements.txt     # or: pip install -e .

If dependencies are missing on a fresh checkout, run python main.py --ensure-deps once.

Docker

Three images mirror the three install/update channels — an install only ever updates through its own channel:

Variant Build & run Needs the source tree? In-container self-update
Source (default) docker compose up -d --build yes (Dockerfile copies it) source channel (release-archive swap)
PyPI docker compose -f docker-compose.pypi.yml up -d --build no pip channel (pip install -U boarai)
GitHub docker compose -f docker-compose.github.yml up -d --build no (clones the repo) git channel (git fetch --tags + checkout)

docker-compose.pypi.yml and docker-compose.github.yml are self-contained: the Dockerfile is inlined, so you can copy that single file to any machine (or paste it into a NAS compose UI) and build — nothing else is read from the build context. Requires Docker Compose >= 2.17. The source variant builds from the tree next to it; an unpacked PyPI sdist works as that tree.

PyPI-variant rebuilds are incremental: the base image and dependency layers stay cached, and a PyPI freshness probe busts only the boarai layer — a routine up -d --build reinstalls just the boarai wheel, never re-resolving or re-downloading dependencies.

Pin releases with BOARAI_VERSION=0.1.1 (PyPI variant), BOARAI_GIT_REF=v0.1.1 (GitHub variant), or BOARAI_GIT_REPO=<your-fork>; map a different host port with BOARAI_HOST_PORT=8080.

Data persistence. Inside the container everything lands under BOARAI_DATA_DIR=/data, bind-mounted to ./.boarai next to the compose file — the folder you picked in the NAS UI when creating the project, named like a bare-metal ~/.boarai. It survives down, down -v, image rebuilds and NAS reboots. Note: a dot-folder is hidden by default in some NAS file managers — enable "show hidden files". Set BOARAI_DATA_HOST_DIR to an absolute path to share one directory across variants or move it elsewhere.

Backup and restore are plain tar:

tar czf boarai-data.tgz -C ./.boarai .
tar xzf boarai-data.tgz -C ./.boarai

Upgrading from an older install that used the named volume boarai-data? Run this once from the compose directory before the first start:

docker run --rm -v boarai-data:/from -v "$PWD/.boarai":/to alpine sh -c "cp -a /from/. /to/"

Upgrade order: migrate first (the command above) or accept a fresh start → delete the old project in the NAS UI without ticking "delete volumes" (ticking it destroys the old data irrecoverably) → deploy the new yml; old and new share the container name boarai, so the old container must be gone first.

First-run access key. A bridged container never looks like a loopback peer, so claim the key whichever way suits you:

  1. Setup code (simplest). The first-run log prints a one-shot code — open the WebUI from any machine and type it in. It is re-minted on every restart until the key is claimed; loopback peers need no code.

    docker compose logs boarai
    
  2. One-off command, which prints the key once:

    docker compose run --rm boarai python main.py key init       # source / github images
    docker compose run --rm boarai python -m boarai key init     # pypi image
    
  3. Pre-seed BOARAI_API_TOKEN (32+ base64url characters) in the compose file — adopted on first run only, never overrides an existing key.

Quick start

1. Start the server

boarai                 # pip install: console script
python -m boarai       # pip install: module form
python main.py         # source checkout

The server listens on http://localhost:26620 (HTTP + WebSocket on one port). Other subcommands: stop, restart, status, key.

2. Unlock the WebUI

Open http://localhost:26620 in a browser. On first run the setup page asks you to create an access key — the key is shown once and only its hash is stored, so save it somewhere safe. Later devices unlock with that key; rotate it with boarai key rotate if it leaks.

3. Configure a model

Go to Settings → LLM, add a provider (OpenAI-compatible endpoint or Anthropic) with your API key and base URL, then pick a default model. Keys are stored only in ~/.boarai/config/llm.yaml and never logged.

4. Chat

Open Sessions, press New, and type a message. The agent answers with streaming text, may call tools (file edits, shell, web fetch…) and asks for approval when a tool needs it. File changes of each run are tracked and can be reverted from the changes panel.

5. Explore

  • Tasks — schedule periodic agent or script jobs.
  • Extensions — enable/disable the shipped tools, browse failures, install user extensions from ~/.boarai/extensions/.
  • Data — browse memories, lessons and skills the agent accumulates.
  • Settings — security policy, approval defaults, logging, update channel.

Extensions

Settings

Where things live

What Where
Kernel boarai/core/
Shipped extensions, prompts, defaults boar/
Runtime data (config, sessions, logs, memory, trash) ~/.boarai/
User-installed extensions ~/.boarai/extensions/

Documentation

Each file covers exactly one kernel subsystem (English / 中文):

Event system / 事件 Runtime / 运行时 Server / 服务器
API layer / API Config / 配置 Logging / 日志
Security / 安全 LLM layer / LLM Prompt / 提示词
Sessions & runs / 会话 Extensions / 扩展 Memory / 记忆
Tasks / 任务 Commands / 命令 Recycle bin / 回收站
Online update / 更新 Kernel fs / 文件 Shell backends / Shell
Process / 进程 Dependencies / 依赖 Curation / 整理

Development rules (code placement, dependency boundaries, event/dual-channel registration chains, coding style, testing) live in CODE_STANDARDS.md (中文) at the repository root.

License

MIT — see LICENSE.

Release notes - 0.1.2.8

Released 2026-11-27.

  • Reverse-proxy compatibility fixed: behind a TLS-terminating proxy the first-run setup page failed with a bare HTTP 403 on every POST, because the Origin check compared against request.scheme://request.host, which is always http:// on the socket side. Origin validation now compares hosts only (tolerating the http/https split), derives the public hostname set from Host plus the LAST X-Forwarded-Host hop (the hop closest to the server; a client-forged first entry is ignored), normalizes default ports (https://host matches Host: host:443, while the same host on a different port is still rejected), and keeps BOARAI_ALLOWED_ORIGINS as an explicit whitelist fallback. Rejections now use the standard error envelope with error.code = origin_not_allowed, so the WebUI shows an actionable message instead of HTTP 403. Zero-config coverage: Caddy, Traefik, Cloudflare, and nginx with proxy_set_header Host $host. A bare proxy_pass that rewrites Host and forwards no XFH gives the server no signal - declare the whitelist. See the new reverse-proxy section in docs/server.md.
  • Slow extension dependency installs no longer block startup. A user extension declaring pip_dependencies used to install synchronously (120s timeout) before the web port was bound, so a slow link to PyPI could make the whole UI unreachable for minutes. Missing dependencies now fail fast after a 10s grace with code = deps.installing, the install continues in the background (subprocess timeout raised to 600s), and the extension hot-loads on the next watcher tick once ready. Background installs are serialized by a lock so several extensions cannot write the same site-packages concurrently, they report failure by return value rather than by raising into an unawaited task, and the real reason resurfaces as Previous attempt failed: ... on the next attempt. deps.installing is logged at WARNING, not ERROR - it is an expected transient.
  • PyPI-variant image rebuilds are incremental. no_cache: true is gone; the inline Dockerfile is now three layers: a cached dependency layer, a PyPI JSON probe layer (BuildKit revalidates its checksum every build, so publishing a new release busts only the layers below it), then pip install --no-deps --upgrade boarai plus a smoke import. If the smoke import or pip check fails - e.g. a new release added a dependency the compose layer does not know about - it falls back to a full dependency reinstall. up -d --build still picks up the newest release; pin BOARAI_VERSION for reproducible builds.
  • web_fetch Tier 1 no longer uses curl_cffi streaming mode. Stream mode plus a synchronous Response.close() triggered an upstream double-free of the curl handle, producing TypeError: initializer for ctype 'void *' must be a cdata pointer, not NoneType in the asyncio loop and failing the whole tool call; the same upstream bug could poison the handle pool and kill unrelated in-flight requests with a bare CancelledError. Requests are now non-streaming with a write-callback body sink: the 10 MiB cap aborts the transfer instead of reading and discarding, and the homepage warmup downloads at most 256 KiB. Error text and the tier fallback order are unchanged.

Metadata

Release files for boarai 0.1.2.8

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

Source distribution (sdist)

Source distribution for boarai 0.1.2.8
File Size Uploaded Provenance Actions
boarai-0.1.2.8.tar.gz 2.6 MB Without provenance Details for boarai-0.1.2.8.tar.gz

Built distribution (wheel)

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

Total release size: 4.3 MB

Release files / boarai-0.1.2.8.tar.gz

Download URL boarai-0.1.2.8.tar.gz
Size 2.6 MB
Tags Source
SHA-256 checksum
How to use checksums
618f2dc2e58505709e58a97457bdd929c1ce0a53c14307f7382ddc32fc52646e
BLAKE2b-256 checksum
How to use checksums
1d81f1f78b2b51d03746c89081daecd0707ee3a2e07684f56c1e0e16dcb56f1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release files / boarai-0.1.2.8-py3-none-any.whl

Download URL boarai-0.1.2.8-py3-none-any.whl
Size 1.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
4629aac9ea4184b83306b4b3d7341bbbbdad44da1d424693b68fd96f220a5236
BLAKE2b-256 checksum
How to use checksums
7575e0865f5493378f89c8f3d4bd49f6b2fdb1c6410c6ee522adc81995c02895
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Security for boarai 0.1.2.8

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