id stringlengths 14 16 | text stringlengths 36 2.73k | source stringlengths 49 117 |
|---|---|---|
ee2494232d47-0 | .ipynb
.pdf
Weaviate
Contents
Weaviate
Similarity search with score
Persistance
Retriever options
Retriever options
MMR
Question Answering with Sources
Weaviate#
Weaviate is an open-source vector database. It allows you to store data objects and vector embeddings from your favorite ML-models, and scale seamlessly int... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-1 | Requirement already satisfied: charset-normalizer<4,>=2 in /workspaces/langchain/.venv/lib/python3.9/site-packages (from requests<2.29.0,>=2.28.0->weaviate-client) (3.1.0)
Requirement already satisfied: idna<4,>=2.5 in /workspaces/langchain/.venv/lib/python3.9/site-packages (from requests<2.29.0,>=2.28.0->weaviate-clie... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-2 | Requirement already satisfied: pycparser in /workspaces/langchain/.venv/lib/python3.9/site-packages (from cffi>=1.12->cryptography>=3.2->authlib>=1.1.0->weaviate-client) (2.21)
We want to use OpenAIEmbeddings so we have to get the OpenAI API Key.
import os
import getpass
os.environ["OPENAI_API_KEY"] = getpass.getpass("... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-3 | Tonight, I’d like to honor someone who has dedicated his life to serve this country: Justice Stephen Breyer—an Army veteran, Constitutional scholar, and retiring Justice of the United States Supreme Court. Justice Breyer, thank you for your service.
One of the most serious constitutional responsibilities a President h... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-4 | (Document(page_content='Tonight. I call on the Senate to: Pass the Freedom to Vote Act. Pass the John Lewis Voting Rights Act. And while you’re at it, pass the Disclose Act so Americans can know who is funding our elections. \n\nTonight, I’d like to honor someone who has dedicated his life to serve this country: Justic... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-5 | 0.0080104275, -0.0010217049, -0.022327352, -0.0055002323, 0.018958665, 0.0020548347, -0.0044393567, -0.021609223, -0.013709779, -0.004543812, 0.025722157, 0.01821442, 0.031728342, -0.031388864, -0.01051083, -0.029978717, 0.011555385, 0.0009751897, 0.014675993, -0.02102166, 0.0301354, -0.031754456, 0.013526983, -0.03392... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-6 | -0.0063293483, -0.01081114, -0.0084282495, 0.003025944, -0.010210521, 0.008780787, 0.014793505, -0.006486031, 0.011966679, 0.01774437, -0.006985459, -0.015459408, 0.01625588, -0.016007798, 0.01706541, 0.035567082, 0.0029900377, 0.021543937, -0.0068483613, 0.040868197, -0.010909067, -0.03339963, 0.010954766, -0.01468904... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-7 | -0.0318328, -0.0094989175, -0.00897664, 0.004736402, 0.0046482678, 0.0023241339, -0.005826656, 0.0072531262, 0.015498579, -0.0077819317, -0.011953622, -0.028934162, -0.033974137, -0.01574666, 0.0086306315, -0.029299757, 0.030213742, -0.0033148287, 0.013448641, -0.013474754, 0.015851116, 0.0076578907, -0.037421167, -0.0... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-8 | -0.007559964, -0.01991182, -0.005268472, -0.008650217, -0.008702445, 0.027550127, 0.0018296026, 0.0018589807, -0.033295177, 0.0036265631, -0.0060290387, 0.014349569, 0.019898765, 0.00023339267, 0.0034568228, -0.018958665, 0.012031963, 0.005186866, 0.020747464, -0.03817847, 0.028202975, -0.01340947, 0.00091643346, 0.014... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-9 | 0.013892576, -0.019977106, 0.029952602, 0.0012004217, -0.015211326, -0.008708973, -0.017809656, 0.008578404, -0.01612531, 0.022614606, -0.022327352, -0.032616217, 0.0050693536, -0.020629952, -0.01357921, 0.011477043, 0.0013938275, -0.0052390937, 0.0142581705, -0.013200559, 0.013252786, -0.033582427, 0.030579336, -0.011... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-10 | 0.016020855, -0.00067284, 0.013461698, -0.0065904865, -0.017809656, -0.014741276, 0.016582303, -0.0088526, 0.0046482678, 0.037473395, -0.02237958, 0.010112594, 0.022549322, 9.680491e-05, -0.0059082615, 0.020747464, -0.026923396, 0.01162067, -0.0074816225, 0.00024277734, 0.011842638, 0.016921783, -0.019285088, 0.0055655... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-11 | 0.02318911, -0.031754456, -0.018188305, -0.031441092, -0.030579336, 0.0011832844, 0.0065023527, -0.027053965, 0.009198609, 0.022079272, -0.027785152, 0.005846241, 0.013500868, 0.016699815, 0.010445545, -0.025265165, -0.004396922, 0.0076774764, 0.014597651, -0.009851455, -0.03637661, 0.0004745379, -0.010112594, -0.00920... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-12 | 0.0027974476, -0.009577259, -0.023815846, 0.024847344, 0.014675993, -0.019454828, -0.013670608, 0.011059221, -0.005438212, 0.0406854, 0.0006218364, -0.024494806, -0.041259903, 0.022013986, -0.0040019494, -0.0052097156, 0.015798887, 0.016190596, 0.0003794671, -0.017444061, 0.012325744, 0.024769, 0.029482553, -0.00465479... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-13 | -0.008715502, 0.006776548, 0.01825359, -0.014480138, -0.014427911, -0.017600743, -0.030004831, 0.0145845935, 0.013762007, -0.013226673, 0.004168425, 0.0047951583, -0.026923396, 0.014675993, 0.0055851024, 0.015616091, -0.012306159, 0.007670948, 0.038439605, -0.015759716, 0.00016178355, 0.01076544, -0.008232395, -0.00994... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-14 | 0.030527107, -0.0003027576, 0.025082368, 0.0405026, 0.03867463, 0.0014117807, -0.024076983, 0.003933401, -0.009812284, 0.00829768, -0.0074293944, 0.0061530797, -0.016647588, -0.008147526, -0.015629148, 0.02055161, 0.000504324, 0.03157166, 0.010112594, -0.009009283, 0.026557801, -0.013997031, -0.0071878415, 0.009414048,... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-15 | -0.0030226798, -0.00074261305, 0.030892702, -0.026218321, 0.0062803845, -0.018031623, -0.021504767, -0.012834964, 0.009009283, -0.0029198565, -0.014349569, -0.020434098, 0.009838398, -0.005993132, -0.013618381, -0.031597774, -0.019206747, 0.00086583785, 0.15835446, 0.033765227, 0.00893747, 0.015119928, -0.019128405, 0.... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-16 | -0.004073763, 0.0032544404, -0.0025983294, -0.020943318, 0.019650683, -0.0074424515, -0.0030977572, 0.0073379963, -0.00012455089, 0.010230106, -0.0007254758, -0.0025052987, -0.009681715, 0.03439196, -0.035123147, -0.0028806855, 0.012828437, 0.00018646932, 0.0066133365, 0.025539361, -0.00055736775, -0.025356563, -0.0045... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-17 | 0.011333417, -0.011548856, -0.0059049972, -0.025186824, 0.0069789304, -0.010993936, -0.0009066408, 0.0002619547, 0.01727432, -0.008082241, -0.018645298, 0.024507863, 0.0030895968, -0.0014656406, 0.011137563, -0.025513247, -0.022967143, -0.002033617, 0.006887532, 0.016621474, -0.019337315, -0.0030618508, 0.0014697209, -... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-18 | 0.005947433, 0.020799693, 0.014702106, 0.03272067, 0.026701428, -0.015550806, -0.036193814, -0.021126116, -0.005412098, -0.013076518, 0.027080078, 0.012900249, -0.0073379963, -0.015119928, -0.019781252, 0.0062346854, -0.03266844, 0.025278222, -0.022797402, -0.0028415148, 0.021452539, -0.023162996, 0.005170545, -0.02231... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-19 | -0.01357921, -0.01110492, -0.014845733, -0.035384286, -0.02550019, 0.008154054, -0.0058331843, -0.008702445, -0.007311882, -0.006525202, 0.03817847, 0.00372449, 0.022914914, -0.0018981516, 0.031545546, -0.01051083, 0.013801178, -0.006296706, -0.00025052988, -0.01795328, -0.026296662, 0.0017659501, 0.021883417, 0.002893... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-20 | 0.02277129, -0.006972402, -0.029769806, 0.034862008, 0.01217559, -0.0037179615, 0.0008666539, 0.008924413, -0.026296662, -0.012678281, 0.014480138, 0.020734407, -0.012103776, -0.037499506, 0.022131499, 0.015028529, -0.033843566, 0.00020187242, 0.002650557, -0.0015113399, 0.021570051, -0.008284623, -0.003793039, -0.0134... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-21 | -0.002678303, -0.0047984226, -0.012182118, -0.001512972, 0.013931747, -0.009642544, 0.012652168, -0.012932892, -0.027759038, -0.01085031, 0.0050236546, -0.009675186, -0.00893747, -0.0051770736, 0.036011018, 0.003528636, -0.001008648, -0.015811944, -0.008865656, 0.012364916, 0.016621474, -0.01340947, 0.03219839, 0.03295... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-22 | -0.025095424, -0.010621814, 0.013207087, 0.013944804, -0.0070899143, -0.022183727, -0.0028088724, -0.011424815, 0.026087752, -0.0058625625, -0.020186016, -0.010217049, 0.015315781, -0.012580355, 0.01374895, 0.004948577, -0.0021854038, 0.023215225, 0.00207442, 0.029639237, 0.01391869, -0.015811944, -0.005356606, -0.0223... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-23 | -0.013957861, 0.0049094064, 0.033556316, 0.005167281, 0.0176138, 0.014140658, -0.0043708077, -0.0095446175, 0.012952477, 0.007853745, -0.01034109, 0.01804468, 0.0038322096, -0.04959023, 0.0023078127, 0.0053794556, -0.015106871, -0.03225062, -0.010073422, 0.007285768, 0.0056079524, -0.009002754, -0.014362626, 0.01090906... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-24 | -0.0006761042, -0.029038617, 0.004367544, -0.012293102, 0.0017528932, -0.023358852, 0.02217067, 0.012606468, -0.008160583, -0.0104912445, -0.0034894652, 0.011078807, 0.00050922035, 0.015759716, 0.23774062, -0.0019291617, 0.006218364, 0.013762007, -0.029900376, 0.018188305, 0.0092965355, 0.0040574414, -0.014976301, -0.0... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-25 | -0.013879519, 0.0011849166, -0.0016925049, 0.009753528, 0.008349908, -0.008245452, 0.033007924, -0.0035873922, -0.025461018, 0.016791213, 0.05410793, -0.005950697, -0.011672897, -0.0072335405, 0.013814235, -0.0593307, -0.008624103, 0.021400312, 0.034235276, 0.015642203, -0.020068504, 0.03136275, 0.012567298, -0.0104194... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-26 | -0.03219839, 0.0058233915, -0.0056405943, -0.009381405, 0.0064044255, 0.013905633, -0.011228961, -0.0013481282, -0.014023146, 0.00016239559, -0.0051901303, 0.0025265163, 0.023619989, -0.021517823, 0.024703717, -0.025643816, 0.040189236, 0.016295051, -0.0040411204, -0.0113595305, 0.0029981981, -0.015589978, 0.026479458,... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-27 | -0.0036200345, -0.021596165, -0.003949722, -0.0006034751, 0.007305354, -0.023424136, 0.004834329, -0.008833014, -0.013435584, 0.0026097542, -0.0012240873, -0.0028349862, -0.01706541, 0.027863493, -0.026414175, -0.011783881, 0.014075373, -0.005634066, -0.006313027, -0.004638475, -0.012495484, 0.022836573, -0.022719061, ... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-28 | -0.0024840813, -0.022444865, 0.0055687814, 0.0037767177, 0.0033915383, 0.0301354, -0.012227817, 0.0021854038, -0.042878963, 0.021517823, -0.010419431, -0.0051183174, 0.01659536, 0.0017333078, -0.00727924, -0.0020026069, -0.0012493852, 0.031441092, 0.0017431005, 0.008702445, -0.0072335405, -0.020081561, -0.012423672, -0... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-29 | 0.004971427, -0.017835768, 0.025017083, -0.021792019, 0.013657551, -0.01872364, 0.009100681, -0.0079582, -0.011640254, -0.01093518, -0.0147543335, -0.005000805, 0.02345025, -0.028908048, 0.0104912445, -0.00753385, 0.017561574, -0.012025435, 0.042670052, -0.0041978033, 0.0013056932, -0.009263893, -0.010941708, -0.004471... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-30 | 0.027706811, 0.03047488, 0.02047327, 0.0019258976, -0.0068940604, -0.0014990991, 0.013305014, -0.007690533, 0.058808424, -0.0016859764, -0.0044622063, -0.0037734534, 0.01578583, -0.0018459238, -0.1196015, -0.0007075225, 0.0030341048, 0.012306159, -0.0068483613, 0.01851473, 0.015315781, 0.031388864, -0.015563863, 0.0477... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-31 | -0.013814235, -0.0004365912, -0.023606932, -0.020186016, 0.025330449, -0.00991674, -0.0048278007, -0.019350372, 0.015433294, -0.0056144805, -0.0034927295, -0.00043455104, 0.008611047, 0.025748271, 0.022353467, -0.020747464, -0.015759716, 0.029038617, -0.000377631, -0.028725252, 0.018109964, -0.0016125311, -0.022719061,... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-32 | -0.03230285, 0.023646105, 0.0111114485, -0.015172156, 0.0257091, 0.0045699263, -0.00919208, 0.021517823, 0.037838988, 0.00787333, -0.007755818, -0.028281316, 0.011170205, -0.005412098, -0.016321165, 0.009929797, 0.004609097, -0.03047488, 0.002688096, -0.07264877, 0.024455635, -0.020930262, -0.015381066, -0.0033148287, ... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-33 | -0.002087477, 0.010791554, 0.022288183, 0.0048604426, -0.032590102, 0.013709779, 0.004922463, 0.020055447, -0.0150677, -0.0057222005, -0.036246043, 0.0021364405, 0.021387255, -0.013435584, 0.010732798, 0.0075534354, -0.00061612396, -0.002018928, -0.004432828, -0.032746784, 0.025513247, -0.0025852725, 0.014467081, -0.00... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-34 | -0.018540842, 0.0025722156, 0.0110331075, -0.003992157, 0.020930262, 0.008487006, 0.0016557822, -0.0009882465, 0.0062640635, -0.016242823, -0.0007785196, -0.0007213955, 0.018971723, 0.021687564, 0.0039464575, -0.01574666, 0.011783881, -0.0019797573, -0.013383356, -0.002706049, 0.0037734534, 0.020394927, -0.00021931567,... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-35 | 0.007135614, -0.0113595305, -0.04387129, 0.016308108, -0.008186696, -0.013370299, -0.014297341, 0.017431004, -0.022666834, 0.039458048, 0.0032005806, -0.02081275, 0.008526176, -0.0019307939, 0.024024757, 0.009068039, 0.00953156, 0.010608757, 0.013801178, 0.035932675, -0.015185213, -0.0038322096, -0.012462842, -0.036559... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-36 | -0.01472822, -0.025735214, -0.03313849, 0.0033817457, 0.028855821, -0.016033912, 0.0050791465, -0.01808385]}, 'source': '../../../state_of_the_union.txt'}), | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-37 | 0.8154189703772676)
Persistance#
Anything uploaded to weaviate is automatically persistent into the database. You do not need to call any specific method or pass any param for this to happen.
Retriever options#
Retriever options#
This section goes over different options for how to use Weaviate as a retriever.
MMR#
In a... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
ee2494232d47-38 | from langchain.chains import RetrievalQAWithSourcesChain
from langchain import OpenAI
with open("../../../state_of_the_union.txt") as f:
state_of_the_union = f.read()
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
texts = text_splitter.split_text(state_of_the_union)
docsearch = Weaviate.fro... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/weaviate.html |
7e0e07c242a8-0 | .ipynb
.pdf
OpenSearch
Contents
Installation
similarity_search using Approximate k-NN
similarity_search using Script Scoring
similarity_search using Painless Scripting
Using a preexisting OpenSearch instance
OpenSearch#
OpenSearch is a scalable, flexible, and extensible open-source software suite for search, analytic... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/opensearch.html |
7e0e07c242a8-1 | embeddings = OpenAIEmbeddings()
similarity_search using Approximate k-NN#
similarity_search using Approximate k-NN Search with Custom Parameters
docsearch = OpenSearchVectorSearch.from_documents(
docs,
embeddings,
opensearch_url="http://localhost:9200"
)
# If using the default Docker installation, use thi... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/opensearch.html |
7e0e07c242a8-2 | print(docs[0].page_content)
similarity_search using Painless Scripting#
similarity_search using Painless Scripting with Custom Parameters
docsearch = OpenSearchVectorSearch.from_documents(docs, embeddings, opensearch_url="http://localhost:9200", is_appx_search=False)
filter = {"bool": {"filter": {"term": {"text": "smug... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/opensearch.html |
607d4ed56f01-0 | .ipynb
.pdf
Typesense
Contents
Similarity Search
Typesense as a Retriever
Typesense#
Typesense is an open source, in-memory search engine, that you can either self-host or run on Typesense Cloud.
Typesense focuses on performance by storing the entire index in RAM (with a backup on disk) and also focuses on providing ... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/typesense.html |
607d4ed56f01-1 | 'typesense_api_key': 'xyz',
'typesense_collection_name': 'lang-chain'
})
Similarity Search#
query = "What did the president say about Ketanji Brown Jackson"
found_docs = docsearch.similarity_search(query)
print(found_docs[0].page_content)
Typ... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/typesense.html |
d7d0bc0d1e87-0 | .ipynb
.pdf
AnalyticDB
AnalyticDB#
AnalyticDB for PostgreSQL is a massively parallel processing (MPP) data warehousing service that is designed to analyze large volumes of data online.
AnalyticDB for PostgreSQL is developed based on the open source Greenplum Database project and is enhanced with in-depth extensions by ... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/analyticdb.html |
d7d0bc0d1e87-1 | import os
connection_string = AnalyticDB.connection_string_from_db_params(
driver=os.environ.get("PG_DRIVER", "psycopg2cffi"),
host=os.environ.get("PG_HOST", "localhost"),
port=int(os.environ.get("PG_PORT", "5432")),
database=os.environ.get("PG_DATABASE", "postgres"),
user=os.environ.get("PG_USER", ... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/analyticdb.html |
a7a10775848b-0 | .ipynb
.pdf
DocArrayInMemorySearch
Contents
Setup
Using DocArrayInMemorySearch
Similarity search
Similarity search with score
DocArrayInMemorySearch#
DocArrayInMemorySearch is a document index provided by Docarray that stores documents in memory. It is a great starting point for small datasets, where you may not want... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/docarray_in_memory.html |
a7a10775848b-1 | Tonight, I’d like to honor someone who has dedicated his life to serve this country: Justice Stephen Breyer—an Army veteran, Constitutional scholar, and retiring Justice of the United States Supreme Court. Justice Breyer, thank you for your service.
One of the most serious constitutional responsibilities a President h... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/docarray_in_memory.html |
a7a10775848b-2 | By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 28, 2023. | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/docarray_in_memory.html |
66d97236a82e-0 | .ipynb
.pdf
Pinecone
Pinecone#
Pinecone is a vector database with broad functionality.
This notebook shows how to use functionality related to the Pinecone vector database.
To use Pinecone, you must have an API key.
Here are the installation instructions.
!pip install pinecone-client
import os
import getpass
PINECONE_A... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/pinecone.html |
66d97236a82e-1 | docs = docsearch.similarity_search(query)
print(docs[0].page_content)
previous
PGVector
next
Qdrant
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 28, 2023. | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/pinecone.html |
1aab16e1ece4-0 | .ipynb
.pdf
MyScale
Contents
Setting up envrionments
Get connection info and data schema
Filtering
Deleting your data
MyScale#
MyScale is a cloud-based database optimized for AI applications and solutions, built on the open-source ClickHouse.
This notebook shows how to use functionality related to the MyScale vector ... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/myscale.html |
1aab16e1ece4-1 | text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
docs = text_splitter.split_documents(documents)
embeddings = OpenAIEmbeddings()
for d in docs:
d.metadata = {'some': 'metadata'}
docsearch = MyScale.from_documents(docs, embeddings)
query = "What did the president say about Ketanji Brown Jackso... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/myscale.html |
1aab16e1ece4-2 | NOTE: Please be aware of SQL injection, this interface must not be directly called by end-user.
If you custimized your column_map under your setting, you search with filter like this:
from langchain.vectorstores import MyScale, MyScaleSettings
from langchain.document_loaders import TextLoader
loader = TextLoader('../..... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/myscale.html |
1aab16e1ece4-3 | docsearch.drop()
previous
Milvus
next
OpenSearch
Contents
Setting up envrionments
Get connection info and data schema
Filtering
Deleting your data
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 28, 2023. | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/myscale.html |
ab6375a5ca88-0 | .ipynb
.pdf
DocArrayHnswSearch
Contents
Setup
Using DocArrayHnswSearch
Similarity search
Similarity search with score
DocArrayHnswSearch#
DocArrayHnswSearch is a lightweight Document Index implementation provided by Docarray that runs fully locally and is best suited for small- to medium-sized datasets. It stores vec... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/docarray_hnsw.html |
ab6375a5ca88-1 | docs = db.similarity_search(query)
print(docs[0].page_content)
Tonight. I call on the Senate to: Pass the Freedom to Vote Act. Pass the John Lewis Voting Rights Act. And while you’re at it, pass the Disclose Act so Americans can know who is funding our elections.
Tonight, I’d like to honor someone who has dedicated hi... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/docarray_hnsw.html |
ab6375a5ca88-2 | 0.36962226)
import shutil
# delete the dir
shutil.rmtree('hnswlib_store')
previous
Deep Lake
next
DocArrayInMemorySearch
Contents
Setup
Using DocArrayHnswSearch
Similarity search
Similarity search with score
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 28, 2023. | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/docarray_hnsw.html |
ab1ea67670b6-0 | .ipynb
.pdf
LanceDB
LanceDB#
LanceDB is an open-source database for vector-search built with persistent storage, which greatly simplifies retrevial, filtering and management of embeddings. Fully open source.
This notebook shows how to use functionality related to the LanceDB vector database based on the Lance data form... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/lanecdb.html |
ab1ea67670b6-1 | I spoke with their families and told them that we are forever in debt for their sacrifice, and we will carry on their mission to restore the trust and safety every community deserves.
I’ve worked on these issues a long time.
I know what works: Investing in crime preventionand community police officers who’ll walk the... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/lanecdb.html |
ab1ea67670b6-2 | These laws don’t infringe on the Second Amendment. They save lives.
The most fundamental right in America is the right to vote – and to have it counted. And it’s under assault.
In state after state, new laws have been passed, not only to suppress the vote, but to subvert entire elections.
We cannot let this happen. ... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/lanecdb.html |
ab1ea67670b6-3 | We’ve set up joint patrols with Mexico and Guatemala to catch more human traffickers.
We’re putting in place dedicated immigration judges so families fleeing persecution and violence can have their cases heard faster.
previous
FAISS
next
Milvus
By Harrison Chase
© Copyright 2023, Harrison Chase.
L... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/lanecdb.html |
4ee2928a437c-0 | .ipynb
.pdf
ElasticSearch
Contents
Installation
Example
ElasticSearch#
Elasticsearch is a distributed, RESTful search and analytics engine. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.
This notebook shows how to use functionality rel... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/elasticsearch.html |
4ee2928a437c-1 | Click “Reset password”
Follow the prompts to reset the password
Format for Elastic Cloud URLs is
https://username:password@cluster_id.region_id.gcp.cloud.es.io:9243.
Example:
from langchain import ElasticVectorSearch
from langchain.embeddings import OpenAIEmbeddings
embedding = OpenAIEmbeddings(... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/elasticsearch.html |
4ee2928a437c-2 | We cannot let this happen.
Tonight. I call on the Senate to: Pass the Freedom to Vote Act. Pass the John Lewis Voting Rights Act. And while you’re at it, pass the Disclose Act so Americans can know who is funding our elections.
Tonight, I’d like to honor someone who has dedicated his life to serve this country: Justi... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/elasticsearch.html |
7de08ca5c97d-0 | .ipynb
.pdf
Tair
Tair#
Tair is a cloud native in-memory database service developed by Alibaba Cloud.
It provides rich data models and enterprise-grade capabilities to support your real-time online scenarios while maintaining full compatibility with open source Redis. Tair also introduces persistent memory-optimized ins... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/tair.html |
7de08ca5c97d-1 | docs = vector_store.similarity_search(query)
docs[0]
Document(page_content='We’re going after the criminals who stole billions in relief money meant for small businesses and millions of Americans. \n\nAnd tonight, I’m announcing that the Justice Department will name a chief prosecutor for pandemic fraud. \n\nBy the en... | https://python.langchain.com/en/latest/modules/indexes/vectorstores/examples/tair.html |
5dafc2bd40cc-0 | .ipynb
.pdf
Airbyte JSON
Airbyte JSON#
Airbyte is a data integration platform for ELT pipelines from APIs, databases & files to warehouses & lakes. It has the largest catalog of ELT connectors to data warehouses and databases.
This covers how to load any source from Airbyte into a local JSON file that can be read in as... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/airbyte_json.html |
5dafc2bd40cc-1 | is_hidden: True
slot: 3
base_experience: 267
forms:
name: charizard
url: https://pokeapi.co/api/v2/pokemon-form/6/
game_indices:
game_index: 180
version:
name: red
url: https://pokeapi.co/api/v2/version/1/
game_index: 180
version:
name: blue
url: https://pokeapi.co/api/v2/version/2/
game_index: 180
version:
n
prev... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/airbyte_json.html |
d6b27cb035a8-0 | .ipynb
.pdf
Diffbot
Diffbot#
Unlike traditional web scraping tools, Diffbot doesn’t require any rules to read the content on a page.
It starts with computer vision, which classifies a page into one of 20 possible types. Content is then interpreted by a machine learning model trained to identify the key attributes on a ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
d6b27cb035a8-1 | [Document(page_content='LangChain is a framework for developing applications powered by language models. We believe that the most powerful and differentiated applications will not only call out to a language model via an API, but will also:\nBe data-aware: connect a language model to other sources of data\nBe agentic: ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
d6b27cb035a8-2 | This includes prompt management, prompt optimization, and prompt serialization.\nMemory: Memory is the concept of persisting state between calls of a chain/agent. LangChain provides a standard interface for memory, a collection of memory implementations, and examples of chains/agents that use memory.\nIndexes: Language... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
d6b27cb035a8-3 | ways. LangChain also provides guidance and assistance in this. Below are some of the common use cases LangChain supports.\nPersonal Assistants: The main LangChain use case. Personal assistants need to take actions, remember interactions, and have knowledge about your data.\nQuestion Answering: The second big LangChain ... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
d6b27cb035a8-4 | type of Data Augmented Generation.\nEvaluation: Generative models are notoriously hard to evaluate with traditional metrics. One new way of evaluating them is using language models themselves to do the evaluation. LangChain provides some prompts/chains for assisting in this.\nReference Docs\nAll of LangChain’s referenc... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
d6b27cb035a8-5 | template repositories for deploying LangChain apps.\nTracing: A guide on using tracing in LangChain to visualize the execution of chains and agents.\nModel Laboratory: Experimenting with different prompts, models, and chains is a big part of developing the best possible application. The ModelLaboratory makes it easy to... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
d6b27cb035a8-6 | previous
Confluence
next
Discord
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 28, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/diffbot.html |
45f1a5d04805-0 | .ipynb
.pdf
Modern Treasury
Modern Treasury#
Modern Treasury simplifies complex payment operations. It is a unified platform to power products and processes that move money.
Connect to banks and payment systems
Track transactions and balances in real-time
Automate payment operations for scale
This notebook covers how t... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/modern_treasury.html |
91695212df3d-0 | .ipynb
.pdf
Figma
Figma#
Figma is a collaborative web application for interface design.
This notebook covers how to load data from the Figma REST API into a format that can be ingested into LangChain, along with example usage for code generation.
import os
from langchain.document_loaders.figma import FigmaFileLoader
fr... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
91695212df3d-1 | # See https://python.langchain.com/en/latest/modules/models/chat/getting_started.html for chat info
system_prompt_template = """You are expert coder Jon Carmack. Use the provided design context to create idomatic HTML/CSS code as possible based on the user request.
Everything must be inline in one file and your... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
91695212df3d-2 | <!DOCTYPE html>\n<html lang="en">\n<head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <style>\n @import url(\'https://fonts.googleapis.com/css2?family=DM+Sans:wght@500;700&family=Inter:wght@600&display=swap\');\n\n body {\n margin... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
91695212df3d-3 | font-weight: 700;\n margin: 0;\n }\n\n .header nav {\n display: flex;\n align-items: center;\n }\n\n .header nav a {\n font-size: 14px;\n font-weight: 500;\n text-decoration: none;\n color: #000;\n margin... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
91695212df3d-4 | Ipsum</a>\n <a href="#">Lorem Ipsum</a>\n <a href="#">Lorem Ipsum</a>\n </nav>\n </header>\n</body>\n</html> | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
91695212df3d-5 | previous
DuckDB
next
GitBook
By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 28, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/figma.html |
63282be0e952-0 | .ipynb
.pdf
Discord
Discord#
Discord is a VoIP and instant messaging social platform. Users have the ability to communicate with voice calls, video calls, text messaging, media and files in private chats or as part of communities called “servers”. A server is a collection of persistent chat rooms and voice channels whi... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/discord_loader.html |
ea960c323497-0 | .ipynb
.pdf
EPub
Contents
Retain Elements
EPub#
EPUB is an e-book file format that uses the “.epub” file extension. The term is short for electronic publication and is sometimes styled ePub. EPUB is supported by many e-readers, and compatible software is available for most smartphones, tablets, and computers.
This co... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/epub.html |
e238887dafa8-0 | .ipynb
.pdf
Azure Blob Storage File
Azure Blob Storage File#
Azure Files offers fully managed file shares in the cloud that are accessible via the industry standard Server Message Block (SMB) protocol, Network File System (NFS) protocol, and Azure Files REST API.
This covers how to load document objects from a Azure Fi... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/azure_blob_storage_file.html |
ea6de87bb824-0 | .ipynb
.pdf
Google Cloud Storage File
Google Cloud Storage File#
Google Cloud Storage is a managed service for storing unstructured data.
This covers how to load document objects from an Google Cloud Storage (GCS) file object (blob).
# !pip install google-cloud-storage
from langchain.document_loaders import GCSFileLoad... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/google_cloud_storage_file.html |
3d71a8f668c1-0 | .ipynb
.pdf
Git
Contents
Load existing repository from disk
Clone repository from url
Filtering files to load
Git#
Git is a distributed version control system that tracks changes in any set of computer files, usually used for coordinating work among programmers collaboratively developing source code during software d... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/git.html |
3d71a8f668c1-1 | By Harrison Chase
© Copyright 2023, Harrison Chase.
Last updated on May 28, 2023. | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/git.html |
505a64a18a3a-0 | .ipynb
.pdf
Images
Contents
Using Unstructured
Retain Elements
Images#
This covers how to load images such as JPG or PNG into a document format that we can use downstream.
Using Unstructured#
#!pip install pdfminer
from langchain.document_loaders.image import UnstructuredImageLoader
loader = UnstructuredImageLoader("... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html |
505a64a18a3a-1 | Document(page_content="LayoutParser: A Unified Toolkit for Deep\nLearning Based Document Image Analysis\n\n\n‘Zxjiang Shen' (F3}, Ruochen Zhang”, Melissa Dell*, Benjamin Charles Germain\nLeet, Jacob Carlson, and Weining LiF\n\n\nsugehen\n\nshangthrows, et\n\n“Abstract. Recent advanocs in document image analysis (DIA) h... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html |
505a64a18a3a-2 | streamlining the sage of DL in DIA research and appicn\n‘tons The core LayoutFaraer brary comes with a sch of simple and\nIntative interfaee or applying and eutomiing DI. odel fr Inyo de\npltfom for sharing both protrined modes an fal document dist\n{ation pipeline We demonutate that LayootPareer shea fr both\nlightwei... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html |
505a64a18a3a-3 | Retain Elements#
Under the hood, Unstructured creates different “elements” for different chunks of text. By default we combine those together, but you can easily keep that separation by specifying mode="elements".
loader = UnstructuredImageLoader("layout-parser-paper-fast.jpg", mode="elements")
data = loader.load()
dat... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/image.html |
2ed5986558cb-0 | .ipynb
.pdf
YouTube transcripts
Contents
Add video info
YouTube loader from Google Cloud
Prerequisites
🧑 Instructions for ingesting your Google Docs data
YouTube transcripts#
YouTube is an online video sharing and social media platform created by Google.
This notebook covers how to load documents from YouTube transc... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/youtube_transcript.html |
2ed5986558cb-1 | google_api_client = GoogleApiClient(credentials_path=Path("your_path_creds.json"))
# Use a Channel
youtube_loader_channel = GoogleApiYoutubeLoader(google_api_client=google_api_client, channel_name="Reducible",captions_language="en")
# Use Youtube Ids
youtube_loader_ids = GoogleApiYoutubeLoader(google_api_client=google_... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/youtube_transcript.html |
c2d033122ebc-0 | .ipynb
.pdf
Notion DB 1/2
Contents
🧑 Instructions for ingesting your own dataset
Notion DB 1/2#
Notion is a collaboration platform with modified Markdown support that integrates kanban boards, tasks, wikis and databases. It is an all-in-one workspace for notetaking, knowledge and data management, and project and tas... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/notion.html |
1a1d070fd614-0 | .ipynb
.pdf
EverNote
EverNote#
EverNote is intended for archiving and creating notes in which photos, audio and saved web content can be embedded. Notes are stored in virtual “notebooks” and can be tagged, annotated, edited, searched, and exported.
This notebook shows how to load an Evernote export file (.enex) from di... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/evernote.html |
1a1d070fd614-1 | Document(page_content='**Jan - March 2022**', metadata={'title': 'Summer Training Program', 'created': time.struct_time(tm_year=2022, tm_mon=12, tm_mday=27, tm_hour=1, tm_min=59, tm_sec=48, tm_wday=1, tm_yday=361, tm_isdst=-1), 'note-attributes.author': 'Mike McGarry', 'note-attributes.source': 'mobile.iphone', 'source... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/evernote.html |
daea3daadf3b-0 | .ipynb
.pdf
Google Cloud Storage Directory
Contents
Specifying a prefix
Google Cloud Storage Directory#
Google Cloud Storage is a managed service for storing unstructured data.
This covers how to load document objects from an Google Cloud Storage (GCS) directory (bucket).
# !pip install google-cloud-storage
from lang... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/google_cloud_storage_directory.html |
daea3daadf3b-1 | warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)
[Document(page_content='Lorem ipsum dolor sit amet.', lookup_str='', metadata={'source': '/var/folders/y6/8_bzdg295ld6s1_97_12m4lr0000gn/T/tmpz37njh7u/fake.docx'}, lookup_index=0)]
Specifying a prefix#
You can also specify a prefix for more finegrained control over what fil... | https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/google_cloud_storage_directory.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.