mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 08:43:02 +08:00
docs: update README and add documentation skeleton
This commit is contained in:
0
doc/action/action.md
Normal file
0
doc/action/action.md
Normal file
@@ -1 +0,0 @@
|
||||
# 流程参考: 行动模块
|
||||
@@ -1,96 +0,0 @@
|
||||
# 流程参考: 记忆模块
|
||||
|
||||
> 仅展示大致流程,缓存命中、持久化等内容在下方流程图中尚未体现
|
||||
|
||||
## 前置模块: [MemorySelector](../../Partner-Main/src/main/java/work/slhaf/partner/module/modules/memory/selector/MemorySelector.java)
|
||||
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
elk:
|
||||
nodePlacementStrategy: LINEAR_SEGMENTS
|
||||
---
|
||||
|
||||
flowchart TD
|
||||
direction TB
|
||||
|
||||
Input[输入] --> |主题提取| Extractor
|
||||
subgraph TE [主题提取]
|
||||
Extractor[主题提取模块] --> Extract{主题提取}
|
||||
Extract --> |提取到主题| TopicSet[主题路径集合]
|
||||
|
||||
TopicSet --> TopicPath1[主题路径.1] --> Slice1[记忆切片.1]
|
||||
TopicSet --> TopicPath2[主题路径.2] --> Slice2[记忆切片.2]
|
||||
TopicSet --> TopicPath3[主题路径.3] --> Slice3[记忆切片.3]
|
||||
end
|
||||
|
||||
subgraph SE [切片评估]
|
||||
|
||||
Evaluator[切片评估模块]
|
||||
|
||||
Slice1 --> Evaluator --> Thread1[评估线程.1] --> Evaluated{评估是否通过}
|
||||
Slice2 --> Evaluator --> Thread2[评估线程.2] --> Evaluated{评估是否通过}
|
||||
Slice3 --> Evaluator --> Thread3[评估线程.3] --> Evaluated{评估是否通过}
|
||||
Evaluated --> |否| Throwed
|
||||
end
|
||||
|
||||
Context[流程上下文]
|
||||
Extract --> |未提取到主题| ResultEmpty
|
||||
Evaluated --> |是| ResultNormal
|
||||
ResultEmpty --> |写入| Context
|
||||
ResultNormal --> |写入| Context
|
||||
|
||||
ResultEmpty@{shape: braces, label: "[结束]<br/>---<br/>记忆无命中"}
|
||||
ResultNormal@{shape: braces, label: "[结束]<br/>---<br/>聚合为特定格式的 Prompt"}
|
||||
Throwed@{ shape: dbl-circ, label: "丢弃" }
|
||||
```
|
||||
|
||||
### 后置模块: [MemoryUpdater](../../Partner-Main/src/main/java/work/slhaf/partner/module/modules/memory/updater/MemoryUpdater.java)
|
||||
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
elk:
|
||||
nodePlacementStrategy: LINEAR_SEGMENTS
|
||||
---
|
||||
|
||||
flowchart TD
|
||||
direction TB
|
||||
|
||||
Trigger.Time[触发: 时间周期] --> MT
|
||||
Trigger.Threshold[触发: 对话阈值] --> MT
|
||||
|
||||
CognationCore --> |读取| Messages
|
||||
subgraph MT [对话分流]
|
||||
Messages[对话记录] --> Single[单个主体对话]
|
||||
Single --> Single1[主体1]
|
||||
Single --> Single2[主体2]
|
||||
Single --> Single3[主体3]
|
||||
|
||||
Messages[对话记录] --> Multi[多个主体对话]
|
||||
end
|
||||
|
||||
subgraph MS [对话摘要]
|
||||
Single1 --> |并发| SSum1[单主体摘要线程1] --> SSResult1[单主体摘要结果1]
|
||||
Single2 --> |并发| SSum2[单主体摘要线程2] --> SSResult2[单主体摘要结果2]
|
||||
Single3 --> |并发| SSum3[单主体摘要线程3] --> SSResult3[单主体摘要结果3]
|
||||
|
||||
Multi --> MSum[多主体摘要] --> MSResult[多主体摘要结果]
|
||||
end
|
||||
|
||||
subgraph MU[记忆更新]
|
||||
MemoryCore[记忆核心]
|
||||
SSResult1 --> Slice1[记忆切片1] --> |更新| MemoryCore
|
||||
SSResult2 --> Slice2[记忆切片2] --> |更新| MemoryCore
|
||||
SSResult3 --> Slice3[记忆切片3] --> |更新| MemoryCore
|
||||
|
||||
MSResult --> Slice4[记忆切片4] --> |更新| MemoryCore
|
||||
|
||||
end
|
||||
|
||||
MU --> |滚动对话窗口| CognationCore
|
||||
|
||||
CognationCore[认知核心]
|
||||
```
|
||||
@@ -1,59 +0,0 @@
|
||||
# 流程参考: 感知模块
|
||||
|
||||
> 相较于其他模块,目前的感知模块实际上流程非常简单,但后续或将添加一些新的内容
|
||||
> 此外,其后置模块实际上与 [记忆模块](./memory.md) 中的后置模块为并发执行,且都为后台任务
|
||||
|
||||
## 前置模块: [PerceiveSelector](../../Partner-Main/src/main/java/work/slhaf/partner/module/modules/perceive/selector/PerceiveSelector.java)
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Context[流程上下文] --> |获取| UserId
|
||||
UserId --> |查询| PerceiveCore
|
||||
PerceiveCore --> |结果回写| Context
|
||||
|
||||
subgraph result [感知核心查询结果]
|
||||
relation[关系]
|
||||
attitude[态度]
|
||||
impression[印象]
|
||||
static_memory[静态记忆]
|
||||
end
|
||||
```
|
||||
|
||||
## 后置模块: [PerceiveUpdater](../../Partner-Main/src/main/java/work/slhaf/partner/module/modules/perceive/updater/PerceiveUpdater.java)
|
||||
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
elk:
|
||||
nodePlacementStrategy: LINEAR_SEGMENTS
|
||||
---
|
||||
|
||||
flowchart TD
|
||||
|
||||
Trigger.Time[触发: 时间周期] --> PE
|
||||
Trigger.Threshold[触发: 对话阈值] --> PE
|
||||
|
||||
CognationCore --> |读取| Messages[对话记录]
|
||||
PerceiveCore --> |读取| UserInfo[现有的用户信息]
|
||||
subgraph PE [内容提取]
|
||||
Messages --> |输入| RelationExtractor
|
||||
UserInfo --> |输入| RelationExtractor
|
||||
|
||||
Messages --> |输入| StaticExtractor
|
||||
UserInfo --> |输入| StaticExtractor
|
||||
end
|
||||
|
||||
subgraph PU [感知更新]
|
||||
StaticExtractor --> |生成| NewInfo[修正后的用户信息]
|
||||
RelationExtractor --> |生成| NewInfo[修正后的用户信息]
|
||||
end
|
||||
|
||||
NewInfo --> |更新| PerceiveCore
|
||||
|
||||
CognationCore[认知核心]
|
||||
PerceiveCore[感知核心]
|
||||
|
||||
RelationExtractor[关系提取模块]
|
||||
StaticExtractor[静态记忆提取模块]
|
||||
```
|
||||
0
doc/architecture/overview.md
Normal file
0
doc/architecture/overview.md
Normal file
BIN
doc/assets/partner-overview.png
Normal file
BIN
doc/assets/partner-overview.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
0
doc/config/configuration.md
Normal file
0
doc/config/configuration.md
Normal file
0
doc/context/context-workspace.md
Normal file
0
doc/context/context-workspace.md
Normal file
0
doc/memory/memory.md
Normal file
0
doc/memory/memory.md
Normal file
0
doc/model/providers.md
Normal file
0
doc/model/providers.md
Normal file
@@ -1,21 +0,0 @@
|
||||
# Partner 项目启动流程
|
||||
|
||||
> 由于整个项目启动依赖提前写好的配置文件,所以在启动项目之前,最好阅读先该文档,准备好必要的配置,避免启动失败
|
||||
|
||||
## 前置操作
|
||||
|
||||
确保已经安装`Java21`环境
|
||||
|
||||
克隆项目至本地:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/slhafzjw/Partner.git
|
||||
```
|
||||
|
||||
## 准备配置
|
||||
|
||||
克隆好项目之后,在项目的根目录创建目录`config/`
|
||||
|
||||
### 准备基础配置文件
|
||||
|
||||
|
||||
Reference in New Issue
Block a user