Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commnity: refactor code for faiss vectorstore, update faiss vectorstore documentation #18092

Merged
merged 6 commits into from
Mar 12, 2024

Conversation

timofeyantonenko
Copy link
Contributor

Description: Refactor code of FAISS vectorcstore and update the related documentation.
Details:

  • replace .format() with f-strings for strings formatting;
  • refactor definition of a filtering function to make code more readable and more flexible;
  • slightly improve efficiency of max_marginal_relevance_search_with_score_by_vector method by removing unnecessary looping over the same elements;
  • slightly improve efficiency of delete method by using set data structure for checking if the element was already deleted;

Issue: fix small inconsistency in the documentation (the old example was incorrect and unappliable to faiss vectorstore)

Dependencies: basic langchain-community dependencies and faiss (for CPU or for GPU)

Twitter handle: antonenkodev

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Feb 25, 2024
Copy link

vercel bot commented Feb 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 4, 2024 8:36pm

@dosubot dosubot bot added Ɑ: vector store Related to vector store module 🤖:refactor A large refactor of a feature(s) or restructuring of many files labels Feb 25, 2024
@timofeyantonenko timofeyantonenko force-pushed the faiss-improvements branch 2 times, most recently from 3ebe91e to 0277555 Compare February 26, 2024 21:56
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Mar 1, 2024
@baskaryan baskaryan merged commit 0bec1f6 into langchain-ai:master Mar 12, 2024
61 checks passed
bechbd pushed a commit to bechbd/langchain that referenced this pull request Mar 29, 2024
…ctorstore documentation (langchain-ai#18092)

**Description:** Refactor code of FAISS vectorcstore and update the
related documentation.
Details: 
 - replace `.format()` with f-strings for strings formatting;
- refactor definition of a filtering function to make code more readable
and more flexible;
- slightly improve efficiency of
`max_marginal_relevance_search_with_score_by_vector` method by removing
unnecessary looping over the same elements;
- slightly improve efficiency of `delete` method by using set data
structure for checking if the element was already deleted;

**Issue:** fix small inconsistency in the documentation (the old example
was incorrect and unappliable to faiss vectorstore)

**Dependencies:** basic langchain-community dependencies and `faiss`
(for CPU or for GPU)

**Twitter handle:** antonenkodev
gkorland pushed a commit to FalkorDB/langchain that referenced this pull request Mar 30, 2024
…ctorstore documentation (langchain-ai#18092)

**Description:** Refactor code of FAISS vectorcstore and update the
related documentation.
Details: 
 - replace `.format()` with f-strings for strings formatting;
- refactor definition of a filtering function to make code more readable
and more flexible;
- slightly improve efficiency of
`max_marginal_relevance_search_with_score_by_vector` method by removing
unnecessary looping over the same elements;
- slightly improve efficiency of `delete` method by using set data
structure for checking if the element was already deleted;

**Issue:** fix small inconsistency in the documentation (the old example
was incorrect and unappliable to faiss vectorstore)

**Dependencies:** basic langchain-community dependencies and `faiss`
(for CPU or for GPU)

**Twitter handle:** antonenkodev
hinthornw pushed a commit that referenced this pull request Apr 26, 2024
…ctorstore documentation (#18092)

**Description:** Refactor code of FAISS vectorcstore and update the
related documentation.
Details: 
 - replace `.format()` with f-strings for strings formatting;
- refactor definition of a filtering function to make code more readable
and more flexible;
- slightly improve efficiency of
`max_marginal_relevance_search_with_score_by_vector` method by removing
unnecessary looping over the same elements;
- slightly improve efficiency of `delete` method by using set data
structure for checking if the element was already deleted;

**Issue:** fix small inconsistency in the documentation (the old example
was incorrect and unappliable to faiss vectorstore)

**Dependencies:** basic langchain-community dependencies and `faiss`
(for CPU or for GPU)

**Twitter handle:** antonenkodev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm PR looks good. Use to confirm that a PR is ready for merging. 🤖:refactor A large refactor of a feature(s) or restructuring of many files size:L This PR changes 100-499 lines, ignoring generated files. Ɑ: vector store Related to vector store module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants