Compare commits

..

3 Commits

Author SHA1 Message Date
wehub-resource-sync d95e660ed1 docs: make Chinese README the default 2026-07-13 10:42:59 +00:00
wehub-resource-sync 4e609e1eed docs: preserve upstream English README 2026-07-13 10:41:42 +00:00
wehub-resource-sync 983960e2dd chore: import upstream snapshot with attribution 2026-07-13 12:44:08 +08:00
278 changed files with 8739 additions and 9575 deletions
+8 -2
View File
@@ -15,6 +15,9 @@ LEON_OPENROUTER_API_KEY=
# Z.AI API key
LEON_ZAI_API_KEY=
# MiniMax API key
LEON_MINIMAX_API_KEY=
# OpenAI API key
LEON_OPENAI_API_KEY=
@@ -35,5 +38,8 @@ LEON_GROQ_API_KEY=
# Misc
# HTTP API key (use "pnpm run generate:http-api-key" to regenerate one)
LEON_HTTP_API_KEY=
# Optional token required by LeonClientInterface when client_interface.auth.enabled=true
LEON_CLIENT_INTERFACE_TOKEN=
# Optional token required by HTTP plugins when http_plugins.auth.enabled=true
LEON_HTTP_PLUGIN_TOKEN=
+1
View File
@@ -8,6 +8,7 @@ __pycache__/
**/.venv/
**/.last-skill-deps-sync
**/.last-source-deps-sync
skills/**/reports/*
test/coverage/
**/tmp/*
core/config/**/*.json
+183
View File
@@ -0,0 +1,183 @@
<p align="center">
<a href="https://getleon.ai"><img width="800" src="https://getleon.ai/img/hero-animation.gif" /></a>
</p>
<h1 align="center">
<a href="https://getleon.ai"><img width="96" src="https://getleon.ai/img/logo.svg" alt="Leon"></a><br>
Leon
</h1>
_<p align="center">Your open-source personal AI assistant.</p>_
<p align="center">
<a href="https://discord.gg/MNQqqKg"><img src="https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge&logo=discord&logoColor=white" /></a>
<a href="https://github.com/leon-ai/leon/blob/develop/LICENSE.md"><img src="https://img.shields.io/badge/License-MIT-1c75db?style=for-the-badge" /></a>
</p>
<p align="center">
I share Leon progress most regularly on <a href="https://x.com/grenlouis"><strong>X / @grenlouis</strong></a>
</p>
<p align="center">
<a href="https://x.com/grenlouis">Follow progress on X / @grenlouis</a> ·
<a href="https://getleon.ai">Website</a> ·
<a href="https://leonai.substack.com/subscribe">Newsletter</a> ·
<a href="http://roadmap.getleon.ai">Roadmap</a> ·
<a href="https://blog.getleon.ai/the-story-behind-leon/">Story</a>
</p>
---
## ⚠️ Important Notice (as of 2026-03-29)
> [!IMPORTANT]
> Leon is currently focused on the **2.0 Developer Preview** on the `develop` branch.
>
> - The new documentation is **not ready yet**.
> - The current docs site and older guides mostly reflect the legacy architecture.
> - If you want the legacy, more stable pre-agentic version of Leon, use the `master` branch.
> - If you want to explore or contribute to Leon's new core, `develop` is the right place.
The most accurate high-level references for Leon's current state are:
- [`core/context/LEON.md`](./core/context/LEON.md)
- [`core/context/ARCHITECTURE.md`](./core/context/ARCHITECTURE.md)
## 👋 Introduction
**Leon** is **your open-source personal AI assistant** built around **tools, context, memory, and agentic execution**.
Leon is designed to stay practical, privacy-aware, and grounded in your real environment. It can operate locally, use dedicated tools instead of relying on free-form guessing, and complete tasks from start to finish across deterministic workflows and agent-style execution.
## 🧠 What Leon Is Today
Leon is no longer just a classic intent-classification assistant like it was for its first release in 2019.
Today, Leon is being built as a more capable assistant that can understand a goal, choose how to handle it, use tools, remember useful information, and recover when something goes wrong.
- Leon can run in different ways depending on the task: `smart` mode chooses for you, `controlled` mode follows deterministic native skills and actions, and `agent` mode can plan step by step.
- Leon supports native skills for controlled actions and agent skills for `SKILL.md`-backed workflows.
- Leon can use real tools to get work done instead of only replying with plain text.
- Leon can use context about your environment so answers stay grounded in what is actually happening on your machine and setup.
- Leon keeps layered memory so it can remember durable preferences, day-to-day context, and recent discussion context.
- Leon supports both local and remote AI providers, which helps balance privacy, control, and capability.
- Under the hood, Leon-native skills follow `Skills -> Actions -> Tools -> Functions (-> Binaries)`.
Leon also keeps a compact self-model and a bounded proactive pulse system so it can stay more consistent over time without flooding itself with unnecessary context.
## Why?
- **Privacy matters**: Leon can work with local models and local context instead of forcing everything through third-party services.
- **Grounded behavior matters**: Leon prefers explicit tools, context, and memory over vague model-only responses.
- **Extensibility matters**: skills, toolkits, bridges, and binaries make it possible to keep Leon modular.
- **Open source matters**: anyone can inspect the architecture, build on top of it, and help shape where it goes next.
## 🚀 Getting Started
### Prerequisites
- [Node.js](https://nodejs.org/) >= 24.0.0
- Supported OSes: Linux, macOS, and Windows
Recommended: manage Node.js with [Volta](https://volta.sh/).
### Installation
```sh
# Clone the repository
git clone https://github.com/leon-ai/leon.git
# Go to the project root
cd leon
# Install pnpm
npm install --global pnpm@latest
# Install dependencies
pnpm install
```
### Run Leon
```sh
# Run Leon
pnpm start
```
### Check Your Setup
```sh
# Check the setup went well
pnpm run check
```
By default, Leon runs locally and the app is available on `http://localhost:5366`.
## 🏗️ Architecture Snapshot
At a high level, Leon currently consists of:
- `server/`: the main runtime, routing, memory, context management, HTTP API, and agent/controlled execution
- `app/`: the web application
- `aurora/`: UI components and preview environment
- `skills/`: built-in capabilities, split between `native/` skills and `agent/` skills
- `bridges/`: Node.js and Python bridges plus toolkit definitions and tool runtimes
- `tcp_server/`: Python services used by parts of the runtime stack
- `core/context/`: generated identity and architecture context documents that describe Leon's current behavior
This repository already includes skills and toolkits for areas such as search, productivity, system utilities, media workflows, coding assistance, memory-backed interactions, and voice/audio features.
## 📚 Documentation Status
The new docs for Leon 2.0 are not ready yet.
For now:
- treat this repository as the source of truth for the **2.0 Developer Preview**
- use [`core/context/LEON.md`](./core/context/LEON.md) for Leon's current identity and behavior
- use [`core/context/ARCHITECTURE.md`](./core/context/ARCHITECTURE.md) for the current architecture overview
- expect the public docs site to lag behind the new core until the updated documentation is published
## ❤️ Contributing
We are starting to progressively onboard contributors for the **2.0 Developer Preview**.
If you want to follow the project or express interest in joining that onboarding:
- [2.0 Developer Preview contributor form](https://forms.gle/6PCG2D5rYo1q8tKMA)
- [Roadmap](http://roadmap.getleon.ai)
- [Discord](https://discord.gg/MNQqqKg)
- [GitHub issues](https://github.com/leon-ai/leon/issues)
### Why is there a small amount of contributors?
Leon has been evolving for a long time, but the current 2.0 work is a major transition period.
For a long time, Leon was a smaller assistant project with a simpler architecture. Today, the core is being rebuilt into a much more capable system around tools, memory, context, and agent-style execution. That means a lot of things are still moving, and it makes contribution harder than it will be once the new docs and architecture settle down.
Another important reason is simply time: Leon is still developed largely during spare time. So progress can be uneven, and opening the project more broadly has to be balanced with keeping the direction coherent while the 2.0 Developer Preview is still taking shape.
## 📖 The Story Behind Leon
Leon started in 2017 and has been active since 2019. If you want the longer backstory, read [the story behind Leon](https://blog.getleon.ai/the-story-behind-leon/).
## 🔔 Stay Tuned
- [X / Twitter](https://x.com/grenlouis) is the main place where I share Leon progress updates
- [Newsletter](https://leonai.substack.com/subscribe)
- [Blog](https://blog.getleon.ai)
- [YouTube](https://www.youtube.com/channel/UCW6mk6j6nQUzFYY97r47emQ)
## 👨 Author
**Louis Grenard** ([@grenlouis](https://x.com/grenlouis))
## 👍 Sponsors
You can also contribute by [sponsoring Leon](http://sponsor.getleon.ai).
## Thanks
| ![OpenAI logo.](./.github/assets/thanks/openai-logo-light-mode.svg?v=2#gh-light-mode-only)![OpenAI logo.](./.github/assets/thanks/openai-logo-dark-mode.svg?v=2#gh-dark-mode-only) | ![JetBrains logo.](./.github/assets/thanks/jetbrains-mono-black.svg?v=2#gh-light-mode-only)![JetBrains logo.](./.github/assets/thanks/jetbrains-mono-white.svg?v=2#gh-dark-mode-only) | ![MacStadium logo.](./.github/assets/thanks/macstadium-logo-light-mode.svg?v=2#gh-light-mode-only)![MacStadium logo.](./.github/assets/thanks/macstadium-logo-dark-mode.svg?v=2#gh-dark-mode-only) |
| --- | --- | --- |
| [openai.com/form/codex-for-oss](https://openai.com/form/codex-for-oss/) | [jb.gg/OpenSource](https://jb.gg/OpenSource) | [macstadium.com/company/opensource](https://macstadium.com/company/opensource) |
+80 -74
View File
@@ -1,3 +1,9 @@
<!-- WEHUB_ZH_README -->
> [!NOTE]
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
> [English](./README.en.md) · [原始项目](https://github.com/leon-ai/leon) · [上游 README](https://github.com/leon-ai/leon/blob/HEAD/README.md)
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
<p align="center">
<a href="https://getleon.ai"><img width="800" src="https://getleon.ai/img/hero-animation.gif" /></a>
</p>
@@ -7,7 +13,7 @@
Leon
</h1>
_<p align="center">Your open-source personal AI assistant.</p>_
_<p align="center">你的开源个人 AI 助手。</p>_
<p align="center">
<a href="https://discord.gg/MNQqqKg"><img src="https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge&logo=discord&logoColor=white" /></a>
@@ -15,73 +21,73 @@ _<p align="center">Your open-source personal AI assistant.</p>_
</p>
<p align="center">
I share Leon progress most regularly on <a href="https://x.com/grenlouis"><strong>X / @grenlouis</strong></a>
我最常在 <a href="https://x.com/grenlouis"><strong>X / @grenlouis</strong></a> 上分享 Leon 的进展
</p>
<p align="center">
<a href="https://x.com/grenlouis">Follow progress on X / @grenlouis</a> ·
<a href="https://getleon.ai">Website</a> ·
<a href="https://x.com/grenlouis"> X / @grenlouis 关注进展</a> ·
<a href="https://getleon.ai">网站</a> ·
<a href="https://leonai.substack.com/subscribe">Newsletter</a> ·
<a href="http://roadmap.getleon.ai">Roadmap</a> ·
<a href="https://blog.getleon.ai/the-story-behind-leon/">Story</a>
<a href="http://roadmap.getleon.ai">路线图</a> ·
<a href="https://blog.getleon.ai/the-story-behind-leon/">故事</a>
</p>
---
## ⚠️ Important Notice (as of 2026-03-29)
## ⚠️ 重要通知(截至 2026-03-29
> [!IMPORTANT]
> Leon is currently focused on the **2.0 Developer Preview** on the `develop` branch.
> Leon 目前专注于 `develop` 分支上的 **2.0 Developer Preview2.0 开发者预览版)**。
>
> - The new documentation is **not ready yet**.
> - The current docs site and older guides mostly reflect the legacy architecture.
> - If you want the legacy, more stable pre-agentic version of Leon, use the `master` branch.
> - If you want to explore or contribute to Leon's new core, `develop` is the right place.
> - 新文档**尚未就绪**
> - 当前文档站点和旧版指南大多反映的是旧版架构。
> - 如果你想要旧版、更稳定的非智能体式(pre-agenticLeon,请使用 `master` 分支。
> - 如果你想探索或参与 Leon 新核心的开发,`develop` 是合适的选择。
The most accurate high-level references for Leon's current state are:
关于 Leon 当前状态最准确的高层参考是:
- [`core/context/LEON.md`](./core/context/LEON.md)
- [`core/context/ARCHITECTURE.md`](./core/context/ARCHITECTURE.md)
## 👋 Introduction
## 👋 简介
**Leon** is **your open-source personal AI assistant** built around **tools, context, memory, and agentic execution**.
**Leon** 是一款围绕**工具、上下文、记忆和智能体式执行(agentic execution**构建的**开源个人 AI 助手**。
Leon is designed to stay practical, privacy-aware, and grounded in your real environment. It can operate locally, use dedicated tools instead of relying on free-form guessing, and complete tasks from start to finish across deterministic workflows and agent-style execution.
Leon 的设计注重实用性、隐私保护,并扎根于你的真实环境。它可以在本地运行,使用专用工具而非依赖自由形式的猜测,并能在确定性工作流和智能体式执行中从头到尾完成任务。
## 🧠 What Leon Is Today
## 🧠 Leon 如今的定位
Leon is no longer just a classic intent-classification assistant like it was for its first release in 2019.
Leon 不再像 2019 年首次发布时那样,只是一个经典的意图分类助手。
Today, Leon is being built as a more capable assistant that can understand a goal, choose how to handle it, use tools, remember useful information, and recover when something goes wrong.
如今,Leon 正被打造为能力更强的助手,能够理解目标、选择处理方式、使用工具、记住有用信息,并在出现问题时进行恢复。
- Leon can run in different ways depending on the task: `smart` mode chooses for you, `controlled` mode follows deterministic native skills and actions, and `agent` mode can plan step by step.
- Leon supports native skills for controlled actions and agent skills for `SKILL.md`-backed workflows.
- Leon can use real tools to get work done instead of only replying with plain text.
- Leon can use context about your environment so answers stay grounded in what is actually happening on your machine and setup.
- Leon keeps layered memory so it can remember durable preferences, day-to-day context, and recent discussion context.
- Leon supports both local and remote AI providers, which helps balance privacy, control, and capability.
- Under the hood, Leon-native skills follow `Skills -> Actions -> Tools -> Functions (-> Binaries)`.
- Leon 可根据任务以不同方式运行:`smart` 模式会替你选择,`controlled` 模式遵循确定性的原生技能和操作,`agent` 模式可以逐步规划。
- Leon 支持用于受控操作的原生技能,以及用于 `SKILL.md` 支持的工作流的智能体技能。
- Leon 可以使用真实工具完成任务,而不仅限于纯文本回复。
- Leon 可以利用你环境中的上下文,使回答始终立足于你机器和配置上的实际情况。
- Leon 保持分层记忆,能够记住持久偏好、日常上下文以及近期讨论上下文。
- Leon 同时支持本地和远程 AI 提供商,有助于在隐私、控制与能力之间取得平衡。
- 在底层,Leon 原生技能遵循 `Skills -> Actions -> Tools -> Functions (-> Binaries)`
Leon also keeps a compact self-model and a bounded proactive pulse system so it can stay more consistent over time without flooding itself with unnecessary context.
Leon 还维护紧凑的自我模型和有边界的主动脉冲(proactive pulse)系统,使其能够长期保持一致,而不会用不必要的上下文淹没自身。
## Why?
## 为什么?
- **Privacy matters**: Leon can work with local models and local context instead of forcing everything through third-party services.
- **Grounded behavior matters**: Leon prefers explicit tools, context, and memory over vague model-only responses.
- **Extensibility matters**: skills, toolkits, bridges, and binaries make it possible to keep Leon modular.
- **Open source matters**: anyone can inspect the architecture, build on top of it, and help shape where it goes next.
- **隐私很重要**:Leon 可以使用本地模型和本地上下文,而无需将所有内容强制经由第三方服务。
- **立足现实的行为很重要**:Leon 更倾向于使用明确的工具、上下文和记忆,而非模糊的纯模型回复。
- **可扩展性很重要**:技能、工具包、桥接和二进制组件使 Leon 能够保持模块化。
- **开源很重要**:任何人都可以审查架构、在其基础上构建,并帮助塑造其未来方向。
## 🚀 Getting Started
## 🚀 快速开始
### Prerequisites
### 前置条件
- [Node.js](https://nodejs.org/) >= 24.0.0
- Supported OSes: Linux, macOS, and Windows
- 支持的操作系统:LinuxmacOS Windows
Recommended: manage Node.js with [Volta](https://volta.sh/).
推荐:使用 [Volta](https://volta.sh/). 管理 Node.js
### Installation
### 安装
```sh
# Clone the repository
@@ -97,86 +103,86 @@ npm install --global pnpm@latest
pnpm install
```
### Run Leon
### 运行 Leon
```sh
# Run Leon
pnpm start
```
### Check Your Setup
### 检查你的环境
```sh
# Check the setup went well
pnpm run check
```
By default, Leon runs locally and the app is available on `http://localhost:5366`.
默认情况下,Leon 在本地运行,应用可通过 `http://localhost:5366` 访问。
## 🏗️ Architecture Snapshot
## 🏗️ 架构概览
At a high level, Leon currently consists of:
从高层来看,Leon 目前由以下部分组成:
- `server/`: the main runtime, routing, memory, context management, HTTP API, and agent/controlled execution
- `app/`: the web application
- `aurora/`: UI components and preview environment
- `skills/`: built-in capabilities, split between `native/` skills and `agent/` skills
- `bridges/`: Node.js and Python bridges plus toolkit definitions and tool runtimes
- `tcp_server/`: Python services used by parts of the runtime stack
- `core/context/`: generated identity and architecture context documents that describe Leon's current behavior
- `server/`:主运行时、路由、记忆、上下文管理、HTTP API,以及智能体/受控执行
- `app/`Web 应用
- `aurora/`UI 组件和预览环境
- `skills/`:内置能力,分为 `native/` 技能和 `agent/` 技能
- `bridges/`Node.js Python 桥接,以及工具包定义和工具运行时
- `tcp_server/`:运行时栈部分组件使用的 Python 服务
- `core/context/`:描述 Leon 当前行为的生成式身份与架构上下文文档
This repository already includes skills and toolkits for areas such as search, productivity, system utilities, media workflows, coding assistance, memory-backed interactions, and voice/audio features.
本仓库已包含搜索、生产力、系统工具、媒体工作流、编程辅助、记忆支持交互以及语音/音频功能等领域的技能和工具包。
## 📚 Documentation Status
## 📚 文档状态
The new docs for Leon 2.0 are not ready yet.
Leon 2.0 的新文档尚未就绪。
For now:
目前:
- treat this repository as the source of truth for the **2.0 Developer Preview**
- use [`core/context/LEON.md`](./core/context/LEON.md) for Leon's current identity and behavior
- use [`core/context/ARCHITECTURE.md`](./core/context/ARCHITECTURE.md) for the current architecture overview
- expect the public docs site to lag behind the new core until the updated documentation is published
- 将此仓库视为 **2.0 Developer Preview** 的权威来源
- 使用 [`core/context/LEON.md`](./core/context/LEON.md) 了解 Leon 当前的身份与行为
- 使用 [`core/context/ARCHITECTURE.md`](./core/context/ARCHITECTURE.md) 了解当前架构概览
- 在更新后的文档发布之前,公开文档站点预计会滞后于新核心
## ❤️ Contributing
## ❤️ 参与贡献
We are starting to progressively onboard contributors for the **2.0 Developer Preview**.
我们正在逐步为 **2.0 Developer Preview** 引入贡献者。
If you want to follow the project or express interest in joining that onboarding:
如果你想关注该项目或表达加入该引导流程的意向:
- [2.0 Developer Preview contributor form](https://forms.gle/6PCG2D5rYo1q8tKMA)
- [Roadmap](http://roadmap.getleon.ai)
- [2.0 Developer Preview 贡献者表单](https://forms.gle/6PCG2D5rYo1q8tKMA)
- [路线图](http://roadmap.getleon.ai)
- [Discord](https://discord.gg/MNQqqKg)
- [GitHub issues](https://github.com/leon-ai/leon/issues)
### Why is there a small amount of contributors?
### 为什么贡献者数量较少?
Leon has been evolving for a long time, but the current 2.0 work is a major transition period.
Leon 已经演进了很长时间,但当前的 2.0 工作正处于重大转型期。
For a long time, Leon was a smaller assistant project with a simpler architecture. Today, the core is being rebuilt into a much more capable system around tools, memory, context, and agent-style execution. That means a lot of things are still moving, and it makes contribution harder than it will be once the new docs and architecture settle down.
长期以来,Leon 是一个架构更简单的小型助手项目。如今,核心正在围绕工具、记忆、上下文和智能体式执行重建为能力更强的系统。这意味着许多内容仍在变动,在全新文档和架构稳定下来之前,参与贡献会比之后更加困难。
Another important reason is simply time: Leon is still developed largely during spare time. So progress can be uneven, and opening the project more broadly has to be balanced with keeping the direction coherent while the 2.0 Developer Preview is still taking shape.
另一个重要原因仅仅是时间:Leon 的开发仍主要在业余时间进行。因此进展可能不均衡,在 2.0 Developer Preview 仍在成形之际,更广泛地开放项目必须与保持方向连贯性之间取得平衡。
## 📖 The Story Behind Leon
## 📖 Leon 背后的故事
Leon started in 2017 and has been active since 2019. If you want the longer backstory, read [the story behind Leon](https://blog.getleon.ai/the-story-behind-leon/).
Leon 始于 2017 年,自 2019 年以来一直活跃。如果你想了解更完整的故事,请阅读 [Leon 背后的故事](https://blog.getleon.ai/the-story-behind-leon/).
## 🔔 Stay Tuned
## 🔔 保持关注
- [X / Twitter](https://x.com/grenlouis) is the main place where I share Leon progress updates
- [X / Twitter](https://x.com/grenlouis) 是我分享 Leon 进展更新的主要渠道
- [Newsletter](https://leonai.substack.com/subscribe)
- [Blog](https://blog.getleon.ai)
- [YouTube](https://www.youtube.com/channel/UCW6mk6j6nQUzFYY97r47emQ)
## 👨 Author
## 👨 作者
**Louis Grenard** ([@grenlouis](https://x.com/grenlouis))
## 👍 Sponsors
## 👍 赞助商
You can also contribute by [sponsoring Leon](http://sponsor.getleon.ai).
你也可以通过[赞助 Leon](http://sponsor.getleon.ai). 来参与贡献
## Thanks
## 致谢
| ![OpenAI logo.](./.github/assets/thanks/openai-logo-light-mode.svg?v=2#gh-light-mode-only)![OpenAI logo.](./.github/assets/thanks/openai-logo-dark-mode.svg?v=2#gh-dark-mode-only) | ![JetBrains logo.](./.github/assets/thanks/jetbrains-mono-black.svg?v=2#gh-light-mode-only)![JetBrains logo.](./.github/assets/thanks/jetbrains-mono-white.svg?v=2#gh-dark-mode-only) | ![MacStadium logo.](./.github/assets/thanks/macstadium-logo-light-mode.svg?v=2#gh-light-mode-only)![MacStadium logo.](./.github/assets/thanks/macstadium-logo-dark-mode.svg?v=2#gh-dark-mode-only) |
| --- | --- | --- |
+7
View File
@@ -0,0 +1,7 @@
# WeHub 来源说明
- 原始项目:`leon-ai/leon`
- 原始仓库:https://github.com/leon-ai/leon
- 导入方式:上游默认分支的最新快照
- 原作者、版权和许可证信息以原始仓库及本仓库 LICENSE 为准
- 本文件仅用于记录来源,不代表 WeHub 是原项目作者
+6 -3
View File
@@ -1,3 +1,5 @@
@use 'sass:meta';
@import '@fontsource/source-sans-pro/200.css';
@import '@fontsource/source-sans-pro/300.css';
@import '@fontsource/source-sans-pro/400.css';
@@ -5,9 +7,10 @@
@import '@fontsource/source-sans-pro/700.css';
@import '@fontsource/source-sans-pro/900.css';
@import 'remixicon/fonts/remixicon.css';
@import 'tool-ui.scss';
@import 'voice-energy/main.scss';
@import 'file-system-autocomplete.scss';
@include meta.load-css('tool-ui');
@include meta.load-css('voice-energy/main');
@include meta.load-css('file-system-autocomplete');
html,
body,
+8
View File
@@ -0,0 +1,8 @@
@use 'sass:color';
$voice-neon-pink-color: #ed297a;
$voice-neon-blue-color: #1c75db;
$voice-neon-shadow-color: color.mix(
$voice-neon-pink-color,
$voice-neon-blue-color
);
+4 -2
View File
@@ -1,3 +1,5 @@
@use 'variables' as *;
/**
* IDLE status
*/
@@ -15,7 +17,7 @@
transform: scale(1);
}
#purple-neon-blur circle {
filter: drop-shadow(0px 0px 64px mix(#ed297a, #1c75db));
filter: drop-shadow(0px 0px 64px $voice-neon-shadow-color);
animation: idleNeonBlurBreath 2.2s infinite alternate;
}
#pink-neon-1 {
@@ -34,7 +36,7 @@
@keyframes idleNeonBlurBreath {
100% {
filter: drop-shadow(0px 0px 0px mix(#ed297a, #1c75db));
filter: drop-shadow(0px 0px 0px $voice-neon-shadow-color);
}
}
@keyframes idleBouncePurpleNeonBlur {
+4 -2
View File
@@ -1,3 +1,5 @@
@use 'variables' as *;
/**
* Listening status
*/
@@ -15,7 +17,7 @@
transform: scale(1);
}
#purple-neon-blur circle {
filter: drop-shadow(0px 0px 64px mix(#ed297a, #1c75db));
filter: drop-shadow(0px 0px 64px $voice-neon-shadow-color);
animation: listeningNeonBlurBreath 0.7s infinite alternate;
}
#pink-neon-1 {
@@ -34,7 +36,7 @@
@keyframes listeningNeonBlurBreath {
100% {
filter: drop-shadow(0px 0px 0px mix(#ed297a, #1c75db));
filter: drop-shadow(0px 0px 0px $voice-neon-shadow-color);
}
}
@keyframes listeningBouncePurpleNeonBlur {
+5 -5
View File
@@ -1,5 +1,5 @@
@import 'base.scss';
@import 'listening.scss';
@import 'idle.scss';
@import 'processing.scss';
@import 'talking.scss';
@use 'base';
@use 'listening';
@use 'idle';
@use 'processing';
@use 'talking';
+39 -18
View File
@@ -5,6 +5,20 @@ import VoiceEnergy from './voice-energy'
import { ASR_DISABLED_MESSAGE, INIT_MESSAGES } from './constants'
import handleSuggestions from './suggestion-handler.js'
const LEON_CLIENT_INTERFACE_PROTOCOL_VERSION = 1
const LEON_EVENTS = {
init: 'leon:init',
utterance: 'leon:utterance',
ready: 'leon:ready',
answer: 'leon:answer',
isTyping: 'leon:is-typing',
suggest: 'leon:suggest',
llmToken: 'leon:llm-token',
llmReasoningToken: 'leon:llm-reasoning-token',
ownerUtterance: 'leon:owner-utterance',
error: 'leon:error'
}
export default class Client {
constructor(client, serverUrl, input, options = {}) {
this.client = client
@@ -155,11 +169,18 @@ export default class Client {
}
this.socket.on('connect', () => {
this.socket.emit('init', {
client: this.client,
this.socket.emit(LEON_EVENTS.init, {
protocolVersion: LEON_CLIENT_INTERFACE_PROTOCOL_VERSION,
client: {
id: this.client,
type: 'web_app',
name: 'Leon Web App'
},
sessionId: this.activeSessionId,
capabilities: {
supportsWidgets: true
supportsWidgets: true,
supportsTokenStreaming: true,
supportsVoice: true
}
})
})
@@ -167,17 +188,14 @@ export default class Client {
/**
* Init status listeners
*/
this.socket.on('init-client-core-server-handshake', (status) => {
this.setInitStatus('clientCoreServerHandshake', status)
})
this.socket.on('init-tcp-server-boot', (status) => {
this.setInitStatus('tcpServerBoot', status)
})
this.socket.on('init-llama-server-boot', (status) => {
this.setInitStatus('llamaServerBoot', status)
})
this.socket.on('ready', () => {
this.socket.on(LEON_EVENTS.ready, () => {
this.setInitStatus('clientCoreServerHandshake', 'success')
this.setInitStatus('tcpServerBoot', 'success')
void this._chatbotInitPromise?.then(() => {
setTimeout(() => {
const body = document.querySelector('body')
@@ -188,7 +206,7 @@ export default class Client {
})
})
this.socket.on('answer', (data) => {
this.socket.on(LEON_EVENTS.answer, (data) => {
/*if (this._isVoiceModeEnabled) {
this.voiceEnergy.status = 'listening'
}*/
@@ -307,7 +325,7 @@ export default class Client {
void this.sessionPanel?.refresh()
})
this.socket.on('suggest', (data) => {
this.socket.on(LEON_EVENTS.suggest, (data) => {
setTimeout(() => {
handleSuggestions(data, this.chatbot, this)
}, 400)
@@ -319,11 +337,11 @@ export default class Client {
})*/
})
this.socket.on('is-typing', (data) => {
this.socket.on(LEON_EVENTS.isTyping, (data) => {
this.chatbot.isTyping('leon', data)
})
this.socket.on('owner-utterance', (data) => {
this.socket.on(LEON_EVENTS.ownerUtterance, (data) => {
if (!data?.utterance) {
return
}
@@ -352,7 +370,7 @@ export default class Client {
this.updateMood(mood)
})
this.socket.on('llm-token', (data) => {
this.socket.on(LEON_EVENTS.llmToken, (data) => {
if (this._isVoiceModeEnabled) {
this.voiceEnergy.status = 'processing'
}
@@ -394,7 +412,7 @@ export default class Client {
this.chatbot.scrollDown()
})
this.socket.on('llm-reasoning-token', (data) => {
this.socket.on(LEON_EVENTS.llmReasoningToken, (data) => {
if (!data?.generationId || !data?.token) {
return
}
@@ -522,6 +540,10 @@ export default class Client {
cb('audio-received')
})
this.socket.on(LEON_EVENTS.error, (data) => {
console.error('Leon client interface error:', data)
})
if (this.history !== null) {
this.parsedHistory = JSON.parse(this.history)
}
@@ -549,8 +571,7 @@ export default class Client {
const sentAt =
typeof options.sentAt === 'number' ? options.sentAt : Date.now()
this.socket.emit('utterance', {
client: this.client,
this.socket.emit(LEON_EVENTS.utterance, {
value: trimmedValue,
sentAt,
sessionId: this.activeSessionId,
+67 -1
View File
@@ -13,6 +13,15 @@ import {
} from '../server/src/leon-roots.ts'
const APP_DEV_SERVER_PORT = 5_173
const NODE_MODULES_PATH_SEGMENT = '/node_modules/'
const REACT_VENDOR_PACKAGES = ['react', 'react-dom', 'scheduler']
const REALTIME_VENDOR_PACKAGES = [
'socket.io-client',
'socket.io-parser',
'engine.io-client',
'engine.io-parser'
]
const UI_VENDOR_PACKAGE_PREFIXES = ['@ark-ui/', '@zag-js/', '@floating-ui/']
dotenv.config({ path: PROFILE_DOT_ENV_PATH })
@@ -42,6 +51,26 @@ function readAppLeonConfig() {
}
}
function normalizeModuleId(moduleId) {
return moduleId.replaceAll('\\', '/')
}
function isNodeModule(moduleId) {
return normalizeModuleId(moduleId).includes(NODE_MODULES_PATH_SEGMENT)
}
function includesVendorPackage(moduleId, packageName) {
return normalizeModuleId(moduleId).includes(
`${NODE_MODULES_PATH_SEGMENT}${packageName}/`
)
}
function includesVendorPackagePrefix(moduleId, packagePrefix) {
return normalizeModuleId(moduleId).includes(
`${NODE_MODULES_PATH_SEGMENT}${packagePrefix}`
)
}
// Map necessary Leon's env vars as Vite only expose VITE_*
const leonConfig = readAppLeonConfig()
process.env.VITE_LEON_NODE_ENV = process.env.LEON_NODE_ENV
@@ -68,7 +97,44 @@ export default defineConfig({
},
build: {
outDir: '../dist',
emptyOutDir: true
emptyOutDir: true,
rolldownOptions: {
output: {
codeSplitting: {
groups: [
{
name: 'react-vendor',
test: (moduleId) =>
REACT_VENDOR_PACKAGES.some((packageName) =>
includesVendorPackage(moduleId, packageName)
),
priority: 30
},
{
name: 'realtime-vendor',
test: (moduleId) =>
REALTIME_VENDOR_PACKAGES.some((packageName) =>
includesVendorPackage(moduleId, packageName)
),
priority: 20
},
{
name: 'ui-vendor',
test: (moduleId) =>
UI_VENDOR_PACKAGE_PREFIXES.some((packagePrefix) =>
includesVendorPackagePrefix(moduleId, packagePrefix)
),
priority: 10
},
{
name: 'vendor',
test: isNodeModule,
priority: 0
}
]
}
}
}
},
server: {
port: APP_DEV_SERVER_PORT
+1 -1
View File
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-button
position: relative
+1 -1
View File
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-card
position: relative
+1 -1
View File
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-checkbox
display: flex
+1 -1
View File
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-flexbox
position: relative
+1 -1
View File
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-form
position: relative
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-icon-button
position: relative
+1 -1
View File
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-icon
position: relative
+1 -1
View File
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-image
position: relative
+1 -1
View File
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-input-container
--a-icon-container-width: calc(var(--a-input-size-md) + var(--a-space-sm))
+1 -1
View File
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-link
display: inline-block
+1 -1
View File
@@ -1,4 +1,4 @@
@import '../../../styles/main.sass'
@use '../../../styles/main.sass' as *
.aurora-list
position: relative
+1 -1
View File
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-loader
width: var(--a-loader-size-md)
+1 -1
View File
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-progress
position: relative
@@ -1,4 +1,4 @@
@import '../../../styles/main.sass'
@use '../../../styles/main.sass' as *
.aurora-radio-group
&[data-disabled]
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-range-slider
--a-track-height: 10px
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-scroll-container
position: relative
@@ -1,4 +1,4 @@
@import '../../../styles/main.sass'
@use '../../../styles/main.sass' as *
.aurora-select-trigger
position: relative
@@ -75,4 +75,3 @@
color: var(--a-color-text)
&:last-child
border-bottom: none
+1 -2
View File
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-status
position: relative
@@ -61,4 +61,3 @@
border-color: var(--a-color-transparent-red-hover)
.aurora-icon
color: var(--a-color-red)
+1 -1
View File
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-switch
--a-switch-width: 44px
@@ -1,4 +1,4 @@
@import '../../../styles/main.sass'
@use '../../../styles/main.sass' as *
.aurora-tab-group
.aurora-tab
+1 -1
View File
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-text
font-size: var(--a-font-size-md)
@@ -1,4 +1,4 @@
@import '../../styles/main.sass'
@use '../../styles/main.sass' as *
.aurora-widget-wrapper
position: relative
+3 -3
View File
@@ -1,6 +1,6 @@
@import '_includes/reset'
@import '_includes/variables'
@import '_includes/animations'
@use '_includes/reset' as *
@use '_includes/variables' as *
@use '_includes/animations' as *
[class^="aurora-"], [class^="aurora-"]:after, [class^="aurora-"]:before
scroll-behavior: smooth
+40 -8
View File
@@ -17,8 +17,8 @@ llm:
# Use null to leave the global LLM target unset.
# Set to "<provider>/<model>" to use a provider/model pair.
# Examples:
# default: openai/gpt-5.5
# default: openrouter/z-ai/glm-5-turbo
# default: openai/gpt-5.6-sol
# default: openrouter/z-ai/glm-5.2
# default: llamacpp/Qwen3.6-35B-A3B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf
# default: sglang/Qwen3.6-35B-A3B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf
# default: /absolute/path/model.gguf
@@ -45,6 +45,10 @@ llm:
api_key:
# The value is read from LEON_ZAI_API_KEY in your profile .env file.
env: LEON_ZAI_API_KEY
minimax:
api_key:
# The value is read from LEON_MINIMAX_API_KEY in your profile .env file.
env: LEON_MINIMAX_API_KEY
openai:
api_key:
# The value is read from LEON_OPENAI_API_KEY in your profile .env file.
@@ -114,9 +118,37 @@ time_zone: null
after_speech_enabled: false
telemetry_enabled: true
http:
enabled: true
lang: en-US
api_key:
# The value is read from LEON_HTTP_API_KEY in your profile .env file.
env: LEON_HTTP_API_KEY
client_interface:
# Extra origins allowed to connect to Leon from browser-like clients.
# Same-origin clients and the built-in web app dev server are allowed automatically.
# Examples:
# - http://localhost:1420 # Tauri dev server
# - http://localhost:5173 # Vite/Electron dev server
# - https://desktop.example.com # Remote browser-like client
allowed_origins: []
auth:
# Enable this when exposing Leon to clients outside your local machine.
enabled: false
token:
# The value is read from LEON_CLIENT_INTERFACE_TOKEN in your profile .env file.
env: LEON_CLIENT_INTERFACE_TOKEN
http_plugins:
# Enable this to let HTTP plugins expose integration-specific routes.
enabled: false
# Root routes are disabled unless both this global
# flag and the individual plugin root_routes flag are true.
allow_root_routes: false
auth:
# Enable this when exposing HTTP plugins beyond trusted local development.
enabled: false
token:
# The value is read from LEON_HTTP_PLUGIN_TOKEN in your profile .env file.
env: LEON_HTTP_PLUGIN_TOKEN
plugins:
# External plugins are discovered from:
# ~/.leon/http-plugins/<plugin-id>/
# ~/.leon/profiles/<profile-id>/http-plugins/<plugin-id>/
# example_my_plugin:
# enabled: false
# root_routes: false
+6 -1
View File
@@ -1,6 +1,6 @@
> Brain and routing, tool execution, context intelligence, memory layers, reliability loops. Leon-native skills are layered as Skills -> Actions -> Tools -> Functions (-> Binaries).
# ARCHITECTURE
- Generated at: 2026-05-11T22:31:48+08:00
- Generated at: 2026-06-23T23:22:03+08:00
- Leon-native layer model: `Skills -> Actions -> Tools -> Functions (-> Binaries)`.
- Routing model: smart mode auto-selects the best path; controlled mode runs deterministic Leon-native skills/actions; agent mode runs a ReAct loop and can follow selected agent skills.
- Core runtime: `core/brain/brain.ts`, `llm-duties/react-llm-duty.ts`, `toolkit-registry.ts`, `tool-executor.ts`.
@@ -8,6 +8,11 @@
- Explicit tools over implicit behavior: I call declared tools/functions instead of free-form shell logic whenever possible.
- Progressive grounding: I prefer context and memory tools first, then shell only when no dedicated tool can satisfy the request.
- Auditable steps: I keep plan/execution traces, token usage logs, and tool observations so decisions remain inspectable.
## Client Interfaces
- Leon exposes a client-agnostic Socket.IO interface so built-in and custom clients can connect through the same live dialogue contract.
- HTTP APIs remain request/response support surfaces; live owner utterances should use the Socket.IO client interface.
- External HTTP plugins can extend Leon's HTTP contract without patching the core API for each integration.
- Custom clients can read profile-owned extension JSON files through a generic redacted HTTP endpoint, covering skill memory, skill settings, and tool settings without exposing secrets.
## ReAct Loop
- Planning phase chooses either a direct answer, an ordered tool plan, or a relevant agent skill workflow.
- Tool state is separated: installed tools exist in the registry, enabled tools are not disabled by the owner, and available tools have the required settings to run.
-4
View File
@@ -1,4 +0,0 @@
.next
.source
node_modules
out
-20
View File
@@ -1,20 +0,0 @@
# Leon Docs
This folder contains the Leon 2.0 documentation app.
## Development
```sh
pnpm --dir docs install
pnpm run dev:docs
```
The docs app uses Fumadocs, MDX, and Next.js.
## LLM Files
The app exposes:
- `/llms.txt`
- `/llms-full.txt`
- per-page Markdown-oriented output through `*.mdx` routes
-59
View File
@@ -1,59 +0,0 @@
import defaultMdxComponents from 'fumadocs-ui/mdx'
import {
DocsBody,
DocsDescription,
DocsPage,
DocsTitle
} from 'fumadocs-ui/layouts/docs/page'
import type { Metadata } from 'next'
import { notFound } from 'next/navigation'
import type { ReactNode } from 'react'
import { source } from '@/lib/source'
interface PageProps {
params: Promise<{
slug?: string[]
}>
}
export default async function Page({ params }: PageProps): Promise<ReactNode> {
const { slug = [] } = await params
const page = source.getPage(slug)
if (!page) {
notFound()
}
const MDX = page.data.body
return (
<DocsPage toc={page.data.toc}>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
<MDX components={defaultMdxComponents} />
</DocsBody>
</DocsPage>
)
}
export function generateStaticParams(): Array<{ slug?: string[] }> {
return source.generateParams()
}
export async function generateMetadata({
params
}: PageProps): Promise<Metadata> {
const { slug = [] } = await params
const page = source.getPage(slug)
if (!page) {
notFound()
}
return {
title: page.data.title,
description: page.data.description
}
}
-43
View File
@@ -1,43 +0,0 @@
import { DocsLayout } from 'fumadocs-ui/layouts/docs'
import { BookOpen, Code2, Map } from 'lucide-react'
import type { ReactNode } from 'react'
import { source } from '@/lib/source'
export default function Layout({
children
}: {
children: ReactNode
}): ReactNode {
return (
<DocsLayout
tree={source.getPageTree()}
nav={{
title: (
<span className="font-semibold">
Leon <span className="text-fd-muted-foreground">Docs</span>
</span>
)
}}
links={[
{
text: 'GitHub',
url: 'https://github.com/leon-ai/leon',
icon: <Code2 />
},
{
text: 'Roadmap',
url: '/docs/roadmap/priorities',
icon: <Map />
},
{
text: 'Blog',
url: 'https://blog.getleon.ai',
icon: <BookOpen />
}
]}
>
{children}
</DocsLayout>
)
}
-95
View File
@@ -1,95 +0,0 @@
@import 'tailwindcss';
@import 'fumadocs-ui/css/preset.css';
:root {
--leon-black: #000;
--leon-ink: #11101d;
--leon-blue: #1c75db;
--leon-pink: #ed297a;
--leon-green: #1cdba2;
--leon-slate: #45515e;
--leon-muted: #9ea7b0;
--leon-border-light: #d1dce5;
--leon-accent: var(--leon-blue);
--leon-status-background: rgba(28, 117, 219, 0.08);
--leon-status-foreground: #0f3765;
--leon-page-background:
radial-gradient(circle at 50% 0%, rgba(28, 117, 219, 0.1), transparent 30rem),
#ffffff;
--color-fd-background: #ffffff;
--color-fd-foreground: var(--leon-ink);
--color-fd-muted: #f4f7fb;
--color-fd-muted-foreground: var(--leon-slate);
--color-fd-popover: #ffffff;
--color-fd-popover-foreground: var(--leon-ink);
--color-fd-card: #ffffff;
--color-fd-card-foreground: var(--leon-ink);
--color-fd-border: rgba(17, 16, 29, 0.14);
--color-fd-primary: var(--leon-blue);
--color-fd-primary-foreground: #ffffff;
--color-fd-secondary: #eef4fb;
--color-fd-secondary-foreground: var(--leon-ink);
--color-fd-accent: rgba(28, 117, 219, 0.1);
--color-fd-accent-foreground: #0f3765;
--color-fd-ring: rgba(28, 117, 219, 0.7);
--color-fd-overlay: rgba(0, 0, 0, 0.5);
}
.dark {
--leon-accent: var(--leon-green);
--leon-status-background: rgba(28, 219, 162, 0.1);
--leon-status-foreground: #d9fff4;
--leon-page-background:
radial-gradient(circle at 42% 0%, rgba(28, 117, 219, 0.16), transparent 32rem),
radial-gradient(circle at 72% 8%, rgba(237, 41, 122, 0.11), transparent 24rem),
#000000;
--color-fd-background: #000000;
--color-fd-foreground: #f9fafc;
--color-fd-muted: var(--leon-ink);
--color-fd-muted-foreground: var(--leon-muted);
--color-fd-popover: #080812;
--color-fd-popover-foreground: #f9fafc;
--color-fd-card: #0b0b15;
--color-fd-card-foreground: #fafafa;
--color-fd-border: hsla(0, 0%, 100%, 0.1);
--color-fd-primary: var(--leon-blue);
--color-fd-primary-foreground: #ffffff;
--color-fd-secondary: #11101d;
--color-fd-secondary-foreground: #f9fafc;
--color-fd-accent: rgba(237, 41, 122, 0.16);
--color-fd-accent-foreground: #ffffff;
--color-fd-ring: rgba(237, 41, 122, 0.72);
--color-fd-overlay: rgba(0, 0, 0, 0.9);
}
html {
background: var(--color-fd-background);
}
body {
background: var(--leon-page-background);
font-feature-settings: 'kern';
font-family: 'Source Sans Pro', ui-sans-serif, system-ui, sans-serif;
}
.leon-status {
align-items: center;
background: var(--leon-status-background);
border: 1px solid var(--color-fd-border);
border-radius: 999px;
color: var(--leon-status-foreground);
display: inline-flex;
font-size: 0.75rem;
font-weight: 600;
gap: 0.375rem;
line-height: 1;
padding: 0.375rem 0.625rem;
}
.leon-status::before {
background: var(--leon-accent);
border-radius: 999px;
content: '';
height: 0.5rem;
width: 0.5rem;
}
-37
View File
@@ -1,37 +0,0 @@
import 'fumadocs-ui/style.css'
import './global.css'
import { RootProvider } from 'fumadocs-ui/provider/next'
import type { Metadata } from 'next'
import type { ReactNode } from 'react'
export const metadata: Metadata = {
title: {
default: 'Leon Docs',
template: '%s | Leon Docs'
},
description:
'Documentation for Leon 2.0, the open-source personal AI assistant built around tools, memory, context, and owner control.'
}
export default function RootLayout({
children
}: {
children: ReactNode
}): ReactNode {
return (
<html lang="en" suppressHydrationWarning>
<body>
<RootProvider
theme={{
attribute: 'class',
defaultTheme: 'dark',
enableSystem: false
}}
>
{children}
</RootProvider>
</body>
</html>
)
}
-14
View File
@@ -1,14 +0,0 @@
import { getLLMText } from '@/lib/get-llm-text'
import { source } from '@/lib/source'
export const revalidate = false
export async function GET(): Promise<Response> {
const pages = await Promise.all(source.getPages().map(getLLMText))
return new Response(pages.join('\n\n'), {
headers: {
'Content-Type': 'text/plain; charset=utf-8'
}
})
}
@@ -1,34 +0,0 @@
import { notFound } from 'next/navigation'
import { getLLMText } from '@/lib/get-llm-text'
import { source } from '@/lib/source'
interface RouteProps {
params: Promise<{
slug?: string[]
}>
}
export const revalidate = false
export async function GET(
_request: Request,
{ params }: RouteProps
): Promise<Response> {
const { slug = [] } = await params
const page = source.getPage(slug)
if (!page) {
notFound()
}
return new Response(await getLLMText(page), {
headers: {
'Content-Type': 'text/markdown; charset=utf-8'
}
})
}
export function generateStaticParams(): Array<{ slug?: string[] }> {
return source.generateParams()
}
-13
View File
@@ -1,13 +0,0 @@
import { llms } from 'fumadocs-core/source'
import { source } from '@/lib/source'
export const revalidate = false
export function GET(): Response {
return new Response(llms(source).index(), {
headers: {
'Content-Type': 'text/plain; charset=utf-8'
}
})
}
-5
View File
@@ -1,5 +0,0 @@
import { redirect } from 'next/navigation'
export default function HomePage(): never {
redirect('/docs')
}
@@ -1,33 +0,0 @@
---
title: Bridge SDKs
description: Build tool and skill logic through Node.js and Python bridges.
---
# Bridge SDKs
Leon supports bridge runtimes so capability logic can run outside the core server.
This is important because not every capability should live directly in the server process.
The current bridge areas are:
```txt
bridges/nodejs
bridges/python
```
## Node.js Bridge
Use the Node.js bridge when the tool or skill logic fits naturally in TypeScript or JavaScript.
The SDK provides helpers for settings, network access, memory, widgets, tool reporting, and toolkit configuration.
## Python Bridge
Use the Python bridge when the capability depends on Python libraries, ML tooling, media processing, or existing Python code.
## Rule Of Thumb
Use the language that keeps the implementation smaller and easier to maintain.
Do not move logic into a bridge just to make it feel more advanced. Bridge code should exist because it makes the capability clearer or more practical.
@@ -1,50 +0,0 @@
---
title: Create A Skill
description: Add owner-facing behavior to Leon.
---
# Create A Skill
Skills are owner-facing capabilities.
Use a skill when you are adding something Leon should understand as a meaningful capability.
For example: a timer, weather forecast, todo list, game, or guided workflow.
## Native Skills
Native skills live under:
```txt
skills/native
```
They define a `skill.json` manifest, localized data, actions, and optional bridge-backed logic.
This is the controlled path. It is useful when the behavior should be predictable.
## Agent Skills
Agent skills live under:
```txt
skills/agent
```
They use `SKILL.md` instructions to guide agentic workflows.
This is useful when the skill is more about a process than a single deterministic action.
## Skill Design
A good skill should define:
- what the owner can ask
- what action should run
- which parameters are required
- what answer Leon should return
- whether logic is needed
Keep the first version narrow.
A small useful skill is better than a broad skill that is hard to maintain. We can always improve it later.
@@ -1,52 +0,0 @@
---
title: Create A Tool
description: Add callable functions Leon can use during execution.
---
# Create A Tool
Tools let Leon do real work.
Use a tool when agent mode needs a declared capability it can call through a schema.
In other words, if Leon needs to execute something reliably, it probably belongs behind a tool.
## Tool Location
Tools live under toolkit folders in:
```txt
tools
```
Each tool belongs to a toolkit and includes a `tool.json` manifest.
## Manifest
A tool manifest describes:
- stable tool ID
- toolkit ID
- name and description
- author metadata
- callable functions
- function parameter schemas
- optional output schemas
- optional binaries and resources
- optional hooks
## Function Design
Good tool functions are specific.
They should accept clear arguments, validate input, return structured output, and avoid hiding multiple unrelated behaviors behind one vague function.
If a function does too many things, it becomes harder for the model to call correctly.
## Hooks
Hooks can shape tool output after execution.
For example, a post-execution hook can extract only the part of a large JSON result that the model needs.
This keeps agent prompts leaner and more useful.
@@ -1,35 +0,0 @@
---
title: Build With Leon
description: Extend Leon with skills, tools, bridges, and widgets.
---
# Build With Leon
Leon is meant to be extended.
This has been one of the main strengths of Leon since day one.
The core gives contributors a place to add capabilities without turning every idea into a one-off project.
## Extension Paths
Start by asking what kind of capability you want to build:
- create a skill when the owner-facing behavior is the main unit
- create a tool when Leon needs a callable capability for agentic work
- create a widget when the result needs a richer UI
- use a bridge SDK when logic needs to run in Node.js or Python
## Keep It Grounded
Good Leon extensions are:
- clear
- small enough to inspect
- schema-guided
- easy to test
- respectful of owner control
Prefer existing helpers and SDK utilities before adding new abstractions.
Keep the first version small. Once it works well, then we can grow it.
@@ -1,11 +0,0 @@
{
"title": "Build With Leon",
"pages": [
"index",
"create-a-skill",
"create-a-tool",
"bridge-sdks",
"widgets",
"testing"
]
}
@@ -1,34 +0,0 @@
---
title: Testing
description: Validate Leon changes with focused tests and linting.
---
# Testing
Every meaningful change should be validated.
Use the smallest test scope that gives confidence, then expand when the change touches shared behavior.
This keeps feedback fast without ignoring risk.
## Common Commands
```sh
pnpm run lint
pnpm test
pnpm test:agent:unit
pnpm test:controlled:unit
pnpm test:controlled:e2e
```
For agent end-to-end tests, use the OpenAI provider unless a broader provider run is explicitly needed:
```sh
pnpm test:agent:e2e -- -t openai
```
## Testing Mindset
Test behavior, not implementation details.
For skills and tools, focus on routing, required parameters, schema behavior, successful execution, and clear failure handling.
@@ -1,35 +0,0 @@
---
title: Widgets
description: Present richer results in Leon's interface.
---
# Widgets
Widgets let Leon show richer results than plain text.
Use a widget when the owner needs to inspect, compare, control, or continue interacting with structured output.
Not every answer needs a widget. Sometimes text is better.
## Examples
Widgets can be useful for:
- timers
- media results
- tool progress
- generated summaries
- task status
- settings flows
## Aurora
Aurora is Leon's UI component area.
When a capability needs a custom visual surface, look at the existing Aurora components and preview environment before creating new UI patterns.
## Design Principle
Widgets should make action clearer.
They should not decorate simple answers that would work better as text.
-4
View File
@@ -1,4 +0,0 @@
{
"title": "Contribute",
"pages": ["overview", "workflow", "style"]
}
-32
View File
@@ -1,32 +0,0 @@
---
title: Contribute
description: How to approach contributing to Leon.
---
# Contribute
Leon is opening a new chapter around the 2.0 developer preview.
The project values useful work, clear thinking, respect, and craft.
Contributions should help the owner journey, improve reliability, or make the system easier to understand and extend.
We will build Leon together, but we should do it properly.
## Good First Areas
Good contribution areas include:
- documentation
- setup experience
- tests
- focused skill improvements
- focused tool improvements
- provider stability
- small UI fixes
## Before You Build
Understand the existing pattern first.
Leon has helpers, schemas, SDK utilities, and conventions. Use those before adding new abstractions.
-38
View File
@@ -1,38 +0,0 @@
---
title: Style
description: How Leon documentation and code should feel.
---
# Style
Leon should feel clear, practical, and human.
That applies to docs and code.
## Documentation
Docs should be:
- straight to the point
- warm without being vague
- honest about status
- focused on the owner journey
- specific enough to act on
Avoid inflated AI language.
Explain what Leon does, what is ready, and what is still being shaped.
## Code
Code should be:
- simple
- efficient
- typed
- tested where risk justifies it
- consistent with existing helpers and SDK utilities
Prefer a small clear implementation over a large abstraction that may not survive the next architecture change.
Simple does not mean lazy. Simple means easier to reason about.
-50
View File
@@ -1,50 +0,0 @@
---
title: Workflow
description: The basic development workflow for Leon contributions.
---
# Workflow
Here is the basic development flow.
## Install
```sh
pnpm install
```
## Check
```sh
pnpm run check
```
## Develop
```sh
pnpm run dev:server
pnpm run dev:app
```
## Validate
```sh
pnpm run lint
pnpm test
```
Use narrower tests when the change is focused, then broaden when the change touches shared behavior.
## Commit Format
Commit messages are validated by `scripts/commit-msg.js`.
Examples:
```txt
docs: add 2.0 docs foundation
fix(server): handle missing tool output
feat(skill/timer_skill): improve timer follow-up
```
Keep the message short and clear. The hook will tell you if the format is wrong.
-52
View File
@@ -1,52 +0,0 @@
---
title: Leon 2.0
description: Start here to understand, run, use, and build with Leon.
---
# Leon 2.0
Hey all, welcome to the Leon 2.0 docs.
Leon is your open-source personal AI assistant.
I started to work on Leon in 2017. The first beta was released in February 2019. Since then, the idea has not really changed: allow people to have their own personal AI assistant.
Not just a chatbot. Not just a wrapper around an API. A real assistant you can run, inspect, extend, and make yours.
## Start With The Journey
If you are discovering Leon, I would start here:
- [What is Leon?](/docs/welcome/what-is-leon)
- [Philosophy](/docs/welcome/philosophy)
- [Quick Start](/docs/use-leon/quick-start)
- [Core Ideas](/docs/welcome/core-ideas)
If you want to build things with Leon:
- [Build With Leon](/docs/build-with-leon)
- [Create a Skill](/docs/build-with-leon/create-a-skill)
- [Create a Tool](/docs/build-with-leon/create-a-tool)
If you want to understand what is happening under the hood:
- [Architecture](/docs/understand-leon/architecture)
- [Modes](/docs/understand-leon/modes)
- [Memory System](/docs/understand-leon/memory-system)
- [Context System](/docs/understand-leon/context-system)
## Current Status
<span className="leon-status">Developer Preview</span>
Leon 2.0 is on the way to a developer preview.
Some parts are already here. Some parts are still moving. That is okay. The purpose of these docs is to make the current direction clear, so you can follow what exists today and what is coming next.
## AI-Friendly Docs
As Leon is itself becoming more agentic, these docs also expose machine-readable versions:
- [`/llms.txt`](/llms.txt): index of documentation pages
- [`/llms-full.txt`](/llms-full.txt): complete docs content in one text file
- `*.mdx`: append `.mdx` to a docs page URL to fetch its Markdown-oriented content
-13
View File
@@ -1,13 +0,0 @@
{
"title": "Leon Docs",
"pages": [
"index",
"welcome",
"use-leon",
"understand-leon",
"build-with-leon",
"reference",
"roadmap",
"contribute"
]
}
@@ -1,38 +0,0 @@
---
title: Configuration
description: Where Leon configuration lives and how to approach it.
---
# Configuration
Leon configuration is split across environment files, generated profile files, tool settings, and sample config files.
There are several places because Leon has several layers. It may look like a lot at first, but each area has a purpose.
## Start Here
Run:
```sh
pnpm run check
```
This is the safest first command because it inspects the current setup and reports what needs attention.
## Common Areas
Important configuration areas include:
- `.env`
- `.env.sample`
- `core/config`
- profile-specific tool settings
- provider keys
- voice provider settings
- local AI setup files
## Principle
Configuration should stay explicit.
If a capability needs credentials, permissions, or local resources, the owner should be able to see where that setup lives.
@@ -1,39 +0,0 @@
---
title: Directory Structure
description: A quick map of the Leon repository.
---
# Directory Structure
Here is a quick map of the repository.
```txt
app/ Web application
aurora/ UI components and preview environment
bridges/ Node.js and Python bridge runtimes
core/ Shared core data and generated context
docs/ Leon 2.0 documentation
scripts/ Setup, build, release, lint, and generation scripts
server/ Main runtime and API
skills/ Native and agent skills
tcp_server/ Python TCP services
tools/ Toolkits and tools
```
## Where To Start
If you are learning the runtime, start with:
```txt
core/context/LEON.md
core/context/ARCHITECTURE.md
server/src/core
server/src/schemas
skills
tools
bridges
```
The context files summarize the current architecture and identity of Leon.
Then follow the code from there. It is usually easier than starting from a random file.
-10
View File
@@ -1,10 +0,0 @@
{
"title": "Reference",
"pages": [
"configuration",
"scripts",
"schemas",
"providers",
"directory-structure"
]
}
-36
View File
@@ -1,36 +0,0 @@
---
title: Providers
description: AI provider areas Leon can integrate with.
---
# Providers
Leon can use different model providers depending on the owner's setup and task.
This is good, but it also means we need to be careful. Providers do not all behave the same way.
## Provider Areas
Current provider work includes:
- OpenAI
- OpenRouter
- Anthropic
- llama.cpp
- OpenAI-compatible APIs
- other provider integrations as the project evolves
## Provider Differences
Providers can differ in subtle ways:
- reasoning settings
- tool calling behavior
- model naming
- streaming behavior
- compatibility details
- feature availability
Leon handles these differences in the provider layer so the rest of the agent loop can stay more stable.
This layer will keep evolving as providers and models evolve too.
-38
View File
@@ -1,38 +0,0 @@
---
title: Schemas
description: JSON schema areas used by Leon.
---
# Schemas
Leon uses schemas to keep extension points explicit.
This is one of the things that makes the project easier to grow without losing control.
The main schema files live under:
```txt
server/src/schemas
```
## Current Areas
Important schema areas include:
- skill manifests
- tool manifests
- toolkit manifests
- global data
- voice configuration
## Why Schemas Matter
Schemas make Leon easier to extend safely.
They help validate manifests, guide tool calls, reduce malformed execution, and make docs generation possible in the future.
## Documentation Direction
Reference pages for manifests should eventually be generated or derived from these schemas so the docs stay synchronized with the runtime.
That way, we avoid writing docs that slowly drift away from the code.
-47
View File
@@ -1,47 +0,0 @@
---
title: Scripts
description: Common pnpm scripts in the Leon repository.
---
# Scripts
The root `package.json` contains the main project scripts.
Most of the time, you should use these scripts instead of calling internals directly.
## Daily Development
```sh
pnpm run dev:server
pnpm run dev:app
pnpm run check
pnpm run lint
```
## Build And Start
```sh
pnpm run build
pnpm start
```
## Tests
```sh
pnpm test
pnpm test:agent:unit
pnpm test:controlled:unit
pnpm test:controlled:e2e
```
## Generation
```sh
pnpm run generate:http-api-key
pnpm run generate:json-schemas
pnpm run generate:prompt
```
Use scripts instead of reaching into internals directly when a script already exists.
It keeps the development workflow more stable for everyone.
@@ -1,40 +0,0 @@
---
title: Developer Preview Status
description: What the 2.0 developer preview means.
---
# Developer Preview Status
<span className="leon-status">Developer Preview</span>
The 2.0 developer preview is for people who want to explore, test, and help shape Leon's new core.
It is not meant to feel like a polished consumer release yet.
So please keep this in mind while trying it. Things will move.
## What To Expect
Expect:
- active changes
- incomplete documentation in some areas
- experimental features
- provider differences
- rough edges in setup
- fast iteration around the agentic core
## What Should Work
The developer preview should make it possible to:
- install from source
- run Leon locally
- inspect the architecture
- test core flows
- build simple skills and tools
- understand where contributions fit
## What Comes Later
More polished onboarding, desktop packaging, messaging apps, and broader non-technical owner flows come later.
-4
View File
@@ -1,4 +0,0 @@
{
"title": "Roadmap",
"pages": ["priorities", "developer-preview-status", "release-notes"]
}
-46
View File
@@ -1,46 +0,0 @@
---
title: Priorities
description: The current top priorities for Leon.
---
# Priorities
<span className="leon-status">Living page</span>
Last updated: May 2026
This page is the high-level roadmap space for Leon.
It should stay short, honest, and regularly updated.
GitHub issues can track execution details. This page is here to explain what matters most right now and why.
## 1. Developer Preview Readiness
Leon 2.0 needs a clear, reliable developer preview.
That means the core should be runnable, documented, and understandable enough for early contributors to explore without needing private context.
## 2. New Documentation
The docs need to explain Leon from the owner journey first, then the architecture.
The immediate goal is to make installation, core concepts, extension points, and contribution paths clear.
## 3. Agentic Reliability
The agent loop needs to stay grounded.
Important work includes provider stability, tool execution quality, schema-guided calls, recovery behavior, and better observations.
## 4. Local Ownership
Leon should keep improving local model support, local context, privacy-aware setup, and clear owner permissions.
This is central to the mission.
## 5. Desktop And Messaging Foundations
The desktop app and messaging app integrations are not ready yet, but they are important parts of the future owner journey.
They should make Leon easier to access without weakening local control.
@@ -1,25 +0,0 @@
---
title: Release Notes
description: A future home for notable Leon 2.0 updates.
---
# Release Notes
<span className="leon-status">Coming soon</span>
This page will collect notable Leon 2.0 updates once the developer preview cadence is active.
The goal is simple: help people follow the project without reading every commit.
## Planned Format
Each update should be short:
- what changed
- why it matters
- migration notes if needed
- links to pull requests or issues
## Principle
Release notes should be useful, not noisy.
@@ -1,42 +0,0 @@
---
title: Agent Loop
description: How Leon plans, executes, observes, recovers, and answers.
---
# Agent Loop
Agent mode uses a ReAct-style loop.
The loop lets Leon plan a task, call tools, observe results, recover from failures, and produce a final answer.
This is where Leon starts to feel much more capable than a classic intent classifier.
## Planning
Leon decides whether he can answer directly or needs a tool plan.
The plan should use short, understandable step labels so execution remains inspectable.
## Execution
Leon resolves function arguments, validates schemas, runs tools, and captures structured observations.
Tool calls should not depend on vague model output when a schema can make the call explicit.
## Pause And Resume
If a required input is missing, Leon can ask a clarification question and resume the same step after the owner replies.
This avoids restarting the whole task when only one missing value is needed.
## Recovery
When a step fails, Leon should replan from the failure state while preserving useful progress.
The goal is not to retry blindly. The goal is to recover with context.
## Final Answer
The final answer should be based on observed results, not imagined execution.
This point is not optional. If Leon says something was done, it should come from what actually happened.
@@ -1,43 +0,0 @@
---
title: Architecture
description: A high-level map of Leon 2.0.
---
# Architecture
Lets take a look at the big picture.
Leon 2.0 is organized around a layered execution model:
```txt
Skills -> Actions -> Tools -> Functions (-> Binaries)
```
This model keeps Leon extensible while still making behavior inspectable.
It may look a bit formal at first, but it is actually very practical. Each layer has a purpose and gives contributors a clear place to build.
## Main Areas
The current repository is organized around these main areas:
- `server/`: runtime, routing, memory, context, HTTP API, execution
- `app/`: web application
- `aurora/`: UI components and preview environment
- `skills/`: native and agent skills
- `tools/`: toolkits and tool manifests
- `bridges/`: Node.js and Python bridge runtimes
- `tcp_server/`: Python services used by the runtime stack
- `core/context/`: generated identity and architecture context
## Runtime Shape
At runtime, Leon receives an utterance, chooses a route, executes work through skills or tools, observes results, and returns an answer.
The more dynamic the task, the more important schemas, tool observations, and recovery loops become.
## Principle
Leon should prefer explicit capabilities over hidden behavior.
That makes the assistant easier to debug, safer to extend, and more honest about what it did.
@@ -1,41 +0,0 @@
---
title: Context System
description: How Leon uses environment context without overloading prompts.
---
# Context System
Context is live or generated knowledge about Leon's environment.
It helps Leon stay grounded in the owner's real setup.
For us humans, context is natural. We constantly use it. For Leon, we need to make it explicit.
## Context Files
Leon can maintain context files for areas such as:
- system
- activity
- browser
- network
- workspace
- habits
- inventory
- media
- architecture
- identity
## Context Before Memory
For runtime and environment questions, context should be checked before memory.
Memory answers what happened or what the owner prefers.
Context answers what is true about the current environment.
## Progressive Grounding
Leon should load only relevant context.
This keeps prompts efficient and reduces the risk of stale or unrelated details influencing the answer.
@@ -1,38 +0,0 @@
---
title: Memory System
description: The layered memory model behind Leon.
---
# Memory System
Leon's memory system is built for continuity.
The more you work with Leon, the more he should understand useful facts, preferences, and prior context.
But memory needs structure. Otherwise it becomes a messy pile of text and nobody wants that.
## Layers
Leon separates memory into:
- persistent memory
- daily memory
- discussion memory
Leon also maintains an owner profile document that acts as a curated summary, separate from raw memory.
## Retrieval
Memory retrieval uses indexed search so Leon can look up relevant history instead of guessing.
When the first result looks weak, the system can run adaptive rescue passes to improve recall.
## Maintenance
Memory should stay useful over time.
Older short-term memory can be compacted or pruned, while durable facts remain available through persistent memory.
## Design Goal
Memory should make Leon feel continuous without making every prompt heavy, noisy, or unsafe.
@@ -1,12 +0,0 @@
{
"title": "Understand Leon",
"pages": [
"architecture",
"modes",
"skills-and-tools",
"agent-loop",
"memory-system",
"context-system",
"proactivity"
]
}
@@ -1,38 +0,0 @@
---
title: Modes
description: How Leon chooses between smart, controlled, and agent execution.
---
# Modes
Leon can run requests through different modes.
This exists because not every request needs the same kind of intelligence.
Sometimes Leon just needs to answer. Sometimes he should run a deterministic skill. Sometimes he needs to plan and use tools step by step.
## Smart
`smart` is the default mode.
Leon decides whether the request should be handled directly, through controlled skills, or through agentic execution.
## Controlled
`controlled` mode runs deterministic native skills and actions.
This is useful when the behavior should be predictable, localized, and tightly connected to a known skill.
## Agent
`agent` mode handles goals that need planning, tool use, observation, and recovery.
Agent mode is more flexible, but it also needs stronger safeguards: schemas, tool validation, retries, and clear final synthesis.
## Choosing A Mode
As an owner, you usually should not need to think about modes.
As a contributor, modes matter because they shape where new behavior belongs. If the task has a stable deterministic path, start with controlled behavior. If the task is open-ended and tool-driven, agent mode may be the better fit.
In short: predictable flow, controlled mode. Open-ended goal, agent mode.
@@ -1,32 +0,0 @@
---
title: Proactivity
description: How Leon can become useful without becoming noisy.
---
# Proactivity
<span className="leon-status">Experimental</span>
Leon is being designed to become more than a reactive assistant.
The long-term goal is for Leon to notice useful opportunities, revisit pending matters, and help when it makes sense.
But lets be clear: proactive does not mean annoying.
## Pulse
The pulse mechanism is a bounded proactive system.
It can inspect memory, context deltas, and Leon's private self-model to decide whether a matter is worth surfacing or executing.
## Boundaries
Proactivity must stay respectful.
Leon should deduplicate repeated matters, learn from owner declines, and avoid turning helpfulness into interruption.
## Design Goal
The right kind of proactivity feels like continuity.
The wrong kind feels like noise. Leon should aim for the first and aggressively avoid the second.
@@ -1,44 +0,0 @@
---
title: Skills And Tools
description: How skills, actions, toolkits, tools, and functions relate.
---
# Skills And Tools
Leon separates intent-level capabilities from executable functions.
This vocabulary is important. If we use the right words, it becomes much easier to understand where a feature should live.
## Skills
Skills describe what Leon can do at a higher level.
Native skills live under `skills/native`. Agent skills live under `skills/agent` and can define workflow instructions with `SKILL.md`.
For example, a timer can be a skill. A weather forecast can be a skill. A guided workflow can also be a skill.
## Actions
Actions are the behavior exposed by native skills.
An action can be dialog-only or backed by logic through a bridge.
## Toolkits
Toolkits group tools by domain.
Examples include weather, operating system control, structured knowledge, coding development, and productivity collaboration.
## Tools
Tools expose callable functions with schemas.
Tool manifests describe metadata, function parameters, optional output schemas, settings, resources, binaries, and hooks.
## Functions
Functions are what Leon can actually call.
They should be specific, schema-guided, and designed to return useful structured observations.
This is the part agent mode relies on when it needs to do real work.
-39
View File
@@ -1,39 +0,0 @@
---
title: Chat
description: Talk to Leon through the web interface.
---
# Chat
Chat is the simplest way to interact with Leon.
You can ask questions, request actions, continue previous work, and trigger skills or tools depending on what you ask.
## What Happens On A Turn
At a high level, Leon receives your utterance and decides how to handle it:
- answer directly when the request is simple
- route to controlled mode for deterministic skills
- route to agent mode when planning and tool use are needed
- ask a short clarification question when required information is missing
## Good Requests
Good requests are specific enough for Leon to act.
For example:
```txt
Summarize this video and save the key points.
```
```txt
Check if my setup is ready to run local models.
```
```txt
Remember that I prefer concise technical answers.
```
Leon can handle vague requests, but clear goals help him choose better tools and recover faster when something fails.
@@ -1,50 +0,0 @@
---
title: Configure Providers
description: Choose how Leon connects to AI providers.
---
# Configure Providers
Leon can work with local and remote AI providers.
The provider you choose matters. It affects privacy, latency, cost, quality, and available model features.
## Provider Mindset
There is no single perfect provider for everything.
Use the one that matches the situation:
- local models when ownership and privacy matter most
- remote models when capability and reliability matter most
- OpenAI-compatible providers when you need flexibility
Leon 2.0 is being built to handle provider differences more carefully because agentic execution depends on stable model behavior.
When a model is asked to use tools, small differences can have a big impact. So this layer matters.
## Common Provider Areas
Leon has active provider work around:
- OpenAI
- OpenRouter
- Anthropic
- llama.cpp
- OpenAI-compatible APIs
Other providers can be supported through the provider layer as the project evolves.
## Configuration
Provider configuration is handled through environment variables and generated setup files.
Start with:
```sh
pnpm run check
```
Then review the setup output and the sample environment files in the repository.
If something is missing, the check command should point you in the right direction.
-47
View File
@@ -1,47 +0,0 @@
---
title: Context
description: How Leon grounds answers in the real runtime and environment.
---
# Context
Context is current information about Leon's runtime and environment.
It helps Leon answer questions about what is actually happening on your machine instead of guessing.
This is one of the foundations of making Leon feel grounded.
## Context Examples
Leon can maintain context about areas such as:
- host system
- workspace
- runtime
- network
- activity
- local inventory
- media profile
- architecture
## Context-First Policy
For environment questions, Leon should inspect context before memory or shell commands.
Example:
```txt
Am I connected to the VPN?
```
That kind of question should be grounded in runtime context rather than memory.
Memory may remember that you use a VPN. Context should tell what is true right now.
## Progressive Context
Leon should not load every piece of context into every prompt.
Instead, he uses relevant context depending on the toolkit, mode, and task.
This keeps prompts cleaner and reduces hallucination risk.
@@ -1,34 +0,0 @@
---
title: Desktop App
description: A smoother local Leon experience.
---
# Desktop App
<span className="leon-status">Coming soon</span>
The desktop app is planned to make Leon easier to install, run, and live with day to day.
Leon is personal software. It should not require the owner to fight the terminal forever just to get started.
So yes, this matters.
## Planned Direction
The desktop app should help with:
- installation
- local runtime management
- onboarding
- permissions
- updates
- status visibility
- starting and stopping Leon
## Why It Matters
Leon needs trust to become useful.
The desktop app is the right place to explain permissions clearly, show what Leon is doing, and make local ownership feel natural instead of hidden behind setup scripts.
It should make Leon feel more approachable without hiding what is happening.
-34
View File
@@ -1,34 +0,0 @@
---
title: Local LLMs
description: Run Leon with local model support when your machine can handle it.
---
# Local LLMs
<span className="leon-status">Preview</span>
Leon 2.0 includes work toward local LLM support through llama.cpp.
The goal is simple: when your hardware can support it, Leon should be able to use a local model instead of depending entirely on a third-party service.
This is not about saying local models are always better. It is about giving the owner more control.
## Why It Matters
Local model support helps with:
- privacy
- ownership
- offline resilience
- experimentation
- lower dependency on remote platforms
It does not mean every task should always use a local model. Some tasks may still benefit from remote models. Leon should let the owner choose.
## Current Direction
The local LLM path is part of the 2.0 developer preview work.
Expect changes while model loading, provider switching, and reliability are refined.
Use `pnpm run check` to inspect your setup and follow the local AI setup output generated by Leon.
-40
View File
@@ -1,40 +0,0 @@
---
title: Memory
description: How Leon remembers useful information over time.
---
# Memory
Leon uses layered memory so it can stay useful across time.
The goal is continuity.
If something matters days or weeks later, Leon should be able to retrieve it and help you continue naturally.
## Memory Layers
Leon separates memory into:
- persistent memory for durable facts and preferences
- daily memory for per-day summaries and timelines
- discussion memory for recent working context
This keeps memory more precise than a single unstructured bucket.
## Explicit Memory
When you say:
```txt
Remember that I prefer pnpm for this project.
```
Leon should treat that as a durable memory request.
## Retrieved Memory
Leon retrieves memory through indexed search and adaptive follow-up passes when initial recall looks weak.
The system is designed to avoid relying on the model's raw guess about the past.
This is important. Memory should be retrieved, not invented.
@@ -1,32 +0,0 @@
---
title: Messaging Apps
description: Connect with Leon from messaging apps.
---
# Messaging Apps
<span className="leon-status">Coming soon</span>
Messaging apps are planned because Leon should be reachable from the places where conversations already happen.
The goal is not to replace the main Leon experience.
The goal is to make Leon available when a lightweight conversation, remote check-in, or async update makes more sense than opening the web app.
## Planned Direction
Messaging app support should eventually cover:
- sending messages to Leon
- receiving useful responses and updates
- handling async tasks
- respecting permissions and owner control
- keeping sensitive actions explicit
## Design Principle
Messaging should stay practical.
Leon should be able to help from a messaging app without turning every notification into noise.
The owner should stay in control of what gets connected and what Leon is allowed to send back.
-14
View File
@@ -1,14 +0,0 @@
{
"title": "Use Leon",
"pages": [
"quick-start",
"configure-providers",
"local-llms",
"chat",
"voice",
"memory",
"context",
"messaging-apps",
"desktop-app"
]
}
@@ -1,66 +0,0 @@
---
title: Quick Start
description: Install, run, and check Leon from source.
---
# Quick Start
<span className="leon-status">Developer Preview</span>
For now, Leon 2.0 is for developers and contributors who are comfortable running the project from source.
It will become easier later. The desktop app will help a lot here. But today, this is the path.
## Requirements
- Node.js `>= 24.0.0`
- pnpm
- Linux, macOS, or Windows
Using Volta or another Node version manager is recommended.
## Install
Clone the repository and install the dependencies:
```sh
git clone https://github.com/leon-ai/leon.git
cd leon
npm install --global pnpm@latest
pnpm install
```
## Run
Start Leon:
```sh
pnpm start
```
By default, Leon is available at:
```txt
http://localhost:5366
```
## Check The Setup
Then check if your setup looks good:
```sh
pnpm run check
```
This command is important. It reports what is ready and what still needs attention.
## Development
If you are working on Leon, you will mostly use:
```sh
pnpm run dev:server
pnpm run dev:app
```
The first one runs the Leon runtime. The second one runs the web app.
-40
View File
@@ -1,40 +0,0 @@
---
title: Voice
description: Use Leon through speech and audio.
---
# Voice
<span className="leon-status">Preview</span>
Voice is part of Leon's identity as a personal assistant.
Leon includes speech-related systems for listening, speaking, wake word flows, and audio feedback.
The exact setup depends on your platform and configured voice providers.
## Voice Stack
The voice area includes:
- speech-to-text
- text-to-speech
- wake word models
- voice energy UI
- audio settings
## Setup
As usual, start with:
```sh
pnpm run check
```
Then review the voice-related configuration output and sample files under `core/config/voice`.
## Direction
Voice should feel useful, not theatrical.
The goal is fast, natural interaction when speaking is easier than typing.
-64
View File
@@ -1,64 +0,0 @@
---
title: Core Ideas
description: The concepts that explain how Leon 2.0 works.
---
# Core Ideas
Before going into code, it is important to understand the vocabulary.
Leon 2.0 is built around a few concepts. Once these concepts are clear, the rest of the architecture makes much more sense.
## Owner
The owner is the person Leon serves.
That can be you, me, or anybody running a Leon.
Leon can adapt to the owner's preferences, environment, and history. But the owner stays in control of what Leon can access, remember, and do.
## Skills
Skills are high-level capabilities.
You can think of a skill as something Leon knows how to do, like managing a timer, getting the weather, or running a workflow.
Native skills provide controlled behavior. Agent skills can define workflows with `SKILL.md` files and guide agentic execution.
## Tools
Tools are declared capabilities Leon can call to do real work.
They belong to toolkits and expose functions with schemas, settings, outputs, and optional hooks.
This is important: tools are not vague. They describe what can be called and what parameters are expected.
## Context
Context is current information about Leon's runtime and environment.
Examples include system state, workspace data, network details, activity, inventory, and architecture.
If you ask something about the current environment, Leon should check context first. Not guess.
## Memory
Memory stores useful history over time.
Leon separates persistent memory, daily memory, and discussion memory. Each layer has a different purpose, because not every remembered thing should have the same lifetime.
## Modes
Leon can operate in different modes:
- `smart`: choose the best route automatically
- `controlled`: run deterministic native skills and actions
- `agent`: plan and execute dynamically with tools
## Proactivity
Leon can eventually act before being asked when it has a clear, bounded, owner-aligned reason.
This is handled through a pulse mechanism. It should stay conservative, deduplicated, and respectful of owner declines.
Because helpful is good. Noisy is not.
-4
View File
@@ -1,4 +0,0 @@
{
"title": "Welcome",
"pages": ["what-is-leon", "philosophy", "core-ideas", "privacy"]
}
-68
View File
@@ -1,68 +0,0 @@
---
title: Philosophy
description: Why Leon exists and what guides the project.
---
# Philosophy
Leon started in 2017, before the current AI wave.
The first beta was released in February 2019. Since then, the mission has stayed the same: help people have their own personal AI assistant.
Leon is not being built because AI is fashionable. It is being built because personal computing should feel personal again.
## The Mission
The mission is simple, but it is not easy:
Give people an assistant they can own, understand, extend, and trust.
That means Leon cannot just be a nice chat box with a logo on top. He needs memory, context, tools, local capabilities, clear permissions, and an architecture that can be inspected by the people who depend on it.
This is why the project takes time. And yes, it takes a lot of time.
## Owner First
Leon uses the word owner deliberately.
You are not just a user passing through a product funnel. You own your Leon.
Leon should adapt to your environment and preferences, but he should not take your agency away. Good personal AI should remove friction while keeping the human at the center.
Humans first. Not AI, not FOMO, just humans.
## Built Before The Hype
The current AI moment made many things possible, but Leon did not begin as a reaction to hype.
The obsession has been consistent for years: make personal AI feel owned by the person using it, not rented from a black box.
This is why Leon cares about local models, open source, explicit tools, privacy-aware context, and memory that can be reasoned about.
## Tools Over Magic
Leon should not pretend to know things it did not check.
When work needs to be done, Leon should prefer declared tools, structured inputs, validated schemas, and observable results.
Models are powerful. But tools are what make Leon grounded.
This is one of the main differences between a useful assistant and a fluent guesser.
## Memory With Responsibility
Memory is powerful because it lets Leon continue with you over time.
It is also sensitive.
Leon's memory system is designed in layers so durable facts, daily summaries, and recent discussion context can serve different purposes. The goal is continuity without blindly stuffing everything into every prompt.
## Humans First
Leon should help people live and work better.
That also means not chasing every trend just because it is loud.
The project values craft, respect, calm progress, and a community where people can build something meaningful together.
Well, my friend, this is the spirit.
-44
View File
@@ -1,44 +0,0 @@
---
title: Privacy
description: How Leon thinks about privacy, local control, and permissions.
---
# Privacy
Privacy is not a feature added at the end.
It is one of the reasons Leon exists.
Leon should help you use AI without forcing you to give up ownership of your environment, history, and personal workflows.
## Local When Possible
Leon can use local capabilities when your setup supports them. Local model support through llama.cpp is part of that direction.
Remote providers can still be useful. I do not want to pretend otherwise.
The important part is that the owner understands the tradeoff and chooses the provider that fits the task.
## Context With Permission
Leon becomes more useful when it can understand the environment it runs in.
That context can include system details, workspace information, activity signals, and other local state.
But context is not free data to collect without thinking. It should exist for a clear purpose: helping Leon answer and act better for the owner.
## Memory With Boundaries
Leon should remember useful things, but memory should stay structured.
Durable facts, daily summaries, and recent discussion context should not be treated as the same kind of data.
Keeping memory layered makes the system easier to reason about and easier to improve.
## Tools Are Auditable
Leon should prefer explicit tools over hidden behavior.
When tools have schemas, settings, and logs, the assistant becomes easier to inspect.
And yes, this matters a lot when an AI assistant can act on your machine.
@@ -1,58 +0,0 @@
---
title: What Is Leon?
description: Leon is an open-source personal AI assistant built around owner control.
---
# What Is Leon?
Leon is an open-source personal AI assistant.
That sentence sounds simple, but it is actually the whole point.
Leon is not meant to be only a chat interface. He should be able to understand what you want, use tools, remember useful things, know a bit about the environment he runs in, and help you complete tasks from start to finish.
The important part is ownership. Leon is designed to live close to you, on your machine or infrastructure, with an architecture you can inspect and extend.
## What Leon Is Built For
Leon is built to help in a practical way:
- understand what the owner asks
- choose the right way to handle it
- use declared tools instead of guessing everything
- remember useful preferences and history
- use local context when it actually helps
- keep the owner in control
## What Makes Leon Different
Leon is not built as a thin wrapper around a remote model.
Of course, remote models can be useful. I use them too. But I do not want Leon to depend on the idea that everything must live in someone else's black box.
So Leon is shaped around:
- local-first thinking
- explicit tools
- inspectable architecture
- memory with boundaries
- context that is grounded in the real setup
- extensibility through skills, tools, and bridges
The point is choice, not dependency.
## The Current 2.0 Direction
Leon 2.0 moves the project toward a more capable core:
- `smart` mode chooses the best path
- `controlled` mode runs deterministic native skills
- `agent` mode can plan, execute, observe, recover, and answer
Under the hood, the main layer model is:
```txt
Skills -> Actions -> Tools -> Functions (-> Binaries)
```
This structure matters because it avoids putting everything into a single magical prompt. Leon should have clear boundaries, clear capabilities, and clear places where contributors can build.
-21
View File
@@ -1,21 +0,0 @@
import js from '@eslint/js'
import nextPlugin from '@next/eslint-plugin-next'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{
ignores: ['.next/**', '.source/**', 'node_modules/**']
},
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
plugins: {
'@next/next': nextPlugin
},
rules: {
...nextPlugin.configs.recommended.rules,
...nextPlugin.configs['core-web-vitals'].rules
}
}
)
-11
View File
@@ -1,11 +0,0 @@
import type { InferPageType } from 'fumadocs-core/source'
import { source } from '@/lib/source'
export async function getLLMText(
page: InferPageType<typeof source>
): Promise<string> {
const processed = await page.data.getText('processed')
return `# ${page.data.title} (${page.url})\n\n${processed}`
}
-7
View File
@@ -1,7 +0,0 @@
import { loader } from 'fumadocs-core/source'
import { docs } from 'fumadocs-mdx:collections/server'
export const source = loader({
baseUrl: '/docs',
source: docs.toFumadocsSource()
})
-6
View File
@@ -1,6 +0,0 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
-20
View File
@@ -1,20 +0,0 @@
import { createMDX } from 'fumadocs-mdx/next'
const config = {
reactStrictMode: true,
turbopack: {
root: import.meta.dirname
},
async rewrites() {
return [
{
source: '/docs/:path*.mdx',
destination: '/llms.mdx/docs/:path*'
}
]
}
}
const withMDX = createMDX()
export default withMDX(config)
-32
View File
@@ -1,32 +0,0 @@
{
"name": "@leon-ai/docs",
"private": true,
"type": "module",
"scripts": {
"dev": "next dev",
"build": "next build",
"lint": "eslint ."
},
"dependencies": {
"@types/mdx": "2.0.13",
"fumadocs-core": "16.8.7",
"fumadocs-mdx": "14.3.2",
"fumadocs-ui": "16.8.7",
"lucide-react": "1.14.0",
"next": "16.2.4",
"react": "19.2.5",
"react-dom": "19.2.5"
},
"devDependencies": {
"@eslint/js": "10.0.1",
"@next/eslint-plugin-next": "16.2.4",
"@types/node": "25.6.0",
"@types/react": "19.2.14",
"@types/react-dom": "19.2.3",
"eslint": "10.3.0",
"eslint-config-next": "16.2.4",
"tailwindcss": "4.2.4",
"typescript": "6.0.3",
"typescript-eslint": "8.59.1"
}
}
-6587
View File
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More