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

feature: Helper class for combining multiple memories #575

Conversation

creatorrr
Copy link
Contributor

@creatorrr creatorrr commented Jan 10, 2023

feature: Helper class for combining multiple memories

Usage:

conv_memory = ConversationBufferWindowMemory(
    memory_key="chat_history",
    input_key="input",
    output_key="bot_output",
    k=5,
    ai_prefix=ai_prefix,
    human_prefix=human_prefix,
)

additional_info_memory = AdditionalInfoMemory(
    memory_key="additional_info",
    read_key="output",
    include_intermediate_steps=True,
)

# Combined
memory = CombinedMemory(memories=[conv_memory, additional_info_memory])

Signed-off-by: Diwank Singh Tomer <diwank.singh@gmail.com>
@creatorrr creatorrr changed the title creatorrr/combined memory feature: Helper class for combining multiple memories Jan 10, 2023
Copy link
Contributor

@hwchase17 hwchase17 left a comment

Choose a reason for hiding this comment

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

boom i love it!

will probably add in an example notebook and then include in tmrws release

thank you!

@hwchase17 hwchase17 changed the base branch from master to harrison/combine_memories January 11, 2023 13:54
@hwchase17 hwchase17 merged commit 29fb76d into langchain-ai:harrison/combine_memories Jan 11, 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