forked from mem0ai/mem0
-
Notifications
You must be signed in to change notification settings - Fork 0
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
falkor-integration #2
Open
galshubeli
wants to merge
29
commits into
main
Choose a base branch
from
falkor-int
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
41eeccd
falkor-integration
3bd49b5
Feature: milvus db integration (#1821)
ketangangal e3aca70
chore: version -> `0.1.12` (#1846)
Dev-Khant db835cd
Update README.md (#1847)
deshraj 5eeeb4e
Fixing memory adding errors (#1848)
PranavPuranik ac7b7aa
Added custom prompt support (#1849)
prateekchhikara 6c3d44b
fix-example
ca95bed
database-config-val
f40a2e7
Add CONTRIBUTING.md (#1836)
techcontributor 47a8e67
Fixed environment variables priority in OpenAILLM (#1851)
FoliageOwO f9634b4
add test cases for embeddings (#1829)
reachAnushaKondam 959f4bb
Add Support for Vertex AI Embeddings (#1840)
Divyanshu9822 d66654b
Add API-Reference docs for Organization/Project (#1858)
Dev-Khant dc5a26f
Update docs for exisiting APIs to support organization/project (#1859)
Dev-Khant 8e2f7f2
Shows all responses in api-reference (#1865)
Dev-Khant 5b9be67
Migrate session_id -> run_id (#1864)
Dev-Khant 30edf49
chore: version -> 0.1.14 (#1869)
Dev-Khant 3502344
Remove auto install library for chromadb (#1870)
Dev-Khant 0a78cb9
added vector store test cases (#1868)
reachAnushaKondam 55c54be
[Misc] Lint code and fix code smells (#1871)
deshraj 495a66d
gen-graph-use
19db2cc
def-databasename
7f3b23d
update-docs
8c3c9e1
Docs update (#1875)
prateekchhikara fc88cae
update milvus docs (#1876)
Dev-Khant 07de1c4
update-graph-use
12da12d
local-pas
852220a
Merge branch 'main' into falkor-int
galshubeli 9a49aa8
comment-graph-query
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This example shows how to use graph config to use falkordb graph databese | ||
import os | ||
from mem0 import Memory | ||
from dotenv import load_dotenv | ||
|
||
# Loading OpenAI API Key | ||
load_dotenv() | ||
OPENAI_API_KEY = os.environ.get('OPENAI_API_KEY') | ||
USER_ID = "test" | ||
|
||
# Creating the config dict from the environment variables | ||
config = { | ||
"llm": { # This is the language model configuration, use your carditionals | ||
"provider": "openai", | ||
"config": { | ||
"model": "gpt-4o-mini", | ||
"temperature": 0 | ||
} | ||
}, | ||
"graph_store": { # See https://app.falkordb.cloud/ for the carditionals | ||
"provider": "falkordb", | ||
"config": { | ||
"host": os.environ['HOST'], | ||
"username": os.environ['USERNAME'],# if you are using local host, the username and password will not be needed | ||
"password": os.environ['PASSWORD'], | ||
"port": os.environ['PORT'] | ||
} | ||
}, | ||
"version": "v1.1" | ||
} | ||
|
||
# Create the memory class using from config | ||
memory = Memory.from_config(config_dict=config) | ||
|
||
# Use the Mem0 to add and search memories | ||
memory.add("I like painting", user_id=USER_ID) | ||
memory.add("I hate playing badminton", user_id=USER_ID) | ||
print(memory.get_all(user_id=USER_ID)) | ||
memory.add("My friend name is john and john has a dog named tommy", user_id=USER_ID) | ||
print(memory.search("What I like to do", user_id=USER_ID)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Fix the comparison to
None
.The changes to the
validate_config
method to handle the newFalkorDBConfig
look good. However, please address the following static analysis hint:Replace
config.get("host") == None
withconfig.get("host") is None
to improve code quality.Apply this diff to fix the comparison:
Committable suggestion
Tools
Ruff