Rule Template Prompt Hierarchical Storage Solution Optimization — 2026-06-25
Objective
Based on user requirements, supplement the actual data status survey results of the SCSAI server and optimize the hierarchical storage implementation plan (v1→v2).
Work Performed
1. SCSAI Server Actual Survey
Connected directly via AML API to https://ylxt.chat/scplm (root / gyc123456;), scanned all 1207 ItemTypes:
- Discovered 53 ItemTypes related to rules/templates/prompts.
- Key Findings:
- Template already has 15 data entries (Action/Form/Identity/ItemType creation templates, etc.).
- Rule fields are complete (natural_language_input + generated_aml) but contain no data.
- RuleDefinition / TemplateDefinition / RuleExecutionHistory, etc., are empty.
- **All BossAgent_* ItemTypes intended for creation do not exist (no naming conflicts).
- Key Conclusion**: Existing SCSAI Rule/Template are native platform management types. All 2371+1205+2817+46 pieces of data for BossAgents reside entirely in the local SQLite, with zero data on SCSAI.
2. Full Frontend Workflow Analysis
Scanned frontend/app.js (15,127 lines), confirmed:
- The Rules Engine Tab is divided into 6 sub-panels (sciot-rules / online-rules / obj-prompts / biz-prompts / templates / assembler).
- All API call paths (/api/aml/sciot/rules, /api/aml/sciot/prompts, /api/aml/sciot/templates, etc.)
- A new submission review process needs to be created
3. Solution Optimization (v1 → v2)
Key Changes:
| Aspect | v2 Optimization |
|------|---------|
| Current State Investigation | Added actual survey data for 1207 ItemTypes |
| Existing SCSAI Assets | Noted 15 Template data entries + Rule fields for reference |
| ItemType Design | Referenced the style of existing SCSAI Rule/Template fields (natural_language_input + generated_aml + version system) |
| Synchronization Process | Three modes (SCSAI→Local / Local→User / User→SCSAI) + offline fallback strategy |
| Risk Mitigation Plan | Added 6 new risks and countermeasures |
| API Standardization | /api/user-library/:userId/ path |
| Implementation Phases | Environment confirmation Phase 0 → Phase 1-5 |
Deliverables
- D:\openclaw\bossagents\docs\Rule-Template-Prompt-Layered-Storage-Full-Implementation-Plan.md (20.9KB, v2 optimized version)
- SCSAI server query scripts: C:\Users\tuan_\SCSAI-query-*.cjs series
BossAgents