Roadmap — Customer 360
Xem hiện trạng chi tiết (schema, API, use case) tại TECHNICAL-DOCUMENTATION.md. Roadmap dưới đây được suy ra từ các hạ tầng đã sẵn sàng nhưng còn thiếu logic đi kèm (mục 9 của tài liệu kỹ thuật), sắp xếp theo mức độ ưu tiên.
✅ Đã hoàn thành
- Schema PostgreSQL 16 + pgvector cho CRM Journey Graph (8 vertex / 14 edge) và Customer Identity Resolution (CIR).
- Engine CIR (
backend-system/identity_resolution/) với quy tắc khớp metadata-driven (cdp_profile_attributes), hỗ trợ đa tenant + đa domain (retail/banking). - Hash PII (SHA-256) trước khi lưu cho dữ liệu demo.
is_hashed/persona_name: khi PII đã hash,identity_resolution/persona.pytự sinh nhãnpersona_namedễ đọc, không phải PII (deterministic, không đảo ngược hash) — ràng buộc bởi CHECK constraint DB + logic Python trongresolver.py.- REST API đầy đủ (
customer360-api/, FastAPI + SQLAlchemy 2) — CRUD cho toàn bộ bảng + endpoint reporting (/summary,/master-profiles/duplicates,/identity-graph/coverage). - Script sinh dữ liệu mẫu quy mô lớn (
init_sample_data.py, 1000 raw profiles, tỷ lệ trùng lặp có kiểm soát) + demo end-to-end (run-demo.sh). - Authentication cho
customer360-api: mọi endpoint (trừ/health) yêu cầuAuthorization: Bearer <token>hợp lệ, xác thực qua Keycloak token introspection (core/auth.py) và cache kết quả trong Redis (auth:token:<token>, TTL = tokenexp) để giảm tải Keycloak. Local dev Keycloak chạy như một service riêng trongdocker-compose.yml(keycloak+keycloak-db-init, dùng chung PostgreSQL với DB riêngdb_keycloak).
🎯 Ưu tiên ngắn hạn
- Kiểm soát truy cập theo
tenant_id: hiện Keycloak token đã xác thực ai gọi API, nhưng chưa map claim/role trong token sang giới hạn truy cập theotenant_id— cần trước khi expose ra ngoài môi trường dev. - Ingestion layer thật (Kafka/PubSub/RabbitMQ →
cdp_raw_profiles_stage): hiện dữ liệu chỉ được nạp qua script hoặcPOST /api/v1/raw-profiles; cần worker ingestion thật như mô tả trong CIR-improvement.md. - Real-time trigger thật: thay thế
IdentityResolutionTrigger(gọi tường minh) bằng cơ chế trigger DB hoặc consumer event thật (cdp_trigger_process_new_raw_profiles). - Lịch trình batch hằng ngày (2AM sweep): đóng gói
daily_job.pythành cronjob/Airflow DAG chạy production thật, tích hợp vớiairflow-ai-agent/.
🚧 Trung hạn
- Pipeline ML cho các cột scoring (schema đã sẵn sàng:
churn_probability,predictive_clv,lead_conversion_probability,engagement_score,identity_confidence_score…): huấn luyện + suy luận mô hình, ghi kết quả quaPATCH /api/v1/master-profiles/{id}, cập nhậtmodel_versions/scores_updated_at. - Job sinh embedding tự động cho
persona_embedding(master profile) vàembedding(CRM entities,graph_edges) — gọi LLM embedding API theo lịch hoặc theo event. - Dashboard vận hành CIR dựa trên
/api/v1/reporting/*(funnel xử lý, độ phủ identity graph, cảnh báo raw profile bị kẹt ởstatus_code=1). - Mở rộng quy tắc khớp: thêm fuzzy matching thật (
fuzzy_trgm/fuzzy_dmetaphone, cầnpg_trgm/fuzzystrmatch) cho các trường không hash được (hiện chỉ hỗ trợexactdo PII đã hash).
🔭 Dài hạn / Tầm nhìn
- Semantic search & lookalike audience dựa trên
persona_embedding/graph_edges.embedding— segmentation bằng ngôn ngữ tự nhiên (ví dụ: “khách hàng doanh nghiệp phần mềm, có >3 opportunity”). - Graph-based dashboard trực quan hoá hành trình khách hàng (Lead → Contact → Opportunity) và identity graph (raw profile ↔ master profile).
- PostGIS / spatial intelligence: tận dụng phần mở rộng không gian địa lý đã đề cập trong TECHNICAL-DOCUMENTATION.md cho các use case theo vị trí (ví dụ:
preferred_store_code, phân khúc theo khu vực). - Data Quality tự động: cảnh báo/khắc phục tự động khi
profile_completeness_scorehoặcidentity_confidence_scorethấp.