Skip to content

fix: handle missing FAISS index gracefully instead of crashing#318

Open
Mimi-pan wants to merge 3 commits intojenkinsci:mainfrom
Mimi-pan:fix/graceful-faiss-index-missing
Open

fix: handle missing FAISS index gracefully instead of crashing#318
Mimi-pan wants to merge 3 commits intojenkinsci:mainfrom
Mimi-pan:fix/graceful-faiss-index-missing

Conversation

@Mimi-pan
Copy link
Copy Markdown

Fixes #312

On a fresh setup without running make build-data, the FAISS index does not exist yet. The chatbot would crash with a 500 error instead of returning a helpful response.

This PR adds a graceful fallback by checking whether the index file exists before attempting to load it, and returns a clear warning message when it is unavailable.

Files changed:

  • vectorstore_utils.py — added existence check before loading FAISS index
  • retriever_utils.py — return empty results when index or metadata is unavailable
  • test_vectorstore_utils.py — updated tests to reflect new behavior

@Mimi-pan Mimi-pan requested a review from a team as a code owner March 28, 2026 18:54
@berviantoleo
Copy link
Copy Markdown
Contributor

Could you please run the linter in your local before pushing it here?

@j4b3-21
Copy link
Copy Markdown

j4b3-21 commented Mar 29, 2026

hey this is a good pr .
this completely patch up the issue i raised.
thank a lot @Mimi-pan

@Mimi-pan
Copy link
Copy Markdown
Author

Glad to hear that it worked! Thank you for the confirmation and the feedback.

@Mimi-pan
Copy link
Copy Markdown
Author

Mimi-pan commented Apr 3, 2026

@berviantoleo Hi! I've fixed the pylint issues as requested. All CI checks are passing now. Could you please take another look? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chatbot crashes when FAISS index is missing instead of handling gracefully

3 participants