Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,10 @@ Start the Dashboard with `node <brain-path>/.loci/dashboard/server.js`, then ope

## One entry, one manual, shared data

```mermaid
flowchart TD
A[LOCI.md: short entry] --> B[Native instructions in each agent]
B --> C[Startup: short preferences]
H[Optional hook / same fallback reader] --> C
B --> D[First memory use: read LOCI-RULES.md once]
D --> E[Read relevant indexes and records]
E --> F[Existing scripts / Dashboard API]
F --> G[Local Markdown, JSON and attachments]
UI[Dashboard] <--> G
```
<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/architecture-en-dark.svg" />
<img src="docs/assets/architecture-en-light.svg" alt="Loci architecture: install an entry, load preferences at startup, read rules at first memory use, and share local data" width="960" />
</picture>

- **`LOCI.md`** provides the brain path, startup preference reader and triggers to read the manual.
- **`LOCI-RULES.md`** contains the complete operating rules. Read it at first Loci use, reuse while valid, reload after changes or lost context.
Expand Down
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,10 @@ node loci/scripts/loci-install.js --connect auto --lang zh

## 架构:一个入口,一本手册,一套数据

```mermaid
flowchart TD
A[LOCI.md:短入口] --> B[安装到各 Agent 原生指令文件]
B --> C[启动:短偏好与大脑位置]
H[可选 Hook / 同一个后备读取器] --> C
B --> D[首次涉及记忆:完整读取 LOCI-RULES.md]
D --> E[按需查询索引和相关记录]
E --> F[现有脚本 / Dashboard API]
F --> G[本地 Markdown、JSON、附件]
UI[Dashboard] <--> G
```
<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/architecture-zh-dark.svg" />
<img src="docs/assets/architecture-zh-light.svg" alt="Loci 架构:安装短入口,启动获取偏好,首次使用读手册,Agent 与 Dashboard 共用本地数据" width="960" />
</picture>

- **`LOCI.md` 是短入口**:告诉 Agent 大脑在哪、如何获取偏好、何时读取完整手册。
- **`LOCI-RULES.md` 是完整手册**:任务、碎片、人物、项目等规则集中分块维护;首次涉及 Loci 操作时读一次,未变且仍在上下文则复用。
Expand Down
23 changes: 6 additions & 17 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,12 @@

Loci 的核心是让不同 Agent 通过自己的原生指令入口,使用同一份本地记忆。规则告诉模型何时读取和调用工具,脚本/API 完成实际读写。Markdown 指令能够引导模型,不能从机制上强制它执行;安装验证与真实客户端验收是两件事。

```mermaid
flowchart TD
Source[LOCI.md:唯一短入口源文件] --> Install[同一个 Node 安装器:替换大脑路径并合并标记区]
Install --> Native[各 Agent 原生指令入口]
Native --> Prefs[启动:短偏好与大脑位置]
Hook[可选 SessionStart Hook] --> Context[scripts/loci-context.js]
Fallback[入口指令的后备调用] --> Context
Context --> Prefs
Native --> Trigger{首次涉及 Loci 记忆操作?}
Trigger -->|是| Rules[完整读取 LOCI-RULES.md 一次]
Trigger -->|否| Chat[继续普通请求]
Rules --> Index[按需查索引、读取最小相关数据]
Index --> Tools[现有脚本或 Dashboard API]
Tools --> Data[本地 Markdown、JSON 和附件]
Dashboard[Dashboard 界面] <--> Data
Data --> Project[项目正文留在对应仓库,大脑只保存索引]
```
<picture>
<source media="(prefers-color-scheme: dark)" srcset="assets/architecture-zh-dark.svg" />
<img src="assets/architecture-zh-light.svg" alt="Loci 架构:安装短入口,启动获取偏好,首次使用读手册,Agent 与 Dashboard 共用本地数据" width="960" />
</picture>

图分为三个阶段:安装入口、启动获取短偏好、首次使用记忆。Dashboard 与 Agent 最终读写同一套本地数据。图片随 GitHub 的深浅主题切换;文字与流程源文件在 [`scripts/render-architecture.js`](../scripts/render-architecture.js),运行 `node scripts/render-architecture.js` 可重新生成中英文 SVG。

## 哪些文件需要维护

Expand Down
55 changes: 55 additions & 0 deletions docs/assets/architecture-en-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions docs/assets/architecture-en-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading