Skip to content
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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

sergio-toro
Copy link

@sergio-toro sergio-toro commented Mar 20, 2025

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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

How Has This Been Tested?

The development environment spins up when running docker compose up

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Made sure Checks passed

Sorry, something went wrong.

sergio-toro and others added 9 commits March 20, 2025 08:21
* 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
Copy link

vercel bot commented Mar 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
multimodal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 20, 2025 0:17am

@CLAassistant
Copy link

CLAassistant commented Mar 20, 2025

CLA assistant check
All committers have signed the CLA.

@sergio-toro sergio-toro changed the title Olivahealth/development docker composer feat: add development docker compose Mar 20, 2025
@deshraj deshraj requested a review from Dev-Khant March 25, 2025 20:15
Copy link
Member

@Dev-Khant Dev-Khant left a 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?

@@ -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}
Copy link
Member

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?

Copy link
Author

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,
Copy link
Member

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?

Copy link
Author

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, https://github.com/mem0ai/mem0/blob/f5c208a22f72de9e3917d9beb3d214c7b33a433d/mem0/memory/graph_memory.py#L340

In addition I've updated the implementation to keep it in sync with TS library:

Copy link
Member

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?

@sergio-toro sergio-toro requested a review from Dev-Khant March 31, 2025 09:17
Copy link
Member

@Dev-Khant Dev-Khant left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants