Load Data from Metal Vector Store
LlamaIndex reader that loads documents from Metal vector store using query embeddings and filters to retrieve indexed data for AI applications.
Why it matters
Integrate your Metal vector store with LlamaIndex to efficiently retrieve and query documents based on embeddings and filters. This asset enables seamless data loading for advanced search and analysis.
Outcomes
What it gets done
Connect to Metal vector store using API keys and index IDs.
Retrieve documents from Metal based on query embeddings.
Apply custom filters to refine search results.
Load data into LlamaIndex for further processing or use as a LangChain tool.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-reader-readers-metal | bash Overview
LlamaIndex Readers Integration: Metal
Metal Reader is a LlamaIndex integration that retrieves documents from Metal vector stores. It connects to Metal indexes via API credentials (API key, client ID, and index ID) and loads documents based on query embeddings and optional metadata filters. The reader outputs documents that can be used in LlamaIndex pipelines or as tools in LangChain agents. Use Metal Reader when you have an existing Metal vector store and need to retrieve documents for LlamaIndex-based applications or LangChain agents.
What it does
The Metal Reader integration for LlamaIndex loads data from Metal vector stores by querying indexed documents using embeddings and filters. It connects to your Metal index using API credentials (API key, client ID, and index ID) and retrieves documents, enabling you to incorporate Metal-stored data into LlamaIndex workflows or LangChain agents.
When to use - and when NOT to
Use Metal Reader when you already have a Metal vector store populated with embedded documents and need to retrieve them for LlamaIndex pipelines or LangChain tools.
Do not use this reader if you don't have an existing Metal vector store - you must set up Metal first following the Metal Vector Store setup guide.
Inputs and outputs
You provide Metal API credentials (API key, client ID, and index ID), a query embedding vector, optional filters as key-value pairs, a result limit, and a flag for document separation. The reader returns documents from your Metal index.
Integrations
Metal Reader integrates with LlamaIndex as a data loader, allowing you to bring Metal-stored documents into LlamaIndex data structures and processing pipelines. It also works as a Tool in LangChain agents, enabling language model applications to query Metal vector stores during agent execution.
Who it's for
This integration serves developers who have chosen Metal as their vector database and need to connect existing Metal indexes to LlamaIndex's document processing capabilities or incorporate Metal search into LangChain agent workflows.
Installation and usage
Install via pip:
pip install llama-index-readers-metal
Initialize and load data:
from llama_index.readers.metal import MetalReader
### Initialize MetalReader
reader = MetalReader(
api_key="<Metal API Key>",
client_id="<Metal Client ID>",
index_id="<Metal Index ID>",
)
### Load data from Metal
documents = reader.load_data(
limit=10,
query_embedding=[0.1, 0.2, 0.3],
filters={"field": "value"},
separate_documents=True,
)
Source README
LlamaIndex Readers Integration: Metal
Overview
Metal Reader is designed to load data from the Metal Vector store, which provides search functionality based on query embeddings and filters. It retrieves documents from the Metal index associated with the provided API key, client ID, and index ID.
Installation
You can install Metal Reader via pip:
pip install llama-index-readers-metal
To use Metal Reader, you must have a vector store first. Follow this to create a metal vector store, Setup Metal Vector Store
Usage
from llama_index.readers.metal import MetalReader
### Initialize MetalReader
reader = MetalReader(
api_key="<Metal API Key>",
client_id="<Metal Client ID>",
index_id="<Metal Index ID>",
)
### Load data from Metal
documents = reader.load_data(
limit=10, # Number of results to return
query_embedding=[0.1, 0.2, 0.3], # Query embedding for search
filters={"field": "value"}, # Filters to apply to the search
separate_documents=True, # Whether to return separate documents
)
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.