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:
+9
-5
@@ -1,7 +1,7 @@
|
||||
# 实现流程
|
||||
|
||||
> To-Be 端到端链路;As-Is 见 `ENVIRONMENT.md`
|
||||
> 画像分层见 `docs/项目框架设计/表设计/00-架构总览.md`
|
||||
> 画像分层见 `docs/项目框架设计/表设计/06-用户画像L1-L3设计.md` · 适当性见 `07-risk_suitability_log说明.md`
|
||||
|
||||
------
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
③ Core 模拟库(L0)
|
||||
.\scripts\core\reset.ps1
|
||||
→ 创建 jinrong_core + 28 客户 / 12 产品 / 持仓交易种子
|
||||
→ 创建 jinrong_core + **33 客户** / **14 产品** / 持仓交易种子(含 CUST-DEMO-* 手册示范)
|
||||
|
||||
④ Agent 共用底座(若库未建)
|
||||
mysql -u root -p < docs/项目框架设计/表设计/01-mysql-共用底座.sql
|
||||
@@ -64,10 +64,11 @@ memory_service:Redis 读最近 N 轮;异步写 agent_message 【待做
|
||||
agent_service:LangGraph StateGraph + DeepSeek;按 Agent 类型选 Tool 节点 【待做】
|
||||
↓
|
||||
Tool 示例:
|
||||
- CoreReadOnlyRepository:持仓/流水/L0(自动注入 customer_id) 【Repository 已有,Tool 未接】
|
||||
- CoreReadOnlyRepository:持仓/流水/L0 + check_suitability(R-02 计算) 【Repository 已有,Tool 未接】
|
||||
- model/suitability:check → risk_suitability_log 行映射 【已实现,风控 service 未接】
|
||||
- milvus_tool:产品规则 RAG + source_refs 【待做】
|
||||
- memory_service:读/写 L1/L2/L3(ProfileGuard) 【待做】
|
||||
- 风控 service 账号:R-02 适当性(无会话) 【待做】
|
||||
- 风控 service 账号:R-02 适当性 → check_suitability + INSERT log(无会话) 【待做】
|
||||
↓
|
||||
输出:assistant 消息 + has_disclaimer(客户/对外)
|
||||
↓
|
||||
@@ -105,7 +106,8 @@ admin/knowledge 上传 → document_parser → embedding_tool(Ollama bge-m3)
|
||||
| 会话 | session_id | Redis ctx + MySQL session | actor_id 一致 |
|
||||
| RAG | question + product_id? | chunks + source_doc_id | 必须溯源 |
|
||||
| 画像读 | customer_id | L1/L2/L3 JSON | RBAC 矩阵 §8 |
|
||||
| Core RO | customer_id | L0/持仓/流水 | 只读 jinrong_core |
|
||||
| Core RO | customer_id + product_id? | L0/持仓/流水;适当性判定 dict | 只读 jinrong_core;R-02 见 07 文档 |
|
||||
| 适当性落库 | check_suitability 输出 | risk_suitability_log 行 | build_suitability_log_row |
|
||||
| 审计 | 任意判定 | audit_log INSERT | 不可删改 |
|
||||
|
||||
------
|
||||
@@ -113,6 +115,8 @@ admin/knowledge 上传 → document_parser → embedding_tool(Ollama bge-m3)
|
||||
## 6. 关键数据约定
|
||||
|
||||
- Agent 库 SQL:`docs/项目框架设计/表设计/01-mysql-共用底座.sql`、`02-mysql-agent专用.sql`
|
||||
- 画像 L1/L2/L3:`docs/项目框架设计/表设计/06-用户画像L1-L3设计.md`
|
||||
- 适当性 log:`docs/项目框架设计/表设计/07-risk_suitability_log说明.md`
|
||||
- Core 模拟:`scripts/core/01-ddl.sql` · 说明 `docs/项目框架设计/Core模拟底座/01-表结构与种子说明.md`
|
||||
- Redis Key:`docs/项目框架设计/表设计/02-redis-keys.md`
|
||||
- Milvus:`kb_product_rules`、`kb_business_ops`;向量 **1024** 维
|
||||
|
||||
Reference in New Issue
Block a user