Creating App - Error when running

The App is actually working. Its loading. When I choose my vector file, and start asking question about it, I get this following error:

TypeError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).
File “/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/”, line 565, in _run_script
exec(code, module.dict)
File “/app/physio_ai/”, line 141, in
File “/app/physio_ai/”, line 122, in main
cost = handle_userinput(user_question)
File “/app/physio_ai/”, line 61, in handle_userinput
response = st.session_state.conversation({“question”: user_question})
File “/home/appuser/venv/lib/python3.9/site-packages/langchain/chains/”, line 140, in call
raise e
File “/home/appuser/venv/lib/python3.9/site-packages/langchain/chains/”, line 134, in call
self._call(inputs, run_manager=run_manager)
File “/home/appuser/venv/lib/python3.9/site-packages/langchain/chains/conversational_retrieval/”, line 106, in _call
docs = self._get_docs(new_question, inputs)
File “/home/appuser/venv/lib/python3.9/site-packages/langchain/chains/conversational_retrieval/”, line 183, in _get_docs
docs = self.retriever.get_relevant_documents(question)
File “/home/appuser/venv/lib/python3.9/site-packages/langchain/vectorstores/”, line 377, in get_relevant_documents
docs = self.vectorstore.similarity_search(query, **self.search_kwargs)
File “/home/appuser/venv/lib/python3.9/site-packages/langchain/vectorstores/”, line 254, in similarity_search
docs_and_scores = self.similarity_search_with_score(query, k)
File “/home/appuser/venv/lib/python3.9/site-packages/langchain/vectorstores/”, line 224, in similarity_search_with_score
docs = self.similarity_search_with_score_by_vector(embedding, k)
File “/home/appuser/venv/lib/python3.9/site-packages/langchain/vectorstores/”, line 198, in similarity_search_with_score_by_vector
scores, indices =, k)

Hello there,

The error message you shared suggests that an error occurred while performing a similarity search in the “faiss” vector store. Specifically, the error is related to the line scores, indices =, k) in the similarity_search_with_score_by_vector method of the file.

To diagnose and resolve this issue, you can try the following steps:

  1. Check the input vector: Ensure that the vector being passed to the similarity_search_with_score_by_vector method is in the correct format and has the expected dimensions. It’s possible that an incorrect or incompatible vector format is causing the error. Double-check the vector generation and processing steps.
  2. Verify the Faiss index: Make sure that the Faiss index used in the vector store is properly initialized and configured. Check the index creation code and confirm that it aligns with the requirements of your application. Ensure that the index is built with the correct dimensions and settings to support the similarity search.
  3. Validate the vector store data: Confirm that the vector store data used for the similarity search is correctly loaded and accessible. Ensure that the vector store contains the necessary vectors and that they are properly indexed.

I hope your error gets resolved, cheers!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.