Load Data from DeepLake with LlamaIndex
DeepLake Reader retrieves documents from existing DeepLake datasets using vector queries for LlamaIndex applications.
Why it matters
Efficiently retrieve documents from DeepLake datasets for use within LlamaIndex or as a tool in LangChain agents.
Outcomes
What it gets done
Connect to and query DeepLake datasets.
Load retrieved data into LlamaIndex Document objects.
Integrate DeepLake data retrieval into LangChain agents.
Specify query vectors, dataset paths, and retrieval limits.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-reader-readers-deeplake | bash Overview
LlamaIndex Readers Integration: Deeplake
DeepLake Reader is a LlamaIndex integration that retrieves documents from existing DeepLake datasets using vector-based queries. It accepts query vectors and distance metrics, returning documents for use in LlamaIndex or LangChain applications. Use DeepLake Reader when you have existing DeepLake datasets and need to load data from them into LlamaIndex or use them as a Tool in LangChain agents.
What it does
DeepLake Reader is a LlamaIndex integration that retrieves documents from existing DeepLake datasets using vector-based queries. It loads data by accepting query vectors and distance metrics, returning documents for downstream processing.
Inputs and outputs
You provide a query vector (list of floats), the path to your DeepLake dataset, a limit on the number of results to return, and a distance metric (such as "l2"). You must also authenticate with a DeepLake API token.
You receive documents from your dataset based on the vector query.
Installation and usage
Install via pip:
pip install llama-index-readers-deeplake
Basic usage example:
from llama_index.core.schema import Document
from llama_index.readers.deeplake import DeepLakeReader
### Initialize DeepLakeReader with the token
reader = DeepLakeReader(token="<Your DeepLake Token>")
### Load data from DeepLake
documents = reader.load_data(
query_vector=[0.1, 0.2, 0.3], # Query vector
dataset_path="<Path to Dataset>", # Path to the DeepLake dataset
limit=4, # Number of results to return
distance_metric="l2", # Distance metric
)
Integrations
This loader is designed to be used as a way to load data into LlamaIndex and/or subsequently used as a Tool in a LangChain Agent.
Who it's for
DeepLake Reader is for developers who need to load data from existing DeepLake datasets into LlamaIndex.
Source README
LlamaIndex Readers Integration: Deeplake
Overview
DeepLake Reader is a tool designed to retrieve documents from existing DeepLake datasets efficiently.
Installation
You can install DeepLake Reader via pip:
pip install llama-index-readers-deeplake
To use Deeplake Reader, you must have an API key. Here are the installation instructions
Usage
from llama_index.core.schema import Document
from llama_index.readers.deeplake import DeepLakeReader
### Initialize DeepLakeReader with the token
reader = DeepLakeReader(token="<Your DeepLake Token>")
### Load data from DeepLake
documents = reader.load_data(
query_vector=[0.1, 0.2, 0.3], # Query vector
dataset_path="<Path to Dataset>", # Path to the DeepLake dataset
limit=4, # Number of results to return
distance_metric="l2", # Distance metric
)
This loader is designed to be used as a way to load data into
LlamaIndex and/or subsequently
used as a Tool in a LangChain Agent.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.