Skip to main content

faiss-vector-store faiss-vector-store faiss-vector-store python

faiss-vector-store is a standalone FAISS-backed vector store: Document, FAISSIndex, and FAISSVectorStore for embedding, storing, and similarity-searching text documents. It has no dependency on llmfy or any other LLM framework — pass it an embedding client matching the EmbeddingClient protocol (provider, model, encode_batch(...)), such as one of llmfy's BedrockEmbedding/OpenAIEmbedding/GoogleAIEmbedding, or your own.

How to install

# Using UV
uv add faiss-vector-store

# Using pip
pip install faiss-vector-store

Installing faiss-vector-store pulls in pydantic (used by Document) automatically — nothing else.

FAISS / NumPy — required for actual vector store use

faiss/numpy are optional extras: importing faiss_vector_store never fails, but constructing a FAISSIndex or FAISSVectorStore raises FAISSVectorStoreException with an install hint if either is missing.

# Using UV
uv add "faiss-vector-store[all]"
# or individually
uv add "faiss-vector-store[faiss-cpu]"
uv add "faiss-vector-store[numpy]"

# Using pip
pip install "faiss-vector-store[all]"

How to use

Any embedding client matching the EmbeddingClient protocol works — this example uses llmfy's BedrockEmbedding (pip install "llmfy[boto3]"), but a custom class with provider/model/encode_batch(...) works just as well.

from llmfy import BedrockEmbedding
from faiss_vector_store import Document, FAISSVectorStore

texts = [
    "The cat sits on the mat",
    "Dogs are loyal animals",
    "Artificial intelligence is transforming the world",
    "Quantum computing is the future of technology",
    "The sun rises in the east",
]

docs = [
    Document(id=str(i), text=text, author="irufano")
    for i, text in enumerate(texts)
]

embedding = BedrockEmbedding(model="amazon.titan-embed-text-v1")
store = FAISSVectorStore(embedding)
store.encode_documents(docs)
store.save_to_path("./kb/test_kb")

# --- Load it back and search ---
new_store = FAISSVectorStore(embedding)
new_store.load_from_path("./kb/test_kb")

results = new_store.search("Machine learning and AI", k=2)
for doc, score, idx in results:
    print(f"- Match: {doc.text}, Index: {idx}, score: {score:.4f}, author: {doc.author}")

See faiss_vector_store/example/faiss_store_example.py for a full walkthrough of saving/loading both to a local path and to in-memory buffers (for S3/Redis-style storage), and docs/ for the complete guide.

Contributing

See CONTRIBUTING.md for commit message format, the automatic version-bump/release process, and local package development commands.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

faiss_vector_store-0.1.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

faiss_vector_store-0.1.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file faiss_vector_store-0.1.0.tar.gz.

File metadata

  • Download URL: faiss_vector_store-0.1.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for faiss_vector_store-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e94ee361e756c6c09356a689ae96af85b5e49123132374f18a9fa5de7746aae6
MD5 ab23d7294e9214580659a5eadb47ebe3
BLAKE2b-256 c740557acf3ebb1444833d2576af9ad0e9e1e2a19762a627890a95da7608487e

See more details on using hashes here.

File details

Details for the file faiss_vector_store-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: faiss_vector_store-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for faiss_vector_store-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5dd1146d56572ef83111dfef5756f0b3d65e021fddb1a83616fbae918b26295
MD5 68a2117c101c4881ce7a24029b2cfc1a
BLAKE2b-256 ffe25c7c5ff383cc304df1d5bb412f79af90cc080ffd0208068715f279d2d014

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page