-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[Question]: how to add memory to existing RAG #17323
Comments
To add a memory component to your existing RAG setup, you can integrate Activeloop's Deep Memory feature. Here's a step-by-step guide on how to do this:
This setup will allow you to integrate a memory component into your RAG system using Activeloop's Deep Memory, enhancing retrieval accuracy and efficiency [1]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
No this, i want to add memory to remember my previous context |
@dosu @logan-markewich is this possible to convert a parent child retriever to have memory? |
To add memory to your existing RAG setup to remember previous context, you can utilize the memory classes available in the LlamaIndex framework. These include To convert a parent-child retriever to have memory, you would need to integrate these memory components into your retriever setup. Here’s a general approach:
This approach will allow your system to retain and utilize context across interactions, enhancing the capabilities of your RAG setup. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
@dosu can you take my code snippet and convert it? |
This is a tough nut to crack, could really use your help on this, @logan-markewich. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Question Validation
Question
Im trying to add a memory component to my already existing RAG , how can i do this? Here is my existing code
`
vector_retriever_metadata = index.as_retriever(similarity_top_k=2)
retriever_metadata = RecursiveRetriever(
"vector",
retriever_dict={"vector": vector_retriever_metadata},
node_dict=all_nodes_dict,
verbose=True,
)
response_synthesizer = get_response_synthesizer(response_mode="compact", service_context = service_context, streaming=True)
query_engine = RetrieverQueryEngine.from_args(
retriever_metadata, response_synthesizer=response_synthesizer
)
nodes = retriever_metadata.retrieve(prompt)
response = query_engine.query(prompt)
for text in response.response_gen:
full_response += text + ""
`
The text was updated successfully, but these errors were encountered: