llama-index readers faiss integration
Project description
LlamaIndex Readers Integration: Faiss
Overview
Faiss Reader retrieves documents through an existing in-memory Faiss index. These documents can then be used in a downstream LlamaIndex data structure. If you wish to use Faiss itself as an index to organize documents, insert documents, and perform queries on them, please use VectorStoreIndex with FaissVectorStore.
Installation
You can install Faiss Reader via pip:
pip install llama-index-readers-faiss
Usage
from llama_index.readers.faiss import FaissReader
# Initialize FaissReader with an existing Faiss Index object
reader = FaissReader(index="<Faiss Index Object>")
# Load data from Faiss
documents = reader.load_data(
query="<Query Vector>", # 2D numpy array of query vectors
id_to_text_map={"<ID>": "<Text>"}, # A map from IDs to text
k=4, # Number of nearest neighbors to retrieve
separate_documents=True, # Whether to return separate documents
)
This loader is designed to be used as a way to load data into LlamaIndex.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file llama_index_readers_faiss-0.3.0.tar.gz
.
File metadata
- Download URL: llama_index_readers_faiss-0.3.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34e17f71bc943868d478231703c5884937b0422126e5136a6a4cde72319ee6fb |
|
MD5 | e6275f4769e17304d24839e40f40b95b |
|
BLAKE2b-256 | c308e09b6223a693a4ea8df76734023cd80ed7c57d1665b0cc46f6eb7e02c4d0 |
File details
Details for the file llama_index_readers_faiss-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_readers_faiss-0.3.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 788570aa309ce95c4b339aaf7a92b26d8cc05f62d6c3a66d2b6a5da50ab8b784 |
|
MD5 | 3bf40f15d70e7254c83907af9bd006b0 |
|
BLAKE2b-256 | 7b5dbe5721a9371f3eb191a7afb8d82cc0fc98600ef107101f61289c74607eb8 |