-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat: add development docker compose #2411
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
feat: add development docker compose #2411
Conversation
* fix: create vector extension if not created * fix: add tools argument and handle it * fix: handle decode json in llm calls * feat: add default full configuration * fix: update lock file * feat: add development dockerfile * feat: add missing relations and update to match TS version * feat: update ports to be compatible with zep running
…stream # Conflicts: # mem0/llms/openai.py # poetry.lock
feat/update-from-upstream
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please also update the docs for it: https://docs.mem0.ai/open-source/features/rest-api?
mem0/memory/graph_memory.py
Outdated
@@ -61,7 +61,7 @@ def add(self, data, filters): | |||
deleted_entities = self._delete_entities(to_be_deleted, filters["user_id"]) | |||
added_entities = self._add_entities(to_be_added, filters["user_id"], entity_type_map) | |||
|
|||
return {"deleted_entities": deleted_entities, "added_entities": added_entities} | |||
return {"deleted_entities": deleted_entities, "added_entities": added_entities, "relations": to_be_added} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for adding the relations
key here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is defined in the TS library, added them for consistency https://github.com/mem0ai/mem0/blob/main/mem0-ts/src/oss/src/memory/graph_memory.ts#L135
@@ -344,14 +343,9 @@ def _add_entities(self, to_be_added, user_id, entity_type_map): | |||
params = { | |||
"source_id": source_node_search_result[0]["elementId(source_candidate)"], | |||
"destination_name": destination, | |||
"relationship": relationship, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we removing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not used on the query, as you can see on line 340 the value is interpolated directly,
mem0/mem0/memory/graph_memory.py
Line 340 in f5c208a
MERGE (source)-[r:{relationship}]->(destination) |
In addition I've updated the implementation to keep it in sync with TS library:
params = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey TS library is pretty new I think python should be taken as reference here actually :)
@whysosaket Can you please take a look and confirm here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way, the relationship parameter is not used on the query, so why adding it?
…ment-docker-composer # Conflicts: # mem0/llms/openai.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @sergio-toro Thanks for addressing the comments. But I think if you are changing the output structure for graph in this PR then you should also update the docs for it: https://docs.mem0.ai/open-source/graph_memory. Or else you can skip the graph changes in this PR.
Ok, relations have been removed from this PR |
Hey @sergio-toro Thanks for the contribution!! |
Description
This PR adds a development environment with all dependencies needed to start
mem0
+postgres
+neo4j
graph.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
The development environment spins up when running
docker compose up
Checklist:
Maintainer Checklist