Open rajib76 opened 2 weeks ago
Hi! Thank you for the question.
Yes, memary can be added as a module (pip install memary) to an agent. Recently we released #37 so that you can add/remove any tools meaning memary is compatible with any agent configuration. The related demo can be found under our release page (v0.1.3).
We will release a cookbook and interfaces to access all these features soon!
Hope this helps.
I went through the entire code, but it did not seem to me that this memory module can be generalized and applied to any agent as a separate component. Below are some of my observations, please let me know if my understanding is not correct
I may be missing something but I will dig more to understand.
The NEO4J is actually not used as a Graph memory.
i would also like to clarify - is memary updating the neo4j KG? i assumed yes from the llamaindex webinar demo...but if not, this will change my approach.
@rajib76 thanks for the questions.
Neo4j is used as our current graph provider. This can be verified on line 90 in base_agent.py
where the Neo4jGraphStore is initialized. Regarding memory being pushed to the graph please see write_back
(line 226 in the same file) where we insert the agent's response into the graph and index using triplets. We don't assume that there is a prefilled KG but this is super helpful - we are actively working on memaryParse to allow parsing from multiple sources.
In the same function write_back
we index the response using triplets which are inserted into the knowledge graph (see line 234).
Hope this helps.
@rawwerks Thanks for the question.
Yes we do update the KG as described in the webinar. memary's core implementation is an autogenerated graph based on agents prior responses. Please see above comment for code references of these implementations.
Hope this helps.
This is super helpful. I am outside now. Will take a look as soon as reach home. Can’t wait to take a look
I am probably still missing something. I looked at the base_agent.py. There are 3 things that I observed
def write_back(self):
documents = SimpleDirectoryReader(
input_files=["data/external_response.txt"]
).load_data()
KnowledgeGraphIndex.from_documents(
documents,
storage_context=self.storage_context,
max_triplets_per_chunk=8,
)
The above code still does not write in NEO4J
I would like to get some guidance and feedback on the above observations.
Are there any examples which shows how i can integrated memary with my existing LLM chain or agents. Is it possible to integrate it as a separate module.