-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Basic memory retrieval doesn't work #1895
Comments
@Shakahs You have to pass the |
Hey @Shakahs Let us know if this fixes the issue. |
@parshvadaftari I believe even for |
Also I'm trying to create memories for the agent, not a particular user.
…On Wed, Sep 25, 2024 at 2:28 PM Prateek Chhikara ***@***.***> wrote:
@parshvadaftari <https://github.com/parshvadaftari> I believe even for
vector_store you need to pass an id (run_id, user_id, or agent_id).
Correct me @Dev-Khant <https://github.com/Dev-Khant> if I am wrong.
—
Reply to this email directly, view it on GitHub
<#1895 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC7JHTIVNHFRISXXIWK4FDZYMTH7AVCNFSM6AAAAABOVVQG3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZVGI4TMMZUGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Prateek actually we can directly call |
🐛 Describe the bug
KeyError Traceback (most recent call last)
Cell In[32], line 24
20 m = Memory.from_config(config_dict=config)
22 result = m.add("I like to take short walks on weekdays.", user_id="alice", metadata={"category": "hobbies"})
---> 24 all_memories = m.get_all()
File ~/dev/projects/Roga/code/AiResearch/venv/lib/python3.12/site-packages/mem0/memory/main.py:291, in Memory.get_all(self, user_id, agent_id, run_id, limit)
286 future_graph_entities = (
287 executor.submit(self.graph.get_all, filters) if self.version == "v1.1" and self.enable_graph else None
288 )
290 all_memories = future_memories.result()
--> 291 graph_entities = future_graph_entities.result() if future_graph_entities else None
293 if self.version == "v1.1":
294 if self.enable_graph:
File /opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py:456, in Future.result(self, timeout)
454 raise CancelledError()
455 elif self._state == FINISHED:
--> 456 return self.__get_result()
457 else:
458 raise TimeoutError()
File /opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py:401, in Future.__get_result(self)
399 if self._exception:
400 try:
--> 401 raise self._exception
402 finally:
403 # Break a reference cycle with the exception in self._exception
404 self = None
File /opt/homebrew/Cellar/[email protected]/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/thread.py:58, in _WorkItem.run(self)
55 return
57 try:
---> 58 result = self.fn(*self.args, **self.kwargs)
59 except BaseException as exc:
60 self.future.set_exception(exc)
File ~/dev/projects/Roga/code/AiResearch/venv/lib/python3.12/site-packages/mem0/memory/graph_memory.py:291, in MemoryGraph.get_all(self, filters)
286 # return all nodes and relationships
287 query = """
288 MATCH (n {user_id: $user_id})-[r]->(m {user_id: $user_id})
289 RETURN n.name AS source, type(r) AS relationship, m.name AS target
290 """
--> 291 results = self.graph.query(query, params={"user_id": filters["user_id"]})
293 final_results = []
294 for result in results:
KeyError: 'user_id'
The text was updated successfully, but these errors were encountered: