├── .gitignore ├── README.md ├── basic ├── rag-model-basic-arrows.json ├── rag-model-basic.cypher └── rag-model-basic.png ├── combined ├── rag-model-combined-arrows.json ├── rag-model-combined.cypher └── rag-model-combined.png ├── parent-child ├── rag-model-parent-child-arrows.json ├── rag-model-parent-child.cypher └── rag-model-parent-child.png ├── questions ├── rag-model-question-matching-arrows.json ├── rag-model-question-matching.cypher └── rag-model-question-matching.png └── topics-summaries ├── rag-model-topics-summaries-arrows.json ├── rag-model-topics-summaries.cypher └── rag-model-topics-summaries.png /.gitignore: -------------------------------------------------------------------------------- 1 | images/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Graph Data Models for RAG Applications 2 | 3 | Each folder contains the following 4 | - JSON representation of the data model 5 | - Cypher code to generate the data model in Neo4j 6 | - Image of the data model 7 | 8 | These files may be used as a foundation for projects and may be modified in the following ways 9 | 10 | ## arrows.app 11 | - Navigate to arrows.app in your web browser 12 | - import the provided JSON file 13 | - Manipulate the data model 14 | - Export new data model as needed 15 | 16 | ## Neo4j 17 | - Create a new Neo4j database 18 | - Open a Neo4j browser window 19 | - Copy the cypher file content into a cypher cell and run 20 | - Explore your data model 21 | -------------------------------------------------------------------------------- /basic/rag-model-basic-arrows.json: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": [ 3 | { 4 | "id": "n0", 5 | "position": { 6 | "x": -87, 7 | "y": -6 8 | }, 9 | "caption": "", 10 | "labels": [ 11 | "Source" 12 | ], 13 | "properties": { 14 | "id": "String", 15 | "url": "String" 16 | }, 17 | "style": { 18 | "outside-position": "bottom" 19 | } 20 | }, 21 | { 22 | "id": "n1", 23 | "position": { 24 | "x": 325.27696985039904, 25 | "y": -6 26 | }, 27 | "caption": "", 28 | "labels": [ 29 | "Document" 30 | ], 31 | "properties": { 32 | "id": "String", 33 | "text": "String", 34 | "embedding": "List" 35 | }, 36 | "style": { 37 | "outside-position": "bottom", 38 | "node-color": "#aea1ff" 39 | } 40 | } 41 | ], 42 | "relationships": [ 43 | { 44 | "id": "n0", 45 | "fromId": "n0", 46 | "toId": "n1", 47 | "type": "HAS_DOCUMENT", 48 | "properties": {}, 49 | "style": { 50 | "detail-position": "inline" 51 | } 52 | } 53 | ], 54 | "style": { 55 | "font-family": "Nunito Sans", 56 | "background-color": "#F2F2F2", 57 | "background-image": "", 58 | "background-size": "100%", 59 | "node-color": "#4C8EDA", 60 | "border-width": 0, 61 | "border-color": "#000000", 62 | "radius": 75, 63 | "node-padding": 5, 64 | "node-margin": 2, 65 | "outside-position": "auto", 66 | "node-icon-image": "", 67 | "node-background-image": "", 68 | "icon-position": "inside", 69 | "icon-size": 64, 70 | "caption-position": "inside", 71 | "caption-max-width": 200, 72 | "caption-color": "#ffffff", 73 | "caption-font-size": 20, 74 | "caption-font-weight": "normal", 75 | "label-position": "inside", 76 | "label-display": "bare", 77 | "label-color": "#ffffff", 78 | "label-background-color": "#848484", 79 | "label-border-color": "#848484", 80 | "label-border-width": 3, 81 | "label-font-size": 20, 82 | "label-padding": 5, 83 | "label-margin": 4, 84 | "directionality": "directed", 85 | "detail-position": "above", 86 | "detail-orientation": "parallel", 87 | "arrow-width": 3, 88 | "arrow-color": "#848484", 89 | "margin-start": 5, 90 | "margin-end": 5, 91 | "margin-peer": 20, 92 | "attachment-start": "normal", 93 | "attachment-end": "normal", 94 | "relationship-icon-image": "", 95 | "type-color": "#848484", 96 | "type-background-color": "#F2F2F2", 97 | "type-border-color": "#848484", 98 | "type-border-width": 0, 99 | "type-font-size": 21, 100 | "type-padding": 5, 101 | "property-position": "outside", 102 | "property-alignment": "colon", 103 | "property-color": "#848484", 104 | "property-font-size": 20, 105 | "property-font-weight": "normal" 106 | } 107 | } -------------------------------------------------------------------------------- /basic/rag-model-basic.cypher: -------------------------------------------------------------------------------- 1 | CREATE (:Source {id: "String", url: "String"})-[:HAS_DOCUMENT]->(:Document {id: "String", text: "String", embedding: "List"}) -------------------------------------------------------------------------------- /basic/rag-model-basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a-s-g93/rag-graph-data-models/21ee8edf951204b4d0b920a810e8198b2dfb3c7d/basic/rag-model-basic.png -------------------------------------------------------------------------------- /combined/rag-model-combined-arrows.json: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": [ 3 | { 4 | "id": "n0", 5 | "position": { 6 | "x": -86.99999999999989, 7 | "y": -364.1498517168552 8 | }, 9 | "caption": "", 10 | "labels": [ 11 | "Source" 12 | ], 13 | "properties": { 14 | "id": "String", 15 | "url": "String" 16 | }, 17 | "style": { 18 | "outside-position": "top" 19 | } 20 | }, 21 | { 22 | "id": "n2", 23 | "position": { 24 | "x": 258.8476694566224, 25 | "y": -185.0749258584276 26 | }, 27 | "caption": "", 28 | "labels": [ 29 | "Parent", 30 | "Document" 31 | ], 32 | "properties": { 33 | "id": "String", 34 | "text": "String" 35 | }, 36 | "style": { 37 | "node-color": "#aea1ff", 38 | "outside-position": "top" 39 | } 40 | }, 41 | { 42 | "id": "n3", 43 | "position": { 44 | "x": 604.6953389132448, 45 | "y": -364.1498517168552 46 | }, 47 | "caption": "", 48 | "labels": [ 49 | "Summary" 50 | ], 51 | "properties": { 52 | "id": "String", 53 | "text": "String" 54 | }, 55 | "style": { 56 | "node-color": "#0c797d" 57 | } 58 | }, 59 | { 60 | "id": "n4", 61 | "position": { 62 | "x": 950.5430083698673, 63 | "y": -185.0749258584276 64 | }, 65 | "caption": "", 66 | "labels": [ 67 | "Topic" 68 | ], 69 | "properties": { 70 | "id": "String", 71 | "text": "String", 72 | "embedding": "List" 73 | }, 74 | "style": { 75 | "outside-position": "bottom", 76 | "node-color": "#68bc00" 77 | } 78 | }, 79 | { 80 | "id": "n5", 81 | "position": { 82 | "x": 258.8476694566224, 83 | "y": 204.38423700692147 84 | }, 85 | "caption": "", 86 | "labels": [ 87 | "Response" 88 | ], 89 | "properties": { 90 | "id": "String", 91 | "content": "String", 92 | "rating": "int" 93 | }, 94 | "style": { 95 | "node-color": "#68ccca" 96 | } 97 | }, 98 | { 99 | "id": "n6", 100 | "position": { 101 | "x": -87, 102 | "y": 204.38423700692147 103 | }, 104 | "caption": "", 105 | "labels": [ 106 | "Question", 107 | "UserGenerated" 108 | ], 109 | "properties": { 110 | "id": "String", 111 | "content": "String", 112 | "embedding": "List" 113 | }, 114 | "style": { 115 | "node-color": "#ab149e", 116 | "outside-position": "bottom" 117 | } 118 | }, 119 | { 120 | "id": "n7", 121 | "position": { 122 | "x": 604.6953389132448, 123 | "y": -5.999999999999943 124 | }, 125 | "caption": "", 126 | "labels": [ 127 | "Child", 128 | "Document" 129 | ], 130 | "properties": { 131 | "id": "String", 132 | "text": "String", 133 | "embedding": "List" 134 | }, 135 | "style": { 136 | "node-color": "#7b64ff", 137 | "outside-position": "bottom" 138 | } 139 | }, 140 | { 141 | "id": "n8", 142 | "position": { 143 | "x": -87, 144 | "y": -6 145 | }, 146 | "caption": "", 147 | "labels": [ 148 | "Question", 149 | "LLMGenerated" 150 | ], 151 | "properties": { 152 | "id": "String", 153 | "content": "String", 154 | "embedding": "List" 155 | }, 156 | "style": { 157 | "node-color": "#ab149e", 158 | "outside-position": "bottom-right" 159 | } 160 | } 161 | ], 162 | "relationships": [ 163 | { 164 | "id": "n0", 165 | "fromId": "n0", 166 | "toId": "n2", 167 | "type": "HAS_DOCUMENT", 168 | "properties": {}, 169 | "style": { 170 | "detail-position": "inline", 171 | "detail-orientation": "horizontal" 172 | } 173 | }, 174 | { 175 | "id": "n1", 176 | "fromId": "n2", 177 | "toId": "n3", 178 | "type": "HAS_SUMMARY", 179 | "properties": {}, 180 | "style": { 181 | "detail-position": "inline", 182 | "detail-orientation": "horizontal" 183 | } 184 | }, 185 | { 186 | "id": "n2", 187 | "fromId": "n3", 188 | "toId": "n4", 189 | "type": "HAS_TOPIC", 190 | "properties": {}, 191 | "style": { 192 | "detail-position": "inline", 193 | "detail-orientation": "horizontal" 194 | } 195 | }, 196 | { 197 | "id": "n3", 198 | "fromId": "n2", 199 | "toId": "n4", 200 | "type": "HAS_TOPIC", 201 | "properties": {}, 202 | "style": { 203 | "detail-position": "inline", 204 | "detail-orientation": "horizontal" 205 | } 206 | }, 207 | { 208 | "id": "n4", 209 | "fromId": "n5", 210 | "toId": "n2", 211 | "type": "HAS_CONTEXT", 212 | "properties": {}, 213 | "style": { 214 | "detail-position": "inline", 215 | "detail-orientation": "horizontal" 216 | } 217 | }, 218 | { 219 | "id": "n5", 220 | "fromId": "n6", 221 | "toId": "n5", 222 | "type": "NEXT", 223 | "properties": {}, 224 | "style": { 225 | "detail-position": "inline", 226 | "detail-orientation": "horizontal" 227 | } 228 | }, 229 | { 230 | "id": "n6", 231 | "fromId": "n2", 232 | "toId": "n7", 233 | "type": "HAS_CHILD", 234 | "properties": {}, 235 | "style": { 236 | "detail-position": "inline", 237 | "detail-orientation": "horizontal" 238 | } 239 | }, 240 | { 241 | "id": "n7", 242 | "fromId": "n2", 243 | "toId": "n8", 244 | "type": "HAS_QUESTION", 245 | "properties": {}, 246 | "style": { 247 | "detail-position": "inline", 248 | "detail-orientation": "horizontal" 249 | } 250 | } 251 | ], 252 | "style": { 253 | "font-family": "Nunito Sans", 254 | "background-color": "#F2F2F2", 255 | "background-image": "", 256 | "background-size": "100%", 257 | "node-color": "#4C8EDA", 258 | "border-width": 0, 259 | "border-color": "#000000", 260 | "radius": 75, 261 | "node-padding": 5, 262 | "node-margin": 2, 263 | "outside-position": "auto", 264 | "node-icon-image": "", 265 | "node-background-image": "", 266 | "icon-position": "inside", 267 | "icon-size": 64, 268 | "caption-position": "inside", 269 | "caption-max-width": 200, 270 | "caption-color": "#ffffff", 271 | "caption-font-size": 20, 272 | "caption-font-weight": "normal", 273 | "label-position": "inside", 274 | "label-display": "bare", 275 | "label-color": "#ffffff", 276 | "label-background-color": "#848484", 277 | "label-border-color": "#848484", 278 | "label-border-width": 3, 279 | "label-font-size": 20, 280 | "label-padding": 5, 281 | "label-margin": 4, 282 | "directionality": "directed", 283 | "detail-position": "above", 284 | "detail-orientation": "parallel", 285 | "arrow-width": 3, 286 | "arrow-color": "#848484", 287 | "margin-start": 5, 288 | "margin-end": 5, 289 | "margin-peer": 20, 290 | "attachment-start": "normal", 291 | "attachment-end": "normal", 292 | "relationship-icon-image": "", 293 | "type-color": "#848484", 294 | "type-background-color": "#F2F2F2", 295 | "type-border-color": "#848484", 296 | "type-border-width": 0, 297 | "type-font-size": 21, 298 | "type-padding": 5, 299 | "property-position": "outside", 300 | "property-alignment": "colon", 301 | "property-color": "#848484", 302 | "property-font-size": 20, 303 | "property-font-weight": "normal" 304 | } 305 | } -------------------------------------------------------------------------------- /combined/rag-model-combined.cypher: -------------------------------------------------------------------------------- 1 | CREATE (:Source {id: "String", url: "String"})-[:HAS_DOCUMENT]->(n2:Parent:Document {id: "String", text: "String"})-[:HAS_SUMMARY]->(:Summary {id: "String", text: "String"})-[:HAS_TOPIC]->(:Topic {id: "String", text: "String", embedding: "List"})<-[:HAS_TOPIC]-(n2)<-[:HAS_CONTEXT]-(:Response {id: "String", content: "String", rating: "int"})<-[:NEXT]-(:Question:UserGenerated {id: "String", content: "String", embedding: "List"}), 2 | (:Question:LLMGenerated {id: "String", content: "String", embedding: "List"})<-[:HAS_QUESTION]-(n2)-[:HAS_CHILD]->(:Child:Document {id: "String", text: "String", embedding: "List"}) -------------------------------------------------------------------------------- /combined/rag-model-combined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a-s-g93/rag-graph-data-models/21ee8edf951204b4d0b920a810e8198b2dfb3c7d/combined/rag-model-combined.png -------------------------------------------------------------------------------- /parent-child/rag-model-parent-child-arrows.json: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": [ 3 | { 4 | "id": "n0", 5 | "position": { 6 | "x": -87, 7 | "y": -6 8 | }, 9 | "caption": "", 10 | "labels": [ 11 | "Source" 12 | ], 13 | "properties": { 14 | "id": "String", 15 | "url": "String" 16 | }, 17 | "style": { 18 | "outside-position": "bottom" 19 | } 20 | }, 21 | { 22 | "id": "n1", 23 | "position": { 24 | "x": 237.58302643029094, 25 | "y": -193.3980976839119 26 | }, 27 | "caption": "", 28 | "labels": [ 29 | "Parent", 30 | "Document" 31 | ], 32 | "properties": { 33 | "id": "String", 34 | "text": "String" 35 | }, 36 | "style": { 37 | "outside-position": "bottom", 38 | "node-color": "#aea1ff" 39 | } 40 | }, 41 | { 42 | "id": "n2", 43 | "position": { 44 | "x": 562.1660528605819, 45 | "y": -6 46 | }, 47 | "caption": "", 48 | "labels": [ 49 | "Child", 50 | "Document" 51 | ], 52 | "properties": { 53 | "id": "String", 54 | "text": "String", 55 | "embedding": "List" 56 | }, 57 | "style": { 58 | "node-color": "#7b64ff", 59 | "outside-position": "bottom" 60 | } 61 | } 62 | ], 63 | "relationships": [ 64 | { 65 | "id": "n0", 66 | "fromId": "n0", 67 | "toId": "n1", 68 | "type": "HAS_DOCUMENT", 69 | "properties": {}, 70 | "style": { 71 | "detail-position": "inline", 72 | "detail-orientation": "horizontal" 73 | } 74 | }, 75 | { 76 | "id": "n1", 77 | "fromId": "n1", 78 | "toId": "n2", 79 | "type": "HAS_CHILD", 80 | "properties": {}, 81 | "style": { 82 | "detail-position": "inline", 83 | "detail-orientation": "horizontal" 84 | } 85 | } 86 | ], 87 | "style": { 88 | "font-family": "Nunito Sans", 89 | "background-color": "#F2F2F2", 90 | "background-image": "", 91 | "background-size": "100%", 92 | "node-color": "#4C8EDA", 93 | "border-width": 0, 94 | "border-color": "#000000", 95 | "radius": 75, 96 | "node-padding": 5, 97 | "node-margin": 2, 98 | "outside-position": "auto", 99 | "node-icon-image": "", 100 | "node-background-image": "", 101 | "icon-position": "inside", 102 | "icon-size": 64, 103 | "caption-position": "inside", 104 | "caption-max-width": 200, 105 | "caption-color": "#ffffff", 106 | "caption-font-size": 20, 107 | "caption-font-weight": "normal", 108 | "label-position": "inside", 109 | "label-display": "bare", 110 | "label-color": "#ffffff", 111 | "label-background-color": "#848484", 112 | "label-border-color": "#848484", 113 | "label-border-width": 3, 114 | "label-font-size": 20, 115 | "label-padding": 5, 116 | "label-margin": 4, 117 | "directionality": "directed", 118 | "detail-position": "above", 119 | "detail-orientation": "parallel", 120 | "arrow-width": 3, 121 | "arrow-color": "#848484", 122 | "margin-start": 5, 123 | "margin-end": 5, 124 | "margin-peer": 20, 125 | "attachment-start": "normal", 126 | "attachment-end": "normal", 127 | "relationship-icon-image": "", 128 | "type-color": "#848484", 129 | "type-background-color": "#F2F2F2", 130 | "type-border-color": "#848484", 131 | "type-border-width": 0, 132 | "type-font-size": 21, 133 | "type-padding": 5, 134 | "property-position": "outside", 135 | "property-alignment": "colon", 136 | "property-color": "#848484", 137 | "property-font-size": 20, 138 | "property-font-weight": "normal" 139 | } 140 | } -------------------------------------------------------------------------------- /parent-child/rag-model-parent-child.cypher: -------------------------------------------------------------------------------- 1 | CREATE (:Source {id: "String", url: "String"})-[:HAS_DOCUMENT]->(:Parent:Document {id: "String", text: "String"})-[:HAS_CHILD]->(:Child:Document {id: "String", text: "String", embedding: "List"}) -------------------------------------------------------------------------------- /parent-child/rag-model-parent-child.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a-s-g93/rag-graph-data-models/21ee8edf951204b4d0b920a810e8198b2dfb3c7d/parent-child/rag-model-parent-child.png -------------------------------------------------------------------------------- /questions/rag-model-question-matching-arrows.json: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": [ 3 | { 4 | "id": "n0", 5 | "position": { 6 | "x": -130.6114934087267, 7 | "y": -185.0749258584276 8 | }, 9 | "caption": "", 10 | "labels": [ 11 | "Source" 12 | ], 13 | "properties": { 14 | "id": "String", 15 | "url": "String" 16 | }, 17 | "style": { 18 | "outside-position": "bottom" 19 | } 20 | }, 21 | { 22 | "id": "n2", 23 | "position": { 24 | "x": 258.8476694566224, 25 | "y": -185.0749258584276 26 | }, 27 | "caption": "", 28 | "labels": [ 29 | "Document" 30 | ], 31 | "properties": { 32 | "id": "String", 33 | "text": "String" 34 | }, 35 | "style": { 36 | "node-color": "#aea1ff", 37 | "outside-position": "top" 38 | } 39 | }, 40 | { 41 | "id": "n3", 42 | "position": { 43 | "x": 648.3068323219715, 44 | "y": -185.0749258584276 45 | }, 46 | "caption": "", 47 | "labels": [ 48 | "Question", 49 | "LLMGenerated" 50 | ], 51 | "properties": { 52 | "id": "String", 53 | "text": "String", 54 | "embedding": "List" 55 | }, 56 | "style": { 57 | "node-color": "#ab149e", 58 | "outside-position": "bottom" 59 | } 60 | }, 61 | { 62 | "id": "n4", 63 | "position": { 64 | "x": 258.8476694566224, 65 | "y": 204.3842370069216 66 | }, 67 | "caption": "", 68 | "labels": [ 69 | "Response" 70 | ], 71 | "properties": { 72 | "id": "String", 73 | "content": "String", 74 | "rating": "int" 75 | }, 76 | "style": { 77 | "node-color": "#68ccca" 78 | } 79 | }, 80 | { 81 | "id": "n5", 82 | "position": { 83 | "x": -130.6114934087267, 84 | "y": 204.38424635098343 85 | }, 86 | "caption": "", 87 | "labels": [ 88 | "Question", 89 | "UserGenerated" 90 | ], 91 | "properties": { 92 | "id": "String", 93 | "content": "String", 94 | "embedding": "List" 95 | }, 96 | "style": { 97 | "outside-position": "top", 98 | "node-color": "#ab149e" 99 | } 100 | } 101 | ], 102 | "relationships": [ 103 | { 104 | "id": "n0", 105 | "fromId": "n0", 106 | "toId": "n2", 107 | "type": "HAS_DOCUMENT", 108 | "properties": {}, 109 | "style": { 110 | "detail-position": "inline" 111 | } 112 | }, 113 | { 114 | "id": "n1", 115 | "fromId": "n2", 116 | "toId": "n3", 117 | "type": "HAS_QUESTION", 118 | "properties": {}, 119 | "style": { 120 | "detail-position": "inline" 121 | } 122 | }, 123 | { 124 | "id": "n2", 125 | "fromId": "n4", 126 | "toId": "n2", 127 | "type": "HAS_CONTEXT", 128 | "properties": {}, 129 | "style": { 130 | "detail-orientation": "horizontal", 131 | "detail-position": "inline" 132 | } 133 | }, 134 | { 135 | "id": "n3", 136 | "fromId": "n5", 137 | "toId": "n4", 138 | "type": "NEXT", 139 | "properties": {}, 140 | "style": { 141 | "detail-position": "inline" 142 | } 143 | } 144 | ], 145 | "style": { 146 | "font-family": "Nunito Sans", 147 | "background-color": "#F2F2F2", 148 | "background-image": "", 149 | "background-size": "100%", 150 | "node-color": "#4C8EDA", 151 | "border-width": 0, 152 | "border-color": "#000000", 153 | "radius": 75, 154 | "node-padding": 5, 155 | "node-margin": 2, 156 | "outside-position": "auto", 157 | "node-icon-image": "", 158 | "node-background-image": "", 159 | "icon-position": "inside", 160 | "icon-size": 64, 161 | "caption-position": "inside", 162 | "caption-max-width": 200, 163 | "caption-color": "#ffffff", 164 | "caption-font-size": 20, 165 | "caption-font-weight": "normal", 166 | "label-position": "inside", 167 | "label-display": "bare", 168 | "label-color": "#ffffff", 169 | "label-background-color": "#848484", 170 | "label-border-color": "#848484", 171 | "label-border-width": 3, 172 | "label-font-size": 20, 173 | "label-padding": 5, 174 | "label-margin": 4, 175 | "directionality": "directed", 176 | "detail-position": "above", 177 | "detail-orientation": "parallel", 178 | "arrow-width": 3, 179 | "arrow-color": "#848484", 180 | "margin-start": 5, 181 | "margin-end": 5, 182 | "margin-peer": 20, 183 | "attachment-start": "normal", 184 | "attachment-end": "normal", 185 | "relationship-icon-image": "", 186 | "type-color": "#848484", 187 | "type-background-color": "#F2F2F2", 188 | "type-border-color": "#848484", 189 | "type-border-width": 0, 190 | "type-font-size": 21, 191 | "type-padding": 5, 192 | "property-position": "outside", 193 | "property-alignment": "colon", 194 | "property-color": "#848484", 195 | "property-font-size": 20, 196 | "property-font-weight": "normal" 197 | } 198 | } -------------------------------------------------------------------------------- /questions/rag-model-question-matching.cypher: -------------------------------------------------------------------------------- 1 | CREATE (:Source {id: "String", url: "String"})-[:HAS_DOCUMENT]->(n2:Document {id: "String", text: "String"})-[:HAS_QUESTION]->(:Question:LLMGenerated {id: "String", text: "String", embedding: "List"}), 2 | (:Question:UserGenerated {id: "String", content: "String", embedding: "List"})-[:NEXT]->(:Response {id: "String", content: "String", rating: "int"})-[:HAS_CONTEXT]->(n2) -------------------------------------------------------------------------------- /questions/rag-model-question-matching.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a-s-g93/rag-graph-data-models/21ee8edf951204b4d0b920a810e8198b2dfb3c7d/questions/rag-model-question-matching.png -------------------------------------------------------------------------------- /topics-summaries/rag-model-topics-summaries-arrows.json: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": [ 3 | { 4 | "id": "n0", 5 | "position": { 6 | "x": -87, 7 | "y": -6 8 | }, 9 | "caption": "", 10 | "labels": [ 11 | "Source" 12 | ], 13 | "properties": { 14 | "id": "String", 15 | "url": "String" 16 | }, 17 | "style": { 18 | "outside-position": "bottom" 19 | } 20 | }, 21 | { 22 | "id": "n2", 23 | "position": { 24 | "x": 258.8476694566224, 25 | "y": -185.0749258584276 26 | }, 27 | "caption": "", 28 | "labels": [ 29 | "Document" 30 | ], 31 | "properties": { 32 | "id": "String", 33 | "text": "String" 34 | }, 35 | "style": { 36 | "node-color": "#aea1ff", 37 | "outside-position": "bottom" 38 | } 39 | }, 40 | { 41 | "id": "n3", 42 | "position": { 43 | "x": 604.6953389132448, 44 | "y": -6 45 | }, 46 | "caption": "", 47 | "labels": [ 48 | "Summary" 49 | ], 50 | "properties": { 51 | "id": "String", 52 | "text": "String" 53 | }, 54 | "style": { 55 | "node-color": "#0c797d" 56 | } 57 | }, 58 | { 59 | "id": "n4", 60 | "position": { 61 | "x": 950.5430083698673, 62 | "y": -185.0749258584276 63 | }, 64 | "caption": "", 65 | "labels": [ 66 | "Topic" 67 | ], 68 | "properties": { 69 | "id": "String", 70 | "text": "String", 71 | "embedding": "List" 72 | }, 73 | "style": { 74 | "outside-position": "top", 75 | "node-color": "#68bc00" 76 | } 77 | } 78 | ], 79 | "relationships": [ 80 | { 81 | "id": "n0", 82 | "fromId": "n0", 83 | "toId": "n2", 84 | "type": "HAS_DOCUMENT", 85 | "properties": {}, 86 | "style": { 87 | "detail-position": "inline", 88 | "detail-orientation": "horizontal" 89 | } 90 | }, 91 | { 92 | "id": "n1", 93 | "fromId": "n2", 94 | "toId": "n3", 95 | "type": "HAS_SUMMARY", 96 | "properties": {}, 97 | "style": { 98 | "detail-position": "inline", 99 | "detail-orientation": "horizontal" 100 | } 101 | }, 102 | { 103 | "id": "n2", 104 | "fromId": "n3", 105 | "toId": "n4", 106 | "type": "HAS_TOPIC", 107 | "properties": {}, 108 | "style": { 109 | "detail-position": "inline", 110 | "detail-orientation": "horizontal" 111 | } 112 | }, 113 | { 114 | "id": "n3", 115 | "fromId": "n2", 116 | "toId": "n4", 117 | "type": "HAS_TOPIC", 118 | "properties": {}, 119 | "style": { 120 | "detail-position": "inline", 121 | "detail-orientation": "horizontal" 122 | } 123 | }, 124 | { 125 | "id": "n4", 126 | "fromId": "n2", 127 | "toId": "n2", 128 | "type": "IS_SIMILAR", 129 | "properties": { 130 | "score": "float" 131 | }, 132 | "style": { 133 | "attachment-start": "left", 134 | "attachment-end": "top", 135 | "detail-position": "inline" 136 | } 137 | } 138 | ], 139 | "style": { 140 | "font-family": "Nunito Sans", 141 | "background-color": "#F2F2F2", 142 | "background-image": "", 143 | "background-size": "100%", 144 | "node-color": "#4C8EDA", 145 | "border-width": 0, 146 | "border-color": "#000000", 147 | "radius": 75, 148 | "node-padding": 5, 149 | "node-margin": 2, 150 | "outside-position": "auto", 151 | "node-icon-image": "", 152 | "node-background-image": "", 153 | "icon-position": "inside", 154 | "icon-size": 64, 155 | "caption-position": "inside", 156 | "caption-max-width": 200, 157 | "caption-color": "#ffffff", 158 | "caption-font-size": 20, 159 | "caption-font-weight": "normal", 160 | "label-position": "inside", 161 | "label-display": "bare", 162 | "label-color": "#ffffff", 163 | "label-background-color": "#848484", 164 | "label-border-color": "#848484", 165 | "label-border-width": 3, 166 | "label-font-size": 20, 167 | "label-padding": 5, 168 | "label-margin": 4, 169 | "directionality": "directed", 170 | "detail-position": "above", 171 | "detail-orientation": "parallel", 172 | "arrow-width": 3, 173 | "arrow-color": "#848484", 174 | "margin-start": 5, 175 | "margin-end": 5, 176 | "margin-peer": 20, 177 | "attachment-start": "normal", 178 | "attachment-end": "normal", 179 | "relationship-icon-image": "", 180 | "type-color": "#848484", 181 | "type-background-color": "#F2F2F2", 182 | "type-border-color": "#848484", 183 | "type-border-width": 0, 184 | "type-font-size": 21, 185 | "type-padding": 5, 186 | "property-position": "outside", 187 | "property-alignment": "colon", 188 | "property-color": "#848484", 189 | "property-font-size": 20, 190 | "property-font-weight": "normal" 191 | } 192 | } -------------------------------------------------------------------------------- /topics-summaries/rag-model-topics-summaries.cypher: -------------------------------------------------------------------------------- 1 | CREATE (:Source {id: "String", url: "String"})-[:HAS_DOCUMENT]->(n2:Document {id: "String", text: "String"})-[:HAS_SUMMARY]->(:Summary {id: "String", text: "String"})-[:HAS_TOPIC]->(:Topic {id: "String", text: "String", embedding: "List"})<-[:HAS_TOPIC]-(n2)-[:IS_SIMILAR {score: "float"}]->(n2) -------------------------------------------------------------------------------- /topics-summaries/rag-model-topics-summaries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/a-s-g93/rag-graph-data-models/21ee8edf951204b4d0b920a810e8198b2dfb3c7d/topics-summaries/rag-model-topics-summaries.png --------------------------------------------------------------------------------