Enhance suitability assessment and documentation

- Implemented `check_suitability` method in `CoreReadOnlyRepository` for suitability determination based on customer and product risk levels.
- Added `build_suitability_log_row` function in `suitability.py` for mapping suitability check results to `risk_suitability_log`.
- Updated `AGENTS.md`, `ENVIRONMENT.md`, and `FLOW.md` to reflect changes in suitability assessment processes and documentation.
- Revised `FRAMEWORK.md` and `MEMORY.md` to clarify project structure and data flow related to suitability checks.
- Expanded `TODO.md` with tasks related to logging and auditing suitability assessments.
This commit is contained in:
2026-09-07 11:15:30 +08:00
parent 1ddd44a6cb
commit 3fb0ceb334
44 changed files with 7479 additions and 250 deletions
@@ -85,7 +85,7 @@
| 层级 | 业务含义 | 权威存储 | Redis 缓存 | 谁写 |
| --- | --- | --- | --- | --- |
| **L0** | 正式 C1~C5、年龄、职业、资产规模 | **Core 只读** | 一般不缓存(或极短 TTL) | 非 Agent |
| **L0** | 正式 C1~C5、KYC(性别/学历/收入/资产)、问卷得分、风评过期 | **Core 只读**(`jinrong_core`) | 一般不缓存(或极短 TTL) | 非 Agent |
| **L1** | 客户偏好:风格、规划、阈值摘要、行为标签 | **MySQL** `customer_profile_l1` | `profile:l1:{customer_id}` | 客户 Agent |
| **L2** | 服务侧:诉求、待办、资产概况快照、服务标签 | **MySQL** `customer_profile_l2` | `profile:l2:{customer_id}:{advisor_id}` | 代理人 Agent |
| **L3** | 监测侧:正常/关注/高风险、评分维度 | **MySQL** `customer_profile_l3` | `profile:l3:{customer_id}` | 风控 Agent |
@@ -96,7 +96,15 @@
- **禁止**用 L1 客户口头偏好 **覆盖** L0 正式风险等级。
- 客户 **不可见** L2/L3(API 层 404,不是 Redis 里藏一下就行)。
---
**R-02 适当性(记忆分工):**
```text
计算(L0 + 产品 + C×R 矩阵)→ CoreReadOnlyRepository.check_suitability() 【jinrong_core】
记账(审计 + 客户/代理人可读)→ risk_suitability_log 【jinrong_agent】
映射 → app/model/suitability.py · 契约 → 表设计/07-risk_suitability_log说明.md
```
**JSON 字段约定:** [06-用户画像L1-L3设计.md](../项目框架设计/表设计/06-用户画像L1-L3设计.md)
## 5. MySQL:权威业务记忆放什么?
@@ -264,7 +272,8 @@ Neo4j = **关系网**,回答「谁持有啥、产品要什么等级、归哪
| `rag_service.py` | Milvus 检索 + 溯源 |
| `agent_service.py` | 编排上下文(读 Redis/MySQL);不写错层 |
| `milvus_tool.py` | Collection CRUD |
| `config/database.py` | MySQL / Redis / Neo4j 连接 |
| `repository/core_ro.py` | Core 只读 + R-02 适当性计算 |
| `model/suitability.py` | check_suitability → risk_suitability_log 行映射 |
---
@@ -289,6 +298,8 @@ Neo4j = **关系网**,回答「谁持有啥、产品要什么等级、归哪
| [03-milvus-collections.md](../项目框架设计/表设计/03-milvus-collections.md) | 向量 Collection |
| [04-neo4j-model.md](../项目框架设计/表设计/04-neo4j-model.md) | 图模型 |
| [数据交互矩阵.md](../需求拆解/数据交互矩阵.md) | 跨 Agent 数据对象 |
| [06-用户画像L1-L3设计.md](../项目框架设计/表设计/06-用户画像L1-L3设计.md) | 画像 JSON 约定 |
| [07-risk_suitability_log说明.md](../项目框架设计/表设计/07-risk_suitability_log说明.md) | R-02 落库契约 |
| [FRAMEWORK.md](../memory/FRAMEWORK.md) | 项目框架快照 |
| [FLOW.md](../memory/FLOW.md) | 端到端链路 |