Orensomekh commited on
Commit
1232fcb
·
verified ·
1 Parent(s): 28c454e

Upload 9 files

Browse files
.gitattributes CHANGED
@@ -35,3 +35,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  LiveRAG_banner[[:space:]](1).jpg filter=lfs diff=lfs merge=lfs -text
37
  LiveRAG_banner.jpg filter=lfs diff=lfs merge=lfs -text
 
 
 
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  LiveRAG_banner[[:space:]](1).jpg filter=lfs diff=lfs merge=lfs -text
37
  LiveRAG_banner.jpg filter=lfs diff=lfs merge=lfs -text
38
+ Operational_Instructions/DM_gen_proc_fig[[:space:]](1).png filter=lfs diff=lfs merge=lfs -text
39
+ Operational_Instructions/Generating_Diverse_Q%26A_Benchmarks_for_RAG_Evaluation_with_DataMorgana.pdf filter=lfs diff=lfs merge=lfs -text
Operational_Instructions/DM_API_usage_example (1).ipynb ADDED
@@ -0,0 +1,369 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "**DataMorgana** is a powerful tool for generating synthetic question-answering data, useful for both evaluating and training question-answering systems.\n",
8
+ "\n",
9
+ "If you're using DataMorgana for the first time, it's recommended to start with the [DataMorgana Sandbox](https://platform.ai71.ai/playground). The Sandbox provides an intuitive UI for generating individual question-answer pairs interactively.\n",
10
+ "\n",
11
+ "In this notebook, we'll explore how to use the DataMorgana API to generate large-scale synthetic question-answering data on FineWeb.\n",
12
+ "\n",
13
+ "For the full API documentation, refer to [this link](https://api.ai71.ai/redoc#tag/Synthetic-Conversations)."
14
+ ]
15
+ },
16
+ {
17
+ "cell_type": "code",
18
+ "execution_count": 11,
19
+ "metadata": {},
20
+ "outputs": [],
21
+ "source": [
22
+ "import json\n",
23
+ "import time\n",
24
+ "from typing import Dict, List\n",
25
+ "\n",
26
+ "import requests\n",
27
+ "\n",
28
+ "BASE_URL = \"https://api.ai71.ai/v1/\""
29
+ ]
30
+ },
31
+ {
32
+ "cell_type": "markdown",
33
+ "metadata": {},
34
+ "source": [
35
+ "First, ensure that you have an API key for the AI71 platform."
36
+ ]
37
+ },
38
+ {
39
+ "cell_type": "code",
40
+ "execution_count": 12,
41
+ "metadata": {},
42
+ "outputs": [],
43
+ "source": [
44
+ "API_KEY = # Your API key"
45
+ ]
46
+ },
47
+ {
48
+ "cell_type": "markdown",
49
+ "metadata": {},
50
+ "source": [
51
+ "The generation of the data is done using LLMs, which is costly. Therefore, you will have a limited amount of credits - each credit corresponds to a single generated question. \n",
52
+ "\n",
53
+ "You can use the `check_budget` endpoint to see the remaining credits for your organization."
54
+ ]
55
+ },
56
+ {
57
+ "cell_type": "code",
58
+ "execution_count": 13,
59
+ "metadata": {},
60
+ "outputs": [],
61
+ "source": [
62
+ "def check_budget():\n",
63
+ " resp = requests.get(\n",
64
+ " f\"{BASE_URL}check_budget\",\n",
65
+ " headers={\"Authorization\": f\"Bearer {API_KEY}\"},\n",
66
+ " )\n",
67
+ " resp.raise_for_status()\n",
68
+ " print(json.dumps(resp.json(), indent=4))"
69
+ ]
70
+ },
71
+ {
72
+ "cell_type": "code",
73
+ "execution_count": 14,
74
+ "metadata": {},
75
+ "outputs": [
76
+ {
77
+ "name": "stdout",
78
+ "output_type": "stream",
79
+ "text": [
80
+ "{\n",
81
+ " \"remaining_budget\": 9987\n",
82
+ "}\n"
83
+ ]
84
+ }
85
+ ],
86
+ "source": [
87
+ "check_budget()"
88
+ ]
89
+ },
90
+ {
91
+ "cell_type": "markdown",
92
+ "metadata": {},
93
+ "source": [
94
+ "Now, let's see how to generate questions using the `bulk_generation endpoint`.\n",
95
+ "\n",
96
+ "This endpoint accepts three arguments: `n_questions`, `question_categorizations`, and `user_categorizations`.\n",
97
+ "\n",
98
+ "Since the endpoint is **asynchronous**, it returns only a `request_id`. To retrieve the generated questions once they are ready, we need to use the `fetch_generation_results` endpoint with the corresponding `request_id`."
99
+ ]
100
+ },
101
+ {
102
+ "cell_type": "code",
103
+ "execution_count": 31,
104
+ "metadata": {},
105
+ "outputs": [],
106
+ "source": [
107
+ "def bulk_generate(n_questions: int, question_categorizations: List[Dict], user_categorizations: List[Dict]):\n",
108
+ " resp = requests.post(\n",
109
+ " f\"{BASE_URL}bulk_generation\",\n",
110
+ " headers={\"Authorization\": f\"Bearer {API_KEY}\"},\n",
111
+ " json={\n",
112
+ " \"n_questions\": n_questions,\n",
113
+ " \"question_categorizations\": question_categorizations,\n",
114
+ " \"user_categorizations\": user_categorizations\n",
115
+ " }\n",
116
+ " )\n",
117
+ " resp.raise_for_status()\n",
118
+ " request_id = resp.json()[\"request_id\"]\n",
119
+ " print(json.dumps(resp.json(), indent=4))\n",
120
+ "\n",
121
+ " result = wait_for_generation_to_finish(request_id)\n",
122
+ " return result\n",
123
+ "\n",
124
+ "\n",
125
+ "def wait_for_generation_to_finish(request_id: str):\n",
126
+ " while True:\n",
127
+ " resp = requests.get(\n",
128
+ " f\"{BASE_URL}fetch_generation_results\",\n",
129
+ " headers={\"Authorization\": f\"Bearer {API_KEY}\"},\n",
130
+ " params={\"request_id\": request_id},\n",
131
+ " )\n",
132
+ " resp.raise_for_status()\n",
133
+ " if resp.json()[\"status\"] == \"completed\":\n",
134
+ " print(json.dumps(resp.json(), indent=4))\n",
135
+ " return resp.json()\n",
136
+ " else:\n",
137
+ " print(\"Waiting for generation to finish...\")\n",
138
+ " time.sleep(5)"
139
+ ]
140
+ },
141
+ {
142
+ "cell_type": "markdown",
143
+ "metadata": {},
144
+ "source": [
145
+ "Let's call the `bulk_generation` endpoint. In this example, we will define two question categorizations and one user categorization. \n",
146
+ "\n",
147
+ "When defining categorizations, keep in mind: \n",
148
+ "\n",
149
+ "- You can create your own categorizations—these are just examples. \n",
150
+ "- Each categorization can include as many categories as you like, as long as their probabilities sum to 1. \n",
151
+ "- The **descriptions** of the categories are injected into the LLM prompt during question generation. To ensure high-quality outputs, it’s important to write them clearly and thoughtfully. \n",
152
+ "\n",
153
+ "For the competition, you’ll want to evaluate and train your system on a diverse set of questions, since you won’t know in advance what types of questions will appear in the test. Keep in mind that the categorizations used in this notebook are just examples and will not correspond to those used to generate the actual test set."
154
+ ]
155
+ },
156
+ {
157
+ "cell_type": "code",
158
+ "execution_count": 28,
159
+ "metadata": {},
160
+ "outputs": [],
161
+ "source": [
162
+ "question_length_categorization = {\n",
163
+ " \"categorization_name\": \"question_length\",\n",
164
+ " \"categories\": [\n",
165
+ " {\n",
166
+ " \"name\": \"short\",\n",
167
+ " \"description\": \"a short question with no more than 6 words.\",\n",
168
+ " \"probability\": 0.4\n",
169
+ " },\n",
170
+ " {\n",
171
+ " \"name\": \"long\",\n",
172
+ " \"description\": \"a long question with at least 7 words.\",\n",
173
+ " \"probability\": 0.6\n",
174
+ " }\n",
175
+ " ]\n",
176
+ "}\n",
177
+ "\n",
178
+ "question_formulation_categorization = {\n",
179
+ " \"categorization_name\": \"question_formulation\",\n",
180
+ " \"categories\": [\n",
181
+ " {\n",
182
+ " \"name\": \"natural\",\n",
183
+ " \"description\": \"phrased in the way people typically speak, reflecting everyday language use, without formal or artificial structure.\",\n",
184
+ " \"probability\": 0.8\n",
185
+ " },\n",
186
+ " {\n",
187
+ " \"name\": \"search query\",\n",
188
+ " \"description\": \"phrased as a typed web query for search engines (only keywords, without punctuation and without a natural-sounding structure).\",\n",
189
+ " \"probability\": 0.2\n",
190
+ " }\n",
191
+ " ]\n",
192
+ "}\n",
193
+ "\n",
194
+ "user_expertise_categorization = {\n",
195
+ " \"categorization_name\": \"user_expertise\",\n",
196
+ " \"categories\": [\n",
197
+ " {\n",
198
+ " \"name\": \"expert\",\n",
199
+ " \"description\": \"an expert of the subject discussed in the document, therefore he asks complex questions.\",\n",
200
+ " \"probability\": 0.8\n",
201
+ " },\n",
202
+ " {\n",
203
+ " \"name\": \"common person\",\n",
204
+ " \"description\": \"a common person who is not expert of the subject discussed in the document, therefore he asks basic questions.\",\n",
205
+ " \"probability\": 0.2\n",
206
+ " }\n",
207
+ " ]\n",
208
+ "}"
209
+ ]
210
+ },
211
+ {
212
+ "cell_type": "markdown",
213
+ "metadata": {},
214
+ "source": [
215
+ "For example, let's use these categorizations to generate 5 questions."
216
+ ]
217
+ },
218
+ {
219
+ "cell_type": "code",
220
+ "execution_count": 37,
221
+ "metadata": {},
222
+ "outputs": [
223
+ {
224
+ "name": "stdout",
225
+ "output_type": "stream",
226
+ "text": [
227
+ "{\n",
228
+ " \"request_id\": \"5d5f6002-2395-4ff9-95a2-83c37947f9ee\",\n",
229
+ " \"type\": \"async\"\n",
230
+ "}\n",
231
+ "Waiting for generation to finish...\n",
232
+ "Waiting for generation to finish...\n",
233
+ "Waiting for generation to finish...\n",
234
+ "Waiting for generation to finish...\n",
235
+ "Waiting for generation to finish...\n",
236
+ "Waiting for generation to finish...\n",
237
+ "Waiting for generation to finish...\n",
238
+ "Waiting for generation to finish...\n",
239
+ "{\n",
240
+ " \"status\": \"completed\",\n",
241
+ " \"file\": \"https://s3.amazonaws.com/data.aiir/data_morgana/web_api/results_id_d01f3d5e-9cef-4be8-a311-8b07d3a22c6f_user_id_ded43e4d-7723-49d3-ad51-6636cf5aefd2.jsonl?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA2UC3AHBFWKQ2GES5%2F20250204%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250204T091912Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEA4aCXVzLWVhc3QtMSJIMEYCIQDtXc99Td%2BZFZ5JRPTjV9GHEB7zKrsxhjodL5WmngqN7AIhAM7Cp7PiP%2FvHEfZ0LYKeps6T7nTAKmBZJqy2wNJmbfW%2FKrsFCCcQABoMNzMwMzM1Mjk1NTYzIgy2SkG3NP09ZldZskwqmAVLZLbPkvHnGbkiGqacmLPE5%2FpMud8ZCJUcKedwpv4uu0R5FhbxEhWGWg2pXp%2Fsgz5mYqQkowG%2BdId0PcrhDwW%2FLD0SCVmd0P6Bp3ha5FCNp4ssvl4q6Mozbfq7U%2FBeOAvrDJQg1Z3ofOp%2FxVS%2BgVkRleRwhS36cOWaTeDaAMyIYJNmEnYkkBQ%2FzRTwWkaw0uID2sCVgHRELPE1k9U99PaQ0xWizWX3HnoLjBIsILRSnDYhqm%2B8Klttf4keD093tqLl3U6Clcd0nCEsLpHlpK8ScytwM8RrMbMdiydDtXcM2FsgLQtUA5Ks28qjBxO47C7s8CR4Oop3TS%2BcpWacHDlYEjCX6pTyyu5hhcTTzpl4SkCZ%2FxmQSIKoPy0GRjudzpeAficf9dSmdoCWH3kkeLPa1j6rWpGzTtqldm3lHfWZKOj191blFSF4r2hy95y64hu8EomFf2r3vkQAXC2ZN4DtbFA5MgTRo37tr0nlu%2Bnfxer72dJA9V8SAInQYP9nnFZdJilgTNUdD2E4jdhVz7oZGtWpJhiuYOTDD7%2B4UezNf3idDgBdYZ8bbt2ENCcMKgvpq89TezsPr3BOPux2sh4Y9JvN0rqsvoYu28eVfrGJC6JNL14s9SUy7FnTAY8lCIvHTGjXlVG0nQsSiEJwRG56C4TY77zO4HsReMe9%2B6Rl7s3siB%2B8atqhPhwZrdypOUbmltv8uWjtxHDwuDnaM5yJLTbFKoOK6CpKv8EC16TjszENlAYTAkUlUdvVlseZx80cAVSa7mtQvEEclR9namYo3Wkv6UlKXSYK5ir%2BWavTIE1tnyNBtKp37aTZJr9nmQNund1L6G4bj855NzeFvga0RA58UEQ7dFw0gRysOP7mgU1zsPP%2FZFJzMKHThr0GOrABQuCeKIWKait%2F0Q1YIjaq1jmibSqUI7pLveuxH3Nl3VXeQorntgj3Ucq7GBnZ9Y5rGCrOkDVsepOWAP9piZEBIiwGo7Gp%2BZfmUg%2B0qf9lVGsKVeJtbvpJTFyhHLrPdGMllIg7aq4fqjnXUyyHHlplwphe3ezKYYHTcAbJINGt95Ed5K3zBSe0DqNdiY9bpVrveIbcWU829IJXp4r939aH6pNuwZ3jlFXMAw2%2FY4BDk6g%3D&X-Amz-Signature=6e135cdd7cf2751d2e9231d04ad9a049ef9f1ac8c4fc23a83c42043eca8f870b\",\n",
242
+ " \"credits\": 5\n",
243
+ "}\n"
244
+ ]
245
+ }
246
+ ],
247
+ "source": [
248
+ "results = bulk_generate(n_questions=5,\n",
249
+ " question_categorizations=[question_length_categorization, question_formulation_categorization],\n",
250
+ " user_categorizations=[user_expertise_categorization]\n",
251
+ " )"
252
+ ]
253
+ },
254
+ {
255
+ "cell_type": "markdown",
256
+ "metadata": {},
257
+ "source": [
258
+ "The API response includes a link to the file where the generated results are stored. \n",
259
+ "This link is valid for 12 hours. If you need to access the file after that time, you can call `fetch_generation_results` again with the original `request_id` to receive a new link.\n",
260
+ "\n",
261
+ "Let's retrieve the data from the file and print the results."
262
+ ]
263
+ },
264
+ {
265
+ "cell_type": "code",
266
+ "execution_count": 39,
267
+ "metadata": {},
268
+ "outputs": [],
269
+ "source": [
270
+ "response = requests.get(results[\"file\"])\n",
271
+ "qas = [json.loads(line) for line in response.text.splitlines()]"
272
+ ]
273
+ },
274
+ {
275
+ "cell_type": "code",
276
+ "execution_count": 41,
277
+ "metadata": {},
278
+ "outputs": [
279
+ {
280
+ "data": {
281
+ "text/plain": [
282
+ "{'question': 'How does ADMS handle network faults?',\n",
283
+ " 'answer': 'The system assists grid operators by suggesting remedial actions and restoration processes to isolate and restore affected network sections quickly after a fault. It also uses smart meter data for outage prediction, fault detection and clearance.',\n",
284
+ " 'context': [\"Siemens Smart Grid has introduced a comprehensive distribution management system specifically developed for enhancing and expanding smarter grids. Spectrum Power™ ADMS (Advanced Distribution Management System) combines SCADA (Supervisory Control and Data Acquisition), outage management, and fault and network analysis functions for the first time on a software platform within a consolidated user environment, the first of its kind in North America. This simplifies workflows and facilitates efficient data management. The system also allows network operators to not only control and monitor their distribution network more reliably, but also track and restore outages and carry out maintenance and repair work more efficiently.\\n“Siemens has developed its ADMS solution for North America to specifically address these challenges and achieve wide-spread build out of the smart grid. Utilities will now be able to make data more actionable, increasing operational efficiency for the utility itself and improving power reliability for end users.”\\nBy suggesting remedial actions and restoration processes, the system assists grid operators in isolating and restoring the affected network sections as quickly as possible after a fault. The system also leverages the intelligent use of smart meter data for outage prediction, fault detection and clearance, and for managing distributed energy sources making Spectrum Power ADMS a key component for enhancing and expanding smart grids.\\n“Energy systems worldwide are facing a growing range of challenges, especially in power distribution management,” said Dr. Jan Mrosik, CEO of Siemens’ Smart Grid Division. “Siemens has developed its ADMS solution for North America to specifically address these challenges and achieve wide-spread build out of the smart grid. Utilities will now be able to make data more actionable, increasing operational efficiency for the utility itself and improving power reliability for end users.”\\nSince it was developed for integration in a service-oriented architecture (SOA), the system can make use of services and data from other IT systems, such as network data from geographic information systems or load profiles from meter data management systems. In the same way, other IT systems can access services and data in the distribution network management system, like information for customer information systems about downtime in case of a malfunction, or work orders or switching jobs for the workforce management system. The SOA focused design concept allows Spectrum Power ADMS to be integrated efficiently in the user's IT environment, promoting business process optimization and work process automation.\\nThe system provides the grid operator with the right tools to comply with the requirements of international reliability standards such as NERC CIP (North American Electric Reliability Corporation – Critical Infrastructure Protection) or those of the US federal agency NIST (National Institute of Standards and Technology). Interoperability standards such as IEC 61970 (CIM, Common Information Model) and IEC 61968 (system interfaces for distribution networks) have also been taken into account in the development of Spectrum Power ADMS in order to facilitate the IT integration of the system in an existing infrastructure.\\nThe introduction of Siemens Spectrum Power™ ADMS solution is the culmination of many successfully deployed distribution management solutions as well as Siemens ability to integrate these solutions with the utility’s existing infrastructure. The fully integrated operational environment available from Siemens enables improved monitoring, control and maintenance for a reliable and efficient distribution network.\"],\n",
285
+ " 'question_categories': [{'categorization_name': 'question_length',\n",
286
+ " 'category_name': 'short'},\n",
287
+ " {'categorization_name': 'question_formulation', 'category_name': 'natural'}],\n",
288
+ " 'user_categories': [{'categorization_name': 'user_expertise',\n",
289
+ " 'category_name': 'expert'}],\n",
290
+ " 'document_ids': ['<urn:uuid:db2e6b90-78a6-418b-9c12-f19144174c74>']}"
291
+ ]
292
+ },
293
+ "execution_count": 41,
294
+ "metadata": {},
295
+ "output_type": "execute_result"
296
+ }
297
+ ],
298
+ "source": [
299
+ "qas[0]"
300
+ ]
301
+ },
302
+ {
303
+ "cell_type": "markdown",
304
+ "metadata": {},
305
+ "source": [
306
+ "Each generated result includes: \n",
307
+ "\n",
308
+ "- The generated **question** \n",
309
+ "- The generated **answer** \n",
310
+ "- The **context** (FineWeb documents) the question is based on \n",
311
+ "- The **IDs** of those documents \n",
312
+ "- The **question categories** used during generation \n",
313
+ "- The **user categories** used during generation "
314
+ ]
315
+ },
316
+ {
317
+ "cell_type": "markdown",
318
+ "metadata": {},
319
+ "source": [
320
+ "You can track all your requests using the get_all_requests endpoint."
321
+ ]
322
+ },
323
+ {
324
+ "cell_type": "code",
325
+ "execution_count": 42,
326
+ "metadata": {},
327
+ "outputs": [],
328
+ "source": [
329
+ "def get_all_requests():\n",
330
+ " resp = requests.get(\n",
331
+ " f\"{BASE_URL}get_all_requests\",\n",
332
+ " headers={\"Authorization\": f\"Bearer {API_KEY}\"},\n",
333
+ " )\n",
334
+ " resp.raise_for_status()\n",
335
+ " print(json.dumps(resp.json(), indent=4))"
336
+ ]
337
+ },
338
+ {
339
+ "cell_type": "code",
340
+ "execution_count": null,
341
+ "metadata": {},
342
+ "outputs": [],
343
+ "source": [
344
+ "get_all_requests()"
345
+ ]
346
+ }
347
+ ],
348
+ "metadata": {
349
+ "kernelspec": {
350
+ "display_name": ".venv",
351
+ "language": "python",
352
+ "name": "python3"
353
+ },
354
+ "language_info": {
355
+ "codemirror_mode": {
356
+ "name": "ipython",
357
+ "version": 3
358
+ },
359
+ "file_extension": ".py",
360
+ "mimetype": "text/x-python",
361
+ "name": "python",
362
+ "nbconvert_exporter": "python",
363
+ "pygments_lexer": "ipython3",
364
+ "version": "3.12.8"
365
+ }
366
+ },
367
+ "nbformat": 4,
368
+ "nbformat_minor": 2
369
+ }
Operational_Instructions/DM_Overview (1).md ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DataMorgana Overview
2
+
3
+ DataMorgana is an innovative tool designed to generate diverse and customizable synthetic benchmarks for Retrieval-Augmented Generation (RAG) systems. Its key innovation lies in its ability to create highly varied question-answer pairs that more realistically represent how different types of users might interact with a system.
4
+
5
+ The tool operates through two main stages: **configuration** and **generation**.
6
+
7
+ ---
8
+ ## Configuration Stage
9
+ The configuration stage allows for the definition of detailed categorizations and associated categories for both questions and end-users, which provide high-level information on the expected traffic of the RAG application. A **categorization** is a list of mutually exclusive question or user categories along with their desired distribution within the generated benchmark.
10
+
11
+ For example, a question categorization might include **search queries vs. natural language questions**, while a user categorization might include **novice vs. expert users**. There can be as many categorizations of questions and users as needed, and they can be easily defined to address the specific requirements of the applicative scenario. For instance:
12
+ - In a **healthcare RAG application**, a user categorization could consist of **patient, doctor, and public health authority**.
13
+ - In a **RAG-based embassy chatbot**, a categorization might include **diplomat, student, worker, and tourist**.
14
+
15
+ ---
16
+
17
+ ## Generation Stage
18
+ At the generation stage, DataMorgana leverages state-of-the-art **LLMs** (e.g., Claude 3.5 Sonnet) to incrementally build a benchmark of Q&A pairs. Each pair is generated by following the procedure depicted in **Figure 1**.
19
+
20
+ ![Fig. 1](DM_gen_proc_fig.png)
21
+
22
+
23
+ <center><b>Fig. 1: DataMorgana Generation Stage</b> In the configuration, we provide an end-user categorization and two question categorizations, namely question formulations and question types.</center>
24
+
25
+ More specifically, the DataMorgana generation process follows these steps:
26
+
27
+ 1. **Category Selection:**
28
+ - It selects a **user/question category** for each categorization according to the probability distributions specified in the configuration file.
29
+ - These are automatically combined to create a unique prompt.
30
+
31
+ 2. **Document Selection:**
32
+ - It randomly selects **documents** from the target corpus and adds them to the prompt.
33
+
34
+ 3. **Question-Answer Generation:**
35
+ - The chosen **LLM** is invoked with the instantiated prompt to generate **𝑘 candidate question-answer pairs** about the selected documents.
36
+
37
+ 4. **Filtering and Verification:**
38
+ - A final filtering stage verifies that these candidate pairs:
39
+ - Adhere to the specified **categories**.
40
+ - Are **faithful** to the selected documents.
41
+ - Satisfy general constraints (e.g., be **context-free**).
42
+ - If multiple pairs satisfy the quality requirements, **one is sampled**.
43
+
44
+ ---
45
+
46
+ ## Key Advantages
47
+ The rich and easy-to-use configurability of DataMorgana allows for **fine-grained control** over question and user characteristics. Furthermore, by jointly using multiple categorizations, DataMorgana can achieve a **combinatorial number of possibilities** to define Q&A pairs. This leads to more **diverse benchmarks** compared to existing tools that typically use a predefined list of possible question types.
48
+
49
+ Further details about DataMorgana, as well as **experimental results demonstrating its superior diversity**, are available in this [paper](Generating_Diverse_Q&A_Benchmarks_for_RAG_Evaluation_with_DataMorgana.pdf).
Operational_Instructions/DM_Sandbox.md ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DataMorgana Sandbox
2
+
3
+ 1. Login to the [AI71 website](https://platform.ai71.ai/login)
4
+
5
+ 2. Click on "Sandbox" at the left rail
6
+
7
+ 3. Click on "DataMorgana" at the top rail to access the DataMorgana Sandbox
8
+
9
+ 4. Question/User Catecorizations\
10
+ 4.1 Each Categorization includes a title\
11
+ 4.2 You may use the default Categorizations, edit them or add new ones\
12
+ 4.3 You can choose multiple Categorization (e.g., choosing "Formulation" and "Premise" for Question Categorizations)\
13
+ 4.4 Categorizations includes multiple Categories (e.g., "User expertise" includes two categories - "Expert" and "Novice")\
14
+ 4.4.1 Expand a Categorization by clicking the caret icon on its right-hand side to reveal its Categories
15
+
16
+ 6. Categories\
17
+ 5.1 Each Category includes a title and a description\
18
+ 5.2 You may use the default Categories, edit them or add new ones\
19
+ 5.3 Each Categorization allows only one selected Category (e.g., "Expert" or "Novice" under "User expertise" Categorization)
20
+
21
+ 7. Once you set the Question/User Catecorizations and their Categories, you enter a **single** FineWeb document ID (e.g., "\<urn:uuid:d69cbebc-133a-4ebe-9378-68235ec9f091\>") in the respective box\
22
+ 6.1 If you leave the document ID field empty, a random document ID will be assigned automatically
23
+
24
+ 8. Click the blue "Generate" button to generate a DataMorgana synthetic question-answer pair. The results (i.e., question, answer, doc, doc ID, and Question/User Categorizations information) will appear in the "Chat" box on the right\
25
+ 7.1 You may find question-answer examples [here](https://docs.google.com/spreadsheets/d/1LxZsX_ROe5ZiAvZzk7-G9_Wg8wOiOI4qUHK8ZIO9xvw/edit?usp=sharing)
26
+
27
+ 9. Your remaining question-answer pairs budget is displayed by a counter at the top right of the screen
28
+
29
+
30
+
Operational_Instructions/DM_gen_proc_fig (1).png ADDED

Git LFS Details

  • SHA256: ff61f4ba0ff0f5f8bb971ef3b0c3607651e5309ebbc02108892eabb43b3079ad
  • Pointer size: 131 Bytes
  • Size of remote file: 236 kB
Operational_Instructions/Evaluation_Guidelines_for_LiveRAG (1).md ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Evaluation Guidelines
2
+
3
+ ## 1. Selected Metrics
4
+
5
+ ### 1.1 Relevance Metric
6
+ Combines elements of **equivalence** (semantic match with ground truth) and **relevance** (degree to which the answer directly addresses the question).
7
+
8
+ Graded on a four-point scale:
9
+ - **2:** Correct and relevant (no irrelevant information).
10
+ - **1:** Correct but contains irrelevant information.
11
+ - **0:** No answer provided (abstention).
12
+ - **-1:** Incorrect answer.
13
+
14
+ ### 1.2 Faithfulness Metric
15
+ Assesses whether the response is **grounded in the retrieved passages**.
16
+
17
+ Graded on a three-point scale:
18
+ - **1:** Full support. All answer parts are grounded.
19
+ - **0:** Partial support. Not all answer parts are grounded.
20
+ - **-1:** No support. All answer parts are not grounded.
21
+
22
+ ### 1.3 Combination of Metrics
23
+ Both **relevance** and **faithfulness** will contribute to the final evaluation score.
24
+
25
+ The specific formula for combining these metrics is not disclosed to participants but will prioritize correctness and grounding.
26
+
27
+
28
+ ## 2. Manual and Automated Evaluation
29
+
30
+ ### **2.1 First Stage:**
31
+ - Automated evaluation by LLM **Claude 3.5 Sonnet**, using **relevance** and **faithfulness** metrics to rank the participant teams.
32
+
33
+ ### **2.2 Final Stage:**
34
+ - **Manual evaluation** for the top-ranked submissions (e.g., **top 10 teams**) to determine winners.
35
+
36
+ ## 3. Other Notable Points
37
+ - A strict **length limit of 200 tokens** will be imposed to encourage concise answers.
38
+ - Participants will submit:
39
+ - **The answer**.
40
+ - **All supporting passages**.
41
+ - **The full prompt used for generation**.
42
+
43
+ These measures align the evaluation framework with the challenge's emphasis on **retrieval-augmented systems**.
Operational_Instructions/Generating_Diverse_Q%26A_Benchmarks_for_RAG_Evaluation_with_DataMorgana.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f06a7f64f01b2573d354422ce4ad068f00926433ae693e29ade1a33d722b794b
3
+ size 761950
Operational_Instructions/Indices_Usage_Examples_for_LiveRAG.ipynb ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "# AWS Setup\n",
8
+ "\n",
9
+ "1. Get your AWS access key and secret key from AWS console\n",
10
+ " 1. Log in to the AWS Management Console (it is OK if you see some Access denied messages on the front page. The account is limited on purpose)\n",
11
+ " 2. Click on your name at the top-right coder and then \"Security Credentials\"\n",
12
+ " 3. Click on \"Access keys\" and create a new access key. Create an access key for the Command Line Interface (CLI).\n",
13
+ " 4. Download and save your access key and secret key\n",
14
+ "2. Install the AWS CLI tool (optional but recommended): https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html\n",
15
+ "3. Configure the AWS CLI tool to use your access key and secret key:\n",
16
+ " ```bash\n",
17
+ " aws configure --profile sigir-participant\n",
18
+ " # Use the following settings:\n",
19
+ " # AWS Access Key ID\n",
20
+ " # AWS Secret Access Key\n",
21
+ " # Default region name: us-east-1\n",
22
+ " ```\n",
23
+ "4. Test your setup by running the following command:\n",
24
+ " ```bash\n",
25
+ " # Should display your AWS account ID\n",
26
+ " aws sts get-caller-identity --profile sigir-participant\n",
27
+ "\n",
28
+ " # Make sure you are able to access the configuraiton service\n",
29
+ " aws ssm get-parameter --name /pinecone/ro_token --profile sigir-participant\n",
30
+ "\n",
31
+ " ```"
32
+ ]
33
+ },
34
+ {
35
+ "cell_type": "markdown",
36
+ "metadata": {},
37
+ "source": [
38
+ "# Python Setup\n",
39
+ "1. Install an up-to-date python version (we use 3.12, but any recent version should work)\n",
40
+ "2. Install the required python packages (see below). We recommend using a virtual environment, e.g. venv or conda or poetry or uv\n",
41
+ "3. Now you are ready to try the code samples below\n"
42
+ ]
43
+ },
44
+ {
45
+ "cell_type": "code",
46
+ "execution_count": null,
47
+ "metadata": {},
48
+ "outputs": [],
49
+ "source": [
50
+ "# Install dependencies\n",
51
+ "# The following package versions were tested using Python 3.12 and proved to work but it is possible to use\n",
52
+ "# different versions, consider them simply as examples.\n",
53
+ "\n",
54
+ "!pip install torch==2.5.1 transformers==4.45.2 boto3==1.35.88 pinecone==5.4.2 opensearch-py==2.8.0"
55
+ ]
56
+ },
57
+ {
58
+ "cell_type": "code",
59
+ "execution_count": 1,
60
+ "metadata": {},
61
+ "outputs": [],
62
+ "source": [
63
+ "# AWS utilities\n",
64
+ "import boto3\n",
65
+ "\n",
66
+ "AWS_PROFILE_NAME = \"sigir-participant\"\n",
67
+ "AWS_REGION_NAME = \"us-east-1\"\n",
68
+ "\n",
69
+ "def get_ssm_value(key: str, profile: str = AWS_PROFILE_NAME, region: str = AWS_REGION_NAME) -> str:\n",
70
+ " \"\"\"Get a cleartext value from AWS SSM.\"\"\"\n",
71
+ " session = boto3.Session(profile_name=profile, region_name=region)\n",
72
+ " ssm = session.client(\"ssm\")\n",
73
+ " return ssm.get_parameter(Name=key)[\"Parameter\"][\"Value\"]\n",
74
+ "\n",
75
+ "def get_ssm_secret(key: str, profile: str = AWS_PROFILE_NAME, region: str = AWS_REGION_NAME):\n",
76
+ " session = boto3.Session(profile_name=profile, region_name=region)\n",
77
+ " ssm = session.client(\"ssm\")\n",
78
+ " return ssm.get_parameter(Name=key, WithDecryption=True)[\"Parameter\"][\"Value\"]"
79
+ ]
80
+ },
81
+ {
82
+ "cell_type": "code",
83
+ "execution_count": null,
84
+ "metadata": {},
85
+ "outputs": [],
86
+ "source": [
87
+ "# Pinecone sample\n",
88
+ "\n",
89
+ "from typing import List, Literal, Tuple\n",
90
+ "from multiprocessing.pool import ThreadPool\n",
91
+ "import boto3\n",
92
+ "from pinecone import Pinecone\n",
93
+ "import torch\n",
94
+ "from functools import cache\n",
95
+ "from transformers import AutoModel, AutoTokenizer\n",
96
+ "\n",
97
+ "PINECONE_INDEX_NAME = \"fineweb10bt-512-0w-e5-base-v2\"\n",
98
+ "PINECONE_NAMESPACE=\"default\"\n",
99
+ "\n",
100
+ "@cache\n",
101
+ "def has_mps():\n",
102
+ " return torch.backends.mps.is_available()\n",
103
+ "\n",
104
+ "@cache\n",
105
+ "def has_cuda():\n",
106
+ " return torch.cuda.is_available()\n",
107
+ "\n",
108
+ "@cache\n",
109
+ "def get_tokenizer(model_name: str = \"intfloat/e5-base-v2\"):\n",
110
+ " tokenizer = AutoTokenizer.from_pretrained(model_name)\n",
111
+ " return tokenizer\n",
112
+ "\n",
113
+ "@cache\n",
114
+ "def get_model(model_name: str = \"intfloat/e5-base-v2\"):\n",
115
+ " model = AutoModel.from_pretrained(model_name, trust_remote_code=True)\n",
116
+ " if has_mps():\n",
117
+ " model = model.to(\"mps\")\n",
118
+ " elif has_cuda():\n",
119
+ " model = model.to(\"cuda\")\n",
120
+ " else:\n",
121
+ " model = model.to(\"cpu\")\n",
122
+ " return model\n",
123
+ "\n",
124
+ "def average_pool(last_hidden_states: torch.Tensor, attention_mask: torch.Tensor) -> torch.Tensor:\n",
125
+ " last_hidden = last_hidden_states.masked_fill(~attention_mask[..., None].bool(), 0.0)\n",
126
+ " return last_hidden.sum(dim=1) / attention_mask.sum(dim=1)[..., None]\n",
127
+ "\n",
128
+ "def embed_query(query: str,\n",
129
+ " query_prefix: str = \"query: \",\n",
130
+ " model_name: str = \"intfloat/e5-base-v2\",\n",
131
+ " pooling: Literal[\"cls\", \"avg\"] = \"avg\",\n",
132
+ " normalize: bool =True) -> list[float]:\n",
133
+ " return batch_embed_queries([query], query_prefix, model_name, pooling, normalize)[0]\n",
134
+ "\n",
135
+ "def batch_embed_queries(queries: List[str], query_prefix: str = \"query: \", model_name: str = \"intfloat/e5-base-v2\", pooling: Literal[\"cls\", \"avg\"] = \"avg\", normalize: bool =True) -> List[List[float]]:\n",
136
+ " with_prefixes = [\" \".join([query_prefix, query]) for query in queries]\n",
137
+ " tokenizer = get_tokenizer(model_name)\n",
138
+ " model = get_model(model_name)\n",
139
+ " with torch.no_grad():\n",
140
+ " encoded = tokenizer(with_prefixes, padding=True, return_tensors=\"pt\", truncation=\"longest_first\")\n",
141
+ " encoded = encoded.to(model.device)\n",
142
+ " model_out = model(**encoded)\n",
143
+ " match pooling:\n",
144
+ " case \"cls\":\n",
145
+ " embeddings = model_out.last_hidden_state[:, 0]\n",
146
+ " case \"avg\":\n",
147
+ " embeddings = average_pool(model_out.last_hidden_state, encoded[\"attention_mask\"])\n",
148
+ " if normalize:\n",
149
+ " embeddings = torch.nn.functional.normalize(embeddings, p=2, dim=1)\n",
150
+ " return embeddings.tolist()\n",
151
+ "\n",
152
+ "@cache\n",
153
+ "def get_pinecone_index(index_name: str = PINECONE_INDEX_NAME):\n",
154
+ " pc = Pinecone(api_key=get_ssm_secret(\"/pinecone/ro_token\"))\n",
155
+ " index = pc.Index(name=index_name)\n",
156
+ " return index\n",
157
+ "\n",
158
+ "def query_pinecone(query: str, top_k: int = 10, namespace: str = PINECONE_NAMESPACE) -> dict:\n",
159
+ " index = get_pinecone_index()\n",
160
+ " results = index.query(\n",
161
+ " vector=embed_query(query),\n",
162
+ " top_k=top_k,\n",
163
+ " include_values=False,\n",
164
+ " namespace=namespace,\n",
165
+ " include_metadata=True\n",
166
+ " )\n",
167
+ "\n",
168
+ " return results\n",
169
+ "\n",
170
+ "def batch_query_pinecone(queries: list[str], top_k: int = 10, namespace: str = PINECONE_NAMESPACE, n_parallel: int = 10) -> list[dict]:\n",
171
+ " \"\"\"Batch query a Pinecone index and return the results.\n",
172
+ "\n",
173
+ " Internally uses a ThreadPool to parallelize the queries.\n",
174
+ " \"\"\"\n",
175
+ " index = get_pinecone_index()\n",
176
+ " embeds = batch_embed_queries(queries)\n",
177
+ " pool = ThreadPool(n_parallel)\n",
178
+ " results = pool.map(lambda x: index.query(vector=x, top_k=top_k, include_values=False, namespace=namespace, include_metadata=True), embeds)\n",
179
+ " return results\n",
180
+ "\n",
181
+ "def show_pinecone_results(results):\n",
182
+ " for match in results[\"matches\"]:\n",
183
+ " print(\"chunk:\", match[\"id\"], \"score:\", match[\"score\"])\n",
184
+ " print(match[\"metadata\"][\"text\"])\n",
185
+ " print()\n",
186
+ "\n",
187
+ "results = query_pinecone(\"What is a second brain?\")\n",
188
+ "show_pinecone_results(results)\n",
189
+ "\n",
190
+ "batch_results = batch_query_pinecone([\"What is a second brain?\", \"how does a brain work?\", \"Where is Paris?\"], top_k=2)\n",
191
+ "for results in batch_results:\n",
192
+ " show_pinecone_results(results)\n",
193
+ "\n"
194
+ ]
195
+ },
196
+ {
197
+ "cell_type": "code",
198
+ "execution_count": null,
199
+ "metadata": {},
200
+ "outputs": [],
201
+ "source": [
202
+ "# OpenSearch sample\n",
203
+ "from functools import cache\n",
204
+ "from opensearchpy import OpenSearch, AWSV4SignerAuth, RequestsHttpConnection\n",
205
+ "\n",
206
+ "OPENSEARCH_INDEX_NAME = \"fineweb10bt-512-0w-e5-base-v2\"\n",
207
+ "\n",
208
+ "@cache\n",
209
+ "def get_client(profile: str = AWS_PROFILE_NAME, region: str = AWS_REGION_NAME):\n",
210
+ " credentials = boto3.Session(profile_name=profile).get_credentials()\n",
211
+ " auth = AWSV4SignerAuth(credentials, region=region)\n",
212
+ " host_name = get_ssm_value(\"/opensearch/endpoint\", profile=profile, region=region)\n",
213
+ " aos_client = OpenSearch(\n",
214
+ " hosts=[{\"host\": host_name, \"port\": 443}],\n",
215
+ " http_auth=auth,\n",
216
+ " use_ssl=True,\n",
217
+ " verify_certs=True,\n",
218
+ " connection_class=RequestsHttpConnection,\n",
219
+ " )\n",
220
+ " return aos_client\n",
221
+ "\n",
222
+ "def query_opensearch(query: str, top_k: int = 10) -> dict:\n",
223
+ " \"\"\"Query an OpenSearch index and return the results.\"\"\"\n",
224
+ " client = get_client()\n",
225
+ " results = client.search(index=OPENSEARCH_INDEX_NAME, body={\"query\": {\"match\": {\"text\": query}}, \"size\": top_k})\n",
226
+ " return results\n",
227
+ "\n",
228
+ "def batch_query_opensearch(queries: list[str], top_k: int = 10, n_parallel: int = 10) -> list[dict]:\n",
229
+ " \"\"\"Sends a list of queries to OpenSearch and returns the results.",
230
+ " Configuration of Connection Timeout might be needed for serving large batches of queries",
231
+ "\"\"\"\n",
232
+ " client = get_client()\n",
233
+ " request = []\n",
234
+ " for query in queries:\n",
235
+ " req_head = {\"index\": OPENSEARCH_INDEX_NAME}\n",
236
+ " req_body = {\n",
237
+ " \"query\": {\n",
238
+ " \"multi_match\": {\n",
239
+ " \"query\": query,\n",
240
+ " \"fields\": [\"text\"],\n",
241
+ " }\n",
242
+ " },\n",
243
+ " \"size\": top_k,\n",
244
+ " }\n",
245
+ " request.extend([req_head, req_body])\n",
246
+ "\n",
247
+ " return client.msearch(body=request)\n",
248
+ "\n",
249
+ "\n",
250
+ "\n",
251
+ "def show_opensearch_results(results: dict):\n",
252
+ " for match in results[\"hits\"][\"hits\"]:\n",
253
+ " print(\"chunk:\", match[\"_id\"], \"score:\", match[\"_score\"])\n",
254
+ " print(match[\"_source\"][\"text\"])\n",
255
+ " print()\n",
256
+ "\n",
257
+ "results = query_opensearch(\"What is a second brain?\")\n",
258
+ "show_opensearch_results(results)",
259
+ "\n",
260
+ "batch_results = batch_query_opensearch([\"What is a second brain?\", \"how does a brain work?\", \"Where is Paris?\"], top_k=1)\n",
261
+ "\n",
262
+ "for results in batch_results['responses']:\n",
263
+ " show_opensearch_results(results)\n"
264
+ ]
265
+ }
266
+ ],
267
+ "metadata": {
268
+ "kernelspec": {
269
+ "display_name": ".venv",
270
+ "language": "python",
271
+ "name": "python3"
272
+ },
273
+ "language_info": {
274
+ "codemirror_mode": {
275
+ "name": "ipython",
276
+ "version": 3
277
+ },
278
+ "file_extension": ".py",
279
+ "mimetype": "text/x-python",
280
+ "name": "python",
281
+ "nbconvert_exporter": "python",
282
+ "pygments_lexer": "ipython3",
283
+ "version": "3.12.8"
284
+ }
285
+ },
286
+ "nbformat": 4,
287
+ "nbformat_minor": 2
288
+ }
Operational_Instructions/Pinecone_Documentation_Links.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ **Indices:**
2
+ - [Creating your first index](https://docs.pinecone.io/guides/indexes/create-an-index)
3
+ - [Understanding Index types](https://docs.pinecone.io/guides/indexes/understanding-indexes)
4
+ - [Managing Indices](https://docs.pinecone.io/guides/indexes/manage-indexes)
5
+
6
+ **Data:**
7
+ - [Upsert](https://docs.pinecone.io/guides/data/upsert-data)
8
+ - [Query](https://docs.pinecone.io/guides/data/query-data)
9
+ - [Fetch](https://docs.pinecone.io/guides/data/fetch-data)
10
+ - [Delete](https://docs.pinecone.io/guides/data/delete-data)
11
+ - [Update](https://docs.pinecone.io/guides/data/update-data)
12
+ - [Listing Vectors](https://docs.pinecone.io/guides/data/list-record-ids)
13
+ - [Understanding Metadata](https://docs.pinecone.io/guides/data/understanding-metadata)
14
+
15
+ **Advanced Topics:**
16
+ - [Pinecone Inference](https://docs.pinecone.io/guides/inference/understanding-inference)
17
+ - [Pinecone Assistant](https://docs.pinecone.io/guides/assistant/overview)
Operational_Instructions/Pinecone_for_LiveRAG.md ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Using Pinecone
2
+
3
+ ## Using the Pre-Built Index
4
+ We provide access to a pre-built Pinecone index, which you are welcome to use.
5
+ Follow the instructions [here](Indices_Usage_Examples_for_LiveRAG.ipynb) to use it without costs.
6
+
7
+ ## Building Your Own Index
8
+ In addition to the pre-built Pinecone index, participants are encouraged to experiment with building their own indices.
9
+
10
+ In order to use the provided credits, you will have to open your personal Pinecone account and apply the credits.
11
+
12
+ ## Getting Credits
13
+ Pinecone provides $750 credits per participating group.
14
+ In order to apply the credit to your account you need to:
15
+
16
+ * Open a Pinecone account (or use your existing account)
17
+ * Add a payment method (upgrade to standard). You still don't need to pay.
18
+ * Send us (the organizers) your Pinecone organization ID
19
+ * We will work with Pinecone to apply the credits to your account.
20
+ * Now you can use your Pinecone account with the applied credits. Any usage beyond the credits would be paid by your payment method.
21
+
22
+ ## Deployment Recommendations
23
+ To optimize cost and performance:
24
+
25
+ * Use Pinecone Serverless Deployment – This simplifies deployment and reduces overhead.
26
+ * Minimize Data Transfer Costs – Deploy Pinecone in the same AWS region as your workloads to reduce network bandwidth expenses.
27
+ * Example: If your AWS instances are in us-east-1, deploy the Pinecone index in us-east-1 as well.