.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/Basic-RAG/BasicRAG_ingest.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_Basic-RAG_BasicRAG_ingest.py: Document Ingestion ======================= This cookbook demonstrates how to ingest pdf documents into a vector database. .. GENERATED FROM PYTHON SOURCE LINES 5-30 .. code-block:: Python import asyncio from pathlib import Path from grag.components.multivec_retriever import Retriever from grag.components.vectordb.deeplake_client import DeepLakeClient client = DeepLakeClient(collection_name="grag") ## Alternatively to use Chroma # from grag.components.vectordb.chroma_client import ChromaClient # client = ChromaClient(collection_name="grag") ASYNC = True retriever = Retriever(vectordb=client) dir_path = ( Path(__file__).parents[2] / "data/pdf" ) # path to the folder containing the pdfs if ASYNC: asyncio.run(retriever.aingest(dir_path)) else: retriever.ingest(dir_path) .. _sphx_glr_download_auto_examples_Basic-RAG_BasicRAG_ingest.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: BasicRAG_ingest.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: BasicRAG_ingest.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_