Description
Add a FAISSRetriever backed by Facebook AI Similarity Search for fast approximate nearest-neighbour search.
Motivation
InMemoryRetriever is O(N) at query time and unsuitable for large corpora. FAISS scales to millions of vectors with sub-millisecond query latency via efficient indexing structures.
Acceptance criteria
Files to touch
ragframework/retriever/faiss.py — new file
ragframework/retriever/__init__.py — export it
tests/test_retriever/test_faiss.py — new test file
Resources
Description
Add a
FAISSRetrieverbacked by Facebook AI Similarity Search for fast approximate nearest-neighbour search.Motivation
InMemoryRetrieveris O(N) at query time and unsuitable for large corpora. FAISS scales to millions of vectors with sub-millisecond query latency via efficient indexing structures.Acceptance criteria
FAISSRetrieverinragframework/retriever/faiss.pyRetrieverfromragframework/base.pyfaiss-cpu(already listed in[faiss]optional extra inpyproject.toml)pip install ragframework[faiss]RetrieverErroron failuretests/test_retriever/test_faiss.pyragframework/retriever/__init__.pyCHANGELOG.mdupdated under[Unreleased]Files to touch
ragframework/retriever/faiss.py— new fileragframework/retriever/__init__.py— export ittests/test_retriever/test_faiss.py— new test fileResources
InMemoryRetrieverinragframework/retriever/in_memory.pyas reference