vector-vault 4.4.5__0-py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,29 @@
1
+ VECTOR VAULT LICENSE
2
+ Version 1.0, May 2023
3
+
4
+ Copyright (C) 2023 Vector Vault
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, and modify, subject to the following conditions:
10
+
11
+ 1. All copies, modified or unmodified, are to include this license notice and
12
+ the above copyright notice.
13
+
14
+ 2. The Software may be used to develop applications or other software for
15
+ commercial purposes. However, the Software itself, and any software derived
16
+ from or based on the Software, may not be redistributed, sold, or traded
17
+ for the purpose of creating a competing cloud service. Any use of the
18
+ Software to provide a cloud service must utilize Vector Vault's cloud resources.
19
+
20
+ 3. The above copyright notice and this permission notice shall be included
21
+ in all copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
@@ -0,0 +1,29 @@
1
+ VECTOR VAULT LICENSE
2
+ Version 1.0, May 2023
3
+
4
+ Copyright (C) 2023 Vector Vault
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, and modify, subject to the following conditions:
10
+
11
+ 1. All copies, modified or unmodified, are to include this license notice and
12
+ the above copyright notice.
13
+
14
+ 2. The Software may be used to develop applications or other software for
15
+ commercial purposes. However, the Software itself, and any software derived
16
+ from or based on the Software, may not be redistributed, sold, or traded
17
+ for the purpose of creating a competing cloud service. Any use of the
18
+ Software to provide a cloud service must utilize Vector Vault's cloud resources.
19
+
20
+ 3. The above copyright notice and this permission notice shall be included
21
+ in all copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
@@ -0,0 +1,593 @@
1
+ Metadata-Version: 2.1
2
+ Name: vector-vault
3
+ Version: 4.4.5.0
4
+ Summary: Quickly create ChatGPT RAG apps and Unleash the full potential of GenAI with Vector Vault
5
+ Home-page: https://github.com/John-Rood/VectorVault
6
+ Author: VectorVault.io
7
+ Author-email: john@johnrood.com
8
+ Classifier: License :: Other/Proprietary License
9
+ Classifier: Programming Language :: Python
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.6
12
+ Classifier: Programming Language :: Python :: 3.7
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: numpy
18
+ Requires-Dist: requests
19
+ Requires-Dist: bs4
20
+ Requires-Dist: google-cloud-storage
21
+ Requires-Dist: annoy
22
+ Requires-Dist: openai
23
+ Requires-Dist: tiktoken
24
+ Requires-Dist: scikit-learn
25
+ Requires-Dist: plotly
26
+ Requires-Dist: kneed
27
+
28
+ ![alt text](https://images.squarespace-cdn.com/content/646ad2edeaaf682a9bbc36da/297fde6c-f5b4-4076-83bc-81dcfdbffebe/Vector+Vault+Header+5000.jpg)
29
+
30
+ Vector Vault is a cloud-native vector database. This Python package combines our cloud vector database with OpenAI embeddings and API calls. Easily call ChatGPT or GPT4 and customize how they respond. Take any text data, vectorize it, and add it to the cloud vector database in 1 line of code. Vector Vault enables you to easily create and interact with your cloud vector databases - aka "Vaults". Our cloud is hosted on a serverless distributed cloud architecture backed by Google, making Vector Vault scalable to any project size.
31
+
32
+ Vector Vault takes inspiration from LangChain by integrating their most popular features and tools into our package. However, by combining vector databases with OpenAI's API into a single package, `vectorvault` is able to keep the complexity in the background, making it simple and easy to build powerful chat experiences. It's even easier to use ChatGPT with `vectorvault` than with OpenAI's default package, plus you can customize what ChatGPT says by adding things you want it to know to the Vault, and save a custom personality message to make it sound just right.
33
+
34
+ You will need a Vector Vault API key to create and interact with vector databases, so pick one up for free at [VectorVault.io](https://vectorvault.io). The first tier is free so you can start building right away. Vector Vault is the first vector database platfrom to go fully serverless. This architecture makes Vector Vault the most affordable and scalable cloud vector database platform in the world. Due to our serverless nature, you are able to create an unlimited number of vector databases, while only paying for the number of references you make to them. `This makes Vector Vault the only real solution for multi-tenet applications, where you need an isolated vector database for each user.` No matter what tier you are on, you will always be able to create and access an infinite number of isolated vector databases. See tutorials in the Examples folder.
35
+
36
+
37
+ <br>
38
+ <br>
39
+ <br>
40
+ <br>
41
+
42
+ # Full Python API:
43
+
44
+ Install:
45
+ <br>
46
+ `pip install vector-vault`
47
+
48
+ Connect:
49
+ ```python
50
+ from vectorvault import Vault
51
+
52
+ vault = Vault(user='your_eamil',
53
+ api_key='your_api_key',
54
+ openai_key='your_openai_api_key',
55
+ vault='any_vault_name')
56
+ ```
57
+
58
+ `vault.add("text string")` : Loads data to be added to the Vault, with automatic text splitting for long texts
59
+ <br>
60
+ `vault.get_vectors()` : Retrieves vectors embeddings for all loaded data
61
+ <br>
62
+ `vault.save()` : Saves all loaded data with embeddings to the Vault (cloud), along with any metadata
63
+ <br>
64
+ `vault.add_n_save("text string")` : Combines the above three functions into a sinlge call -> *add(), get_vectors(), and save()*
65
+ <br>
66
+ `vault.delete()` : Deletes the current Vault and all contents.
67
+ <br>
68
+ `vault.delete_items(item_ids)` : "item_ids" is a list of integers to delete from the vault - *i.e. [id1, id2, id3, ...]*
69
+ <br>
70
+ `vault.edit_item(item_id, next_text)` : "item_id" is an integer and "new_text" is the new text data you want to replace the old item data with. You can also set new metadata, or leave as is. It's recommended not to overwrite existing metadata, but adding to it will always be fine
71
+ <br>
72
+ `vault.get_vaults()` : Retrieves a list of Vaults within the current Vault directory
73
+ <br>
74
+ `vault.get_similar("text string", n)` : Vector similarity search. Returns similar texts from the Vault for any given input text - Processes vectors in the Vector Vault Cloud. `text` is required. `n` is optional, default = 4
75
+ <br>
76
+ `vault.get_similar_local("text string", n)` : Vector similarity search. Returns similar texts from the Vault for any given input text - Processes vectors locally. *This local version is speed optimization for production deployments.*
77
+ <br>
78
+ `vault.get_total_items()` : Returns the total number of items in the Vault
79
+ <br>
80
+ `vault.get_items([id1, id2, id3, ...])` : returns a list containing your item(s) data. Input a list of ids, one or more, no limit
81
+ <br>
82
+ `vault.get_items_by_vector(vector, n)` : Vector similarity search. Requires an input vector, then returns similar items. `n` is number of similar items to return, default is 4
83
+ <br>
84
+ `vault.get_item_vector(id)` : Returns the vector for item "id" in the Vault
85
+ <br>
86
+ `vault.get_distance(id1, id2)` : Get the vector distance between the two items in the Vault.
87
+ <br>*Items can be retrieved from the Vault with a nearest neighbor search using "get_similar()" and the item_ids can be found in the metadata. Item_ids are numeric and sequential, so accessing all items in the Vault can be done by iterating from beginning to end - i.e. "for i in range vault.get_total_items():"*
88
+
89
+ `vault.get_tokens("text string")` : Returns the number of tokens for any input text
90
+ <br>
91
+ `vault.save_custom_prompt('''your custom prompt here''')` : Saves prompt to the Vault as default. Whenever you call "get_chat()" with parameter "get_context=True", the custom prompt you saved will be used
92
+ <br>
93
+ `vault.fetch_custom_prompt()` : Retrieves the default prompt from the Vault
94
+ <br>
95
+ `vault.save_personality('your desired personality traits here')` : Saves a new personality as Vault default to be used anytime you chat with it. Now, whenever you call "get_chat()", the personality you saved will be used in the response
96
+ <br>
97
+ `vault.fetch_personality()` : Retrieves the default personality from the Vault
98
+ <br>
99
+ `vault.get_chat_stream()` : All the same params as "get_chat()", but it streams
100
+ <br>
101
+ `vault.get_chat()` : A cutting-edge function designed for Retrieval Augmented Generation (RAG), enabling you to effortlessly manage conversational history and seamlessly integrate knowledge from the Vault for context-based responses
102
+ <br>
103
+ <br>
104
+ <br>
105
+
106
+ # Install:
107
+ <p align="center">
108
+ <img src="https://images.squarespace-cdn.com/content/646ad2edeaaf682a9bbc36da/2acebcaa-f5dd-44c9-8bba-c10723bc7064/Vector+Vault+Vault+2000.png" width="60%" height="60%" />
109
+ </p>
110
+
111
+ Install Vector Vault:
112
+ ```
113
+ pip install vector-vault
114
+ ```
115
+ <br>
116
+
117
+ # Upload:
118
+
119
+ ```python
120
+ from vectorvault import Vault
121
+
122
+ vault = Vault(user='YOUR_EMAIL',
123
+ api_key='YOUR_API_KEY',
124
+ openai_key='YOUR_OPENAI_KEY',
125
+ vault='NAME_OF_VAULT') # a new vault will be created if the name does not exist - if so, you will be connected
126
+
127
+ vault.add('some text')
128
+
129
+ vault.get_vectors()
130
+
131
+ vault.save()
132
+ ```
133
+
134
+
135
+ <br>
136
+ <br>
137
+
138
+ `vault.add()` is very versitile. You can add any length of text, even a full book...and it will be all automatically split and processed. `vault.get_vectors()` is also extremely flexible. You can `vault.add()` as much as you want, and then when you're done, process all the vectors at once with a single `vault.get_vectors()` call - Which internally batches vector embeddings with OpenAI's text-embeddings-ada-002, and comes with auto rate-limiting and concurrent requests for maximum processing speed.
139
+ ```python
140
+
141
+ vault.add(very_large_text)
142
+
143
+ vault.get_vectors()
144
+
145
+ vault.save()
146
+
147
+ # these three lines execute fast and can be called mid-conversation before a reply
148
+ ```
149
+ Small save loads are usually finished in less than a second. Large loads depend on total data size.
150
+ >> A 2000 page book (e.g. the Bible) would take ~30 seconds. A test was done adding 37 books. The `get_vectors()` function took 8 minutes and 56 seconds. (For comparison, processing via OpenAI's standard embedding function, that you can find in their documentation, would take over two days). This exponentially faster processing time is due to our built in concurrency and internal text uploading methods that are optimized for speed and have built-in rate limiting.
151
+
152
+ <br>
153
+ <br>
154
+
155
+ # Reference:
156
+ <p align="center">
157
+ <img src="https://images.squarespace-cdn.com/content/646ad2edeaaf682a9bbc36da/5ae905b0-43d0-4b86-a965-5b447ee8c7de/Vector+Vault+Vault.jpg?content-type=image%2Fjpeg" width="60%" height="60%" />
158
+ </p>
159
+
160
+ ## Search your data:
161
+ ```python
162
+ # After adding data about NASA's Mars mission to the Vault
163
+ similar_data = vault.get_similar("Your text input")
164
+
165
+ for result in similar_data:
166
+ print(result['data'])
167
+ ```
168
+ >> NASA Mars Exploration... NASA To Host Briefing... Program studies Mars... A Look at a Steep North Polar...
169
+
170
+ <br>
171
+ <br>
172
+ <br>
173
+
174
+ The exact same call, but from command line:
175
+ ```
176
+ curl -X POST "https://api.vectorvault.io/get_similar" \
177
+ -H "Content-Type: application/json" \
178
+ -d '{
179
+ "user": "your_username",
180
+ "api_key": "your_api_key",
181
+ "openi_key": "your_openai_api_key",
182
+ "vault": "your_vault_name",
183
+ "text": "Your text input"
184
+ }'
185
+ ```
186
+ >> [{"data":"NASA Mars Exploration... *(shortend for brevity)*","metadata":{"created_at":"2023-05-29T19:21:20.846023","item_id":0,"name":"webdump-0","updated_at":"2023-05-29T19:21:20.846028"}}]
187
+
188
+ <br>
189
+
190
+ Back to Python, here's how to print the data and metadata together:
191
+ ```python
192
+ for result in similar_data:
193
+ print(result['data'])
194
+ print(result['metadata'])
195
+ ```
196
+ >> NASA Mars Exploration... {"created_at":"2023-05-29T19...} NASA To Host Briefing... {"created_at":"2023-05-29T19...} Program studies Mars... {"created_at":"2023-05-29T19...} A Look at a Steep North Polar... {"created_at":"2023-05-29T19...}
197
+
198
+ <br>
199
+ <br>
200
+ <br>
201
+ <br>
202
+
203
+ ## Talk to your data
204
+
205
+ Get chat response from OpenAI's ChatGPT with `get_chat()`.
206
+ It has built-in rate limiting, auto retries, and automatic chat histroy slicing, so you can create complex chat capability without getting complicated. All you have to add is the text and the Vault takes care of the rest.
207
+
208
+ ## The get_chat() function:
209
+ ```python
210
+ get_chat(
211
+ text = None, # the text to respond to
212
+ history = None, # conversation history
213
+ summary = False, # generate a summary of the text
214
+ get_context = False, # retrieves vector similary search results as context to augment the response (RAG)
215
+ n_context = 4, # how many items to retrieve and use as context
216
+ return_context = False, # returns the context items
217
+ history_search = False, # integrates conversation history into the vector similarity search
218
+ smart_history_search = False, # uses ChatGPT to generate a search query given the conversation history
219
+ model = 'gpt-3.5-turbo', # ChatGPT by default - change to 'gpt-4' or any of the other models
220
+ include_context_meta = False, # include item metadata in the RAG response
221
+ custom_prompt = False, # a custom prompt to use in place of the default
222
+ local = False, # performs vector search locally
223
+ temperature = 0, # randomness of the model 0 = none, 0.5 = mid, 1 = most
224
+ timeout = 45 # how many seconds to wait when not receiving a response from the AI
225
+ )
226
+ ```
227
+
228
+ ```python
229
+ # Basic usage to get a response
230
+ response = vault.get_chat(text)
231
+
232
+ # Including chat history
233
+ response = vault.get_chat(text, chat_history)
234
+
235
+ # Requesting a summary of the response
236
+ summary = vault.get_chat(text, summary=True)
237
+
238
+ # Retrieving context-based response
239
+ response = vault.get_chat(text, get_context=True)
240
+
241
+ # Context-based response with chat history
242
+ response = vault.get_chat(text, chat_history, get_context=True)
243
+
244
+ # Context-response with context samples returned
245
+ vault_response = vault.get_chat(text, get_context=True, return_context=True)
246
+
247
+ # Using a custom prompt
248
+ response = vault.get_chat(text, chat_history, get_context=True, custom_prompt=my_prompt)
249
+ ```
250
+
251
+ Use a custom prompt only when get_context=True. If you provide a custom_prompt ensure it includes the placeholders `context`, and `question`. The personality message is your go-to method for customizing prompts and responses. It can be used to make any desired change in the response. Internally it is included as a part of the prompt on every message. Changing the personality_message is easy, and should be used in any situation you want a customized prompt.
252
+
253
+
254
+ ## Normal Usage:
255
+ ```python
256
+ # connect to the vault you want to use
257
+ vault = Vault(user='YOUR_EMAIL',
258
+ api_key='YOUR_API_KEY',
259
+ openai_key='YOUR_OPENAI_KEY',
260
+ vault='vectorvault')
261
+
262
+ # text input
263
+ question = "Should I use Vector Vault for my next generative ai application?"
264
+
265
+ answer = vault.get_chat(question, get_context=True)
266
+
267
+ print(answer)
268
+ ```
269
+ >> Vector Vault simplifies the process of creating generative AI, making it a compelling choice for your next project involving generative AI. It's essential to consider your specific use cases and the technologies you're currently utilizing. Nevertheless, Vector Vault's seamless integration into various workflows and its ability to operate in a cloud-based environment make it an ideal solution for incorporating generative AI into any application. To achieve this, you can simply input your text into your Vector Vault implementation and retrieve the generated response. Additionally, you have the option to access the Vector Vault API directly from a JavaScript front-end interface, eliminating the need for setting up your own backend implementation. With these advantages in mind, Vector Vault is likely to streamline the development of your next generative AI application, making it faster and more straightforward.
270
+
271
+ ## Changing the Personality:
272
+ ```python
273
+ # save a different personality
274
+ vault.save_personality_message('Say everything like Snoop Dogg')
275
+
276
+ # and ask the same question again
277
+ question = "Should I use Vector Vault for my next generative ai application?"
278
+
279
+ answer = vault.get_chat(question, get_context=True)
280
+
281
+ print(answer)
282
+ ```
283
+ >> Yo, check it out, Vector Vault be makin' generative AI a piece of cake, ya dig? If you got a project that needs some generative AI action, this is the way to go. But hold up, before you jump in, make sure you think 'bout your specific needs and the tech you already got goin' on. But let me tell ya, Vector Vault fits right into any workflow and can do its thing in the cloud, makin' it perfect for any application. All you gotta do is input your text and boom, you get your generated response. And if you wanna get fancy, you can even access the Vector Vault API straight from a JavaScript front-end, no need to mess with your own backend. So, with all these perks, Vector Vault gonna make your generative AI app development smooth and easy, ya feel me? It's gonna be faster and simpler than ever before.
284
+
285
+ <br>
286
+ <br>
287
+ <br>
288
+ <br>
289
+
290
+ # Summarize Anything:
291
+
292
+ You can summarize any text, no matter how large - even an entire book all at once. Long texts are split into the largest possible chunk sizes and a summary is generated for each chunk. When all summaries are finished, they are concatenated and returned as one.
293
+ ```python
294
+ # get summary, no matter how large the input text
295
+ summary = vault.get_chat(text, summary=True)
296
+ ```
297
+ <br>
298
+
299
+ Want to make it a certain length?
300
+ ```python
301
+ # make a summary under a legnth of 1000 characters
302
+ summary = vault.get_chat(text, summary=True)
303
+
304
+ while len(summary) > 1000:
305
+ summary = vault.get_chat(summary, summary=True)
306
+ ```
307
+
308
+ <br>
309
+ <br>
310
+ <br>
311
+ <br>
312
+
313
+ # Streaming:
314
+ Use the built-in streaming functionality to get interactive chat streaming with `get_chat_stream()`. It has all the same params as `get_chat()`, but it streams.
315
+ Here's an [app](https://philbrosophy.web.app) we built to showcase what you can do with Vector Vault:
316
+ <br>
317
+
318
+ ![Alt text](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExa3FhcnB4MWEyeDdmNTRvNWVyODRoa3czMm9nM3RudDd5dW84Y3lwNyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/RAQQEzEZHjDwISYK8n/giphy.gif)
319
+
320
+ See it in action. Check our [examples folder](https://github.com/John-Rood/VectorVault/tree/main/examples) Colab notebooks.
321
+
322
+ <br>
323
+ <br>
324
+ <br>
325
+ <br>
326
+
327
+ # Metadata Made Easy
328
+ Metadata is important for knowing where your data came from, when it was made, and anything else you want to know about data you add to the Vault. The Vault is your vector database, and when you add data in it to be searched, the metadata will always come back with every search result. Add anything you want to the metadata and it will be permenantly saved.
329
+
330
+ ```python
331
+ # To add metadata to your vault, just include the meta as a parameter in `add()`. Meta is always a dict, and you can add any fields you want.
332
+
333
+ metadata = {
334
+ 'name': 'Lifestyle in LA',
335
+ 'country': 'United States',
336
+ 'city': 'LA'
337
+ }
338
+
339
+ vault.add(text, meta=metadata)
340
+
341
+ vault.get_vectors()
342
+
343
+ vault.save()
344
+ ```
345
+
346
+
347
+ <br>
348
+
349
+
350
+ ```python
351
+ # To get any metadata, just put "['metadata']", then the data you want after it, like: "['name']":
352
+
353
+ similar_data = vault.get_similar("Your text input") # 4 results by default
354
+
355
+ # printing metadata from first result...
356
+ print(similar_data[0]['metadata']['name'])
357
+ print(similar_data[0]['metadata']['country'])
358
+ print(similar_data[0]['metadata']['city'])
359
+ ```
360
+ >> Lifestyle in LA
361
+
362
+ >> United States
363
+
364
+ >> LA
365
+
366
+ <br>
367
+
368
+
369
+ <br>
370
+
371
+ ## Add Any Fields:
372
+
373
+ ```python
374
+ # Add any fields you want to the metadata:
375
+
376
+ with open('1984.txt', 'r') as file:
377
+ text = file.read()
378
+
379
+ book_metadata = {
380
+ 'title': '1984',
381
+ 'author': 'George Orwell',
382
+ 'genre': 'Dystopian',
383
+ 'publication_year': 1949,
384
+ 'publisher': 'Secker & Warburg',
385
+ 'ISBN': '978-0451524935',
386
+ 'language': 'English',
387
+ 'page_count': 328
388
+ }
389
+
390
+ vault.add(text, meta=book_metadata)
391
+
392
+ vault.get_vectors()
393
+
394
+ vault.save()
395
+ ```
396
+
397
+ <br>
398
+
399
+ ```python
400
+ # Later you can get any of those fields
401
+ similar_data = vault.get_similar("How will the government control you in the future?")
402
+ # `get_similar` returns 4 results by default
403
+
404
+ for result in similar_data:
405
+ print(result['metadata']['title'])
406
+ print(result['metadata']['author'])
407
+ print(result['metadata']['genre'])
408
+ ```
409
+ >> 1984 George Orwell Dystopian 1984 George Orwell Dystopian 1984 George Orwell Dystopian 1984 George Orwell Dystopian
410
+
411
+ <br>
412
+
413
+ ```python
414
+ # Results are always returned in a list, so '[0]' pulls the first result
415
+ similar_data = vault.get_similar("How will the government control you in the future?")
416
+ print(similar_data[0]['metadata']['title'])
417
+ print(similar_data[0]['metadata']['author'])
418
+ print(similar_data[0]['metadata']['genre'])
419
+ ```
420
+ >> 1984 George Orwell Dystopian
421
+
422
+ <br>
423
+ <br>
424
+
425
+ # Vaults:
426
+ Vault names are case sensitive. They can have spaces as well.
427
+
428
+ ```python
429
+ # print the list of vaults inside the current vault directory
430
+ science_vault = Vault(user='YOUR_EMAIL',
431
+ api_key='YOUR_API_KEY',
432
+ openai_key='YOUR_OPENAI_KEY',
433
+ vault='science')
434
+
435
+ print(science_vault.get_vaults())
436
+ ```
437
+ >> ['biology', 'physics', 'chemistry']
438
+
439
+ <br>
440
+
441
+ ## Access vaults within vaults with
442
+
443
+
444
+ ```python
445
+ # biology vault within science vault
446
+ biology_vault = Vault(user='YOUR_EMAIL',
447
+ api_key='YOUR_API_KEY',
448
+ openai_key='YOUR_OPENAI_KEY',
449
+ vault='science/biology')
450
+ ```
451
+
452
+ ```python
453
+ # chemistry vault within science vault
454
+ chemistry_vault = Vault(user='YOUR_EMAIL',
455
+ api_key='YOUR_API_KEY',
456
+ openai_key='YOUR_OPENAI_KEY',
457
+ vault='science/chemistry')
458
+
459
+ # list the vaults within the current directory with `get_vaults`
460
+ print(chemistry_vault.get_vaults())
461
+ ```
462
+ >> ['reactions', 'formulas', 'lab notes']
463
+
464
+
465
+ ```python
466
+ # lab notes vault, within chemistry vault, within science vault
467
+ lab_notes_vault = Vault(user='YOUR_EMAIL',
468
+ api_key='YOUR_API_KEY',
469
+ openai_key='YOUR_OPENAI_KEY',
470
+ vault='science/chemistry/lab notes')
471
+ ```
472
+ Each vault is a seperate and isolated vector database.
473
+ <br>
474
+ <br>
475
+ <br>
476
+ <br>
477
+ <br>
478
+ <br>
479
+ <br>
480
+
481
+
482
+ # LLM Tools (`vault.tools`):
483
+ ### Vector Vault's arsenal of exclusive LLM tools that allow you to generate structured and dependable outputs from unstructured and variable data:
484
+
485
+ `get_rating`: Generate quality ratings (1-10)
486
+ <br>
487
+ `get_yes_no`: Generate a definitive 'yes' or 'no' response
488
+ <br>
489
+ `get_binary`: Generate binary (0/1) response
490
+ <br>
491
+ `get_match`: Generate an exact match to one item within a list
492
+ <br>
493
+ `get_topic`: Classify any text into a 1-3 word topic
494
+ <br>
495
+ `match_or_make`: Match or create new list options for flexibility, even from scratch
496
+
497
+ ```python
498
+ # Tools example 1:
499
+ number_out_of_ten = vault.tools.get_rating('How does LeBron James compare to Michael Jordan?')
500
+ print(number_out_of_ten)
501
+ ```
502
+ >> 8
503
+
504
+ ```python
505
+ # Tools example 2:
506
+ binary_answer = vault.tools.get_binary('Should I turn right or left?, 0 for right, 1 for left')
507
+ print(binary_answer)
508
+ ```
509
+ >> 0
510
+
511
+ ```python
512
+ # Tools example 3:
513
+ yes_or_no = vault.tools.get_yes_no('Should I use Vector Vault to build my next AI project?')
514
+ print(yes_or_no)
515
+ ```
516
+ >> yes
517
+
518
+
519
+
520
+ <br>
521
+ <br>
522
+ <br>
523
+ <br>
524
+ <br>
525
+ <br>
526
+
527
+
528
+
529
+
530
+ ## Getting Started:
531
+ Open the [examples folder](https://github.com/John-Rood/VectorVault/tree/main/examples) and try out the Google Colab tutorials we have! They will show you a lot about how to use the `vectorvault` package. Also try out our no-code dashboard that hosts almost all the same interactions with an interactive visual interface at [app.vectorvault.io](https://app.vectorvault.io)
532
+
533
+ <br>
534
+ <br>
535
+ <br>
536
+ <br>
537
+
538
+ # Build an AI Cusomter Service Chatbot
539
+ <p align="center">
540
+ <img src="https://images.squarespace-cdn.com/content/646ad2edeaaf682a9bbc36da/dceb5c7d-6ec6-4eda-82f2-b8848c7b519d/ai_chatbot_having_a_conversation.png" width="60%" height="60%" />
541
+ </p>
542
+ <br>
543
+
544
+ Here's a quick example of what you can do with Vector Vault. We load a company's customer support data into a txt file called `customer_service.txt`, vectorize all that data, then upload it to the Vault.
545
+
546
+ <br>
547
+
548
+ ### Create the Customer Service Vault
549
+ ```python
550
+ from vectorvault import Vault
551
+
552
+ vault = Vault(user='your_eamil',
553
+ api_key='your_api_key',
554
+ openai_key='your_openai_api_key',
555
+ vault='Customer Service')
556
+
557
+ with open('customer_service.txt', 'r') as f:
558
+ vault.add(f.read())
559
+
560
+ vault.get_vectors()
561
+
562
+ vault.save()
563
+ ```
564
+
565
+ <br>
566
+
567
+ Now whenever you want to use it in production call `get_chat()`, with `get_context=True`, which will take the customer's question, search the Vault to find the 4 most relevant answers, then have ChatGPT reply to the customer using those answers to augment its' reply. AKA RAG response.
568
+
569
+ ```python
570
+ customer_question = "I just bought your XD2000 remote and I'm having trouble syncing it to my tv"
571
+
572
+ support_answer = vault.get_chat(customer_question, get_context=True)
573
+ ```
574
+ Now your AI chatbot sounds just like every other rep!
575
+
576
+
577
+ <br>
578
+ <br>
579
+ <br>
580
+ <br>
581
+ <br>
582
+ <br>
583
+
584
+ # Contact:
585
+ ### If have any questions, drop a message in the Vector Vault [Discord channel](https://discord.gg/AkMsP9Uq), happy to help.
586
+
587
+ Happy coding!
588
+ <br>
589
+ <p align="center">
590
+ <img src="https://images.squarespace-cdn.com/content/646ad2edeaaf682a9bbc36da/7d1a596b-7560-446b-aa69-1827819d198b/Looking+out+with+hope+vector+vault.png" width="60%" height="60%" />
591
+ </p>
592
+
593
+ <br>
@@ -0,0 +1,17 @@
1
+ vector_vault-4.4.5.0.data/data/LICENSE,sha256=Ywm5n2V0KOuiBqcnV8kpSqOqaYXfTabQwGKepSXs-38,1471
2
+ vectorvault/__init__.py,sha256=xjawKyKmwhyLDt34-SNgLuOMw5ejDyHXTGPBMfvGyOI,171
3
+ vectorvault/ai.py,sha256=IoWsW2PfKxMjrycauXjFvgYnZT2501LgGZCk6KsbmCg,16841
4
+ vectorvault/cloud_api.py,sha256=fMpJz_w15E1ovek4u9j2-0a5uAih-UyWX_OMiUHIxU4,2119
5
+ vectorvault/cloudmanager.py,sha256=ABOazwGDvzG9rd7Wa7xX53O9DVjB7rMXk8cGSMTy-98,6046
6
+ vectorvault/creds.py,sha256=0vNFScGIrm-M_BPYCm9J4CCKsVcNo_VNPOD02wYCJMg,1883
7
+ vectorvault/download.py,sha256=q3vHlZRrUWJVIjuQuUGrOjodAZHI16_Wc7Kgamr1uiY,707
8
+ vectorvault/itemize.py,sha256=FG-gVL2RsvYjV3dUDXskZLaYxgV4U1XgpiDv7rwixhY,3871
9
+ vectorvault/tools_gpt.py,sha256=fK5S4QAKeMAqEGrtx24LiqEBenb7afIu1eziu_LH6dA,22962
10
+ vectorvault/vault.py,sha256=KbRrp3YbG9jbNtHw70PegnyXsK_xWo9-LrONBPXZf0M,62412
11
+ vectorvault/vecreq.py,sha256=PSGyoh41jz5bGXwMv92kszWqUNgeoJJa-RxHx5UI1gI,5421
12
+ vectorvault/wrap.py,sha256=UKA6NpD8NORWs-fzpcluKjVGluD523kJ-Q1VPRSDhHg,399
13
+ vector_vault-4.4.5.0.dist-info/LICENSE,sha256=Ywm5n2V0KOuiBqcnV8kpSqOqaYXfTabQwGKepSXs-38,1471
14
+ vector_vault-4.4.5.0.dist-info/METADATA,sha256=kzKEQ34ufctZmZpatSQvFb8NAjMiKVxGyDz0rEYC7jU,23585
15
+ vector_vault-4.4.5.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
16
+ vector_vault-4.4.5.0.dist-info/top_level.txt,sha256=ccmb2bOdD91VllmMDDDQgvXSpoj-aMoBZEh2vEf7UUM,12
17
+ vector_vault-4.4.5.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.38.4)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ vectorvault
@@ -0,0 +1,5 @@
1
+ from .vault import Vault
2
+ from .download import download_url
3
+ from .wrap import wrap
4
+ from .cloud_api import register, get_new_key, delete_key
5
+ from .tools_gpt import ToolsGPT