|
| 1 | +# Customer 360 |
| 2 | + |
| 3 | +Demonstrates ArcadeDB's multi-model capabilities by building a unified customer |
| 4 | +view that combines all five pillars in a single database: |
| 5 | + |
| 6 | +- **Graph traversal** -- identity resolution, churn risk scoring, cross-sell recommendations |
| 7 | +- **Documents** -- fuzzy deduplication via cross-matching |
| 8 | +- **Vectors** -- customer preference and product embeddings (LSM_VECTOR) |
| 9 | +- **Full-text search** -- support ticket content indexing |
| 10 | +- **Time-series** -- journey path analysis via event chains |
| 11 | + |
| 12 | +Uses **OpenCypher** as the primary query language, with SQL MATCH for |
| 13 | +graph patterns that require explicit hop control. |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +- Docker and Docker Compose |
| 18 | +- `curl` and `jq` |
| 19 | +- Java 21+ and Maven 3.x (for the Java demo) |
| 20 | + |
| 21 | +## Quickstart |
| 22 | + |
| 23 | +### 1. Start ArcadeDB |
| 24 | + |
| 25 | +```bash |
| 26 | +docker compose up -d |
| 27 | +``` |
| 28 | + |
| 29 | +### 2. Create database and load data |
| 30 | + |
| 31 | +```bash |
| 32 | +./setup.sh |
| 33 | +``` |
| 34 | + |
| 35 | +This creates the `Customer360` database, applies the schema, and inserts sample data. |
| 36 | + |
| 37 | +### 3a. Run queries via curl |
| 38 | + |
| 39 | +```bash |
| 40 | +./queries/queries.sh |
| 41 | +``` |
| 42 | + |
| 43 | +### 3b. Run queries via Java |
| 44 | + |
| 45 | +```bash |
| 46 | +cd java |
| 47 | +mvn package -q |
| 48 | +java -jar target/customer-360.jar |
| 49 | +``` |
| 50 | + |
| 51 | +## Schema |
| 52 | + |
| 53 | +| Type | Kind | Key properties | |
| 54 | +|------|------|----------------| |
| 55 | +| `Customer` | Vertex | `id`, `name`, `email`, `phone`, `status`, `prefVector`, `recentBehavior`, `baselineBehavior`, `lifetimeValue` | |
| 56 | +| `Household` | Vertex | `id`, `name` | |
| 57 | +| `Product` | Vertex | `id`, `name`, `category`, `price`, `embedding` | |
| 58 | +| `Device` | Vertex | `id`, `deviceType`, `os` | |
| 59 | +| `Address` | Vertex | `id`, `street`, `city`, `state`, `zip` | |
| 60 | +| `Ticket` | Vertex | `id`, `subject`, `status`, `content` | |
| 61 | +| `Campaign` | Vertex | `id`, `name`, `channel` | |
| 62 | +| `Session` | Vertex | `id`, `startedAt` | |
| 63 | +| `Event` | Vertex | `id`, `eventType`, `channel`, `page` | |
| 64 | +| `Identifier` | Vertex | `id`, `identifierType`, `identifierValue` | |
| 65 | +| `PURCHASED` | Edge | Customer -> Product (`purchasedAt`) | |
| 66 | +| `LIVES_AT` | Edge | Customer -> Address | |
| 67 | +| `USED` | Edge | Customer -> Device | |
| 68 | +| `MEMBER_OF` | Edge | Customer -> Household | |
| 69 | +| `OPENED` | Edge | Customer -> Ticket | |
| 70 | +| `CLICKED` | Edge | Customer -> Campaign | |
| 71 | +| `REFERRED` | Edge | Customer -> Customer | |
| 72 | +| `CONNECTED_TO` | Edge | Customer -> Customer | |
| 73 | +| `OBSERVED_IN` | Edge | Identifier -> Session | |
| 74 | +| `INTERACTED` | Edge | Customer -> Event | |
| 75 | +| `FOLLOWED_BY` | Edge | Event -> Event | |
| 76 | + |
| 77 | +The `Device`, `Address`, and `Campaign` types with their edges (`LIVES_AT`, `USED`, `CLICKED`) are populated in the sample data and available for extension but not exercised by the current queries. |
| 78 | + |
| 79 | +## Query Patterns |
| 80 | + |
| 81 | +| # | Pattern | Language | Description | |
| 82 | +|---|---------|----------|-------------| |
| 83 | +| 1 | Identity Resolution | SQL MATCH | 3-hop transitive link discovery via shared sessions | |
| 84 | +| 2 | Fuzzy Deduplication | Cypher | Cross-match customers by shared phone number | |
| 85 | +| 3 | Customer 360 View | Cypher | Unified profile: household, purchases, open tickets, LTV | |
| 86 | +| 4 | Churn Risk Scoring | SQL MATCH | Churned-neighbor ratio in social network | |
| 87 | +| 5 | Cross-Sell Recommendations | Cypher | Household + collaborative filtering | |
| 88 | +| 6 | Journey Path Analysis | Cypher | Conversion paths: ad_click -> page_view -> purchase | |
| 89 | + |
| 90 | +## Sample Data |
| 91 | + |
| 92 | +- 6 customers (4 active, 2 churned) with 8-dimensional preference vectors |
| 93 | +- 2 households, 6 products, 3 devices, 3 addresses |
| 94 | +- 6 identifiers and 3 sessions for identity resolution |
| 95 | +- 9 events forming 3 conversion paths |
| 96 | +- 3 support tickets (1 open, 2 closed) with full-text indexed content |
| 97 | +- Social graph edges (REFERRED, CONNECTED_TO) linking active to churned customers |
| 98 | + |
| 99 | +## ArcadeDB Version Notes |
| 100 | + |
| 101 | +This use case targets ArcadeDB **26.3.1**. Vector indexes use |
| 102 | +`LSM_VECTOR METADATA { dimensions: 8, similarity: 'COSINE' }`. |
| 103 | +Full-text search uses `FULL_TEXT` index on Ticket content. |
| 104 | + |
| 105 | +## Reference |
| 106 | + |
| 107 | +[ArcadeDB Customer 360 use case](https://arcadedb.com/customer-360.html) |
0 commit comments