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

Suggested way to add memory to chain using Faiss #15

Merged
merged 2 commits into from
Apr 25, 2023

Conversation

scientist1642
Copy link
Collaborator

Added memory is a combination of two parts:
First - Faiss based memory and second - recent K interaction memory. Faiss based memory retrieves top P related interaction to the current input. This kind of combination has the benefit of being able to retrieve contextual memory that is buried deep in the conversation history, but also being highly relevant to the latest interactions. Please see the updated chat chat template.

This memory can be saved to disk as pickle file and loaded whenever needed.
Also @functools.cache is used now, which is new from python 3.9 (Either readme should be updated or memoization should be done manually)

Chat chain now uses conversation memory consisting of two parts:
first - Faiss based memory and second  -recent K interaction memory.
Faiss baised memory retrieves top P related memory to the curent input.
This has the benefit of being able to retrieve contextual memory that is
burried deep in the conversation history, but also being highly
relevant to the latest interactions.

Memory can be saved to disk from time to time.
@mortium91 mortium91 merged commit 035b6e5 into mortium91:main Apr 25, 2023
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.

2 participants