serverless-pdf-chat icon indicating copy to clipboard operation
serverless-pdf-chat copied to clipboard

Recursion error while using Dynamodb for memory

Open Ranjith072 opened this issue 1 year ago • 1 comments

Hello , i have followed the use case and got everything to work except when i use dynamodb for memory i always get the error.

` message_history = DynamoDBChatMessageHistory( table_name=MEMORY_TABLE, session_id=conversation_id )

memory = ConversationBufferMemory(
    memory_key="chat_history",
    chat_memory=message_history,
    input_key="question",
    output_key="answer",
    return_messages=True,
)

qa = ConversationalRetrievalChain.from_llm(
    llm=llm,
    retriever=faiss_index.as_retriever(),
    memory=memory,    # works if i dont use this option
    return_source_documents=True,
)`

i have tried with different versions of langchain and langchain-community versions without any luck

Screenshot 2024-04-17 at 10 25 31

Ranjith072 avatar Apr 17 '24 08:04 Ranjith072

Hey @Ranjith072 ,

does the issue persist with the latest version of the code (which is using DynamoDB as memory)? Can you please also verify that the issue occurs with a more recent Python version (at least 3.11 or 3.12)?

moserda avatar Aug 02 '24 14:08 moserda