Skip to main content

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

llama_index_readers_faiss-0.2.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file llama_index_readers_faiss-0.2.0.tar.gz.

File metadata

  • Download URL: llama_index_readers_faiss-0.2.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0

File hashes

Hashes for llama_index_readers_faiss-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9efb83d560cff244e80895fb7faf6d23584ed0696292ee74c286ccce4ee074df
MD5 7af8734822cca77faf1f016dc8e48770
BLAKE2b-256 e8389c2be93f5637c117289cb7b8653d9246c9a286fe003d1c1f02dba8c583fc

See more details on using hashes here.

File details

Details for the file llama_index_readers_faiss-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_faiss-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 edb04aa26b23342798b7e5fe4e5a94e6cdffd1e73f18c2bc91cf35d7825f6f20
MD5 640e9c788b95739428908d7ef73aa803
BLAKE2b-256 15746970d641ec649202c7b1fb84805f516291103c8bdc82ee8d58a8be4f843e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page