Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[BB3] Option to ignore in session memories #4753

Merged
merged 5 commits into from Aug 18, 2022
Merged

Conversation

klshuster
Copy link
Contributor

@klshuster klshuster commented Aug 18, 2022

Patch description
Provide an option to ignore in-session memories when generating a dialogue response. An "in session memory" is any memory that is generated during the current dialogue session; a "session" is the life-cycle of the BB3 agent.

If set to True, only memories seeded in the first observation (with the correct Opening: prefix) will be used throughout a conversation.

Testing steps
Several added tests. Note: this depends on #4749 , so tests will fail until that is merged

@@ -421,6 +421,7 @@ def __init__(self, opt, shared=None):
self.agents[Module.SEARCH_KNOWLEDGE] = agent

self.memories = []
self.in_session_memories = set()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to have this as a set? Why not relying on the memory deduplication algorithm we had before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the set is just for quick O(1) checking in the get_available_memory function for memory utils

memory in list --> O(n)
memory in set --> O(1)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I see. I thought you had that for deduplication. That makes sense.

@klshuster klshuster merged commit e3eff5b into main Aug 18, 2022
@klshuster klshuster deleted the ignore_in_session_memories branch August 18, 2022 21:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants