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

graph store can't work #1975

Open
koi646 opened this issue Oct 20, 2024 · 2 comments
Open

graph store can't work #1975

koi646 opened this issue Oct 20, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@koi646
Copy link
Contributor

koi646 commented Oct 20, 2024

🐛 Describe the bug

from mem0 import Memory
config = {
    "version": "v1.1",
    # LLM
    "llm": {
        "provider": os.getenv("LLM_PROVIDER"),
        "config": {
            "model": os.getenv("LLM_MODEL"),
            "api_key": os.getenv("LLM_API_KEY"),
            "temperature": float(os.getenv("LLM_TEMPERATURE")),
        },
    },

    # Embedding
    "embedder": {
        "provider": os.getenv("EMBEDDING_PROVIDER"),
        "config": {
            "api_key": os.getenv("EMBEDDING_API_KEY"),
            "model": os.getenv("EMBEDDING_MODEL"),
        },
    },

    # Vector Store
    # "vector_store": {
    #     "provider": "pgvector",
    #     "config": {
    #         "dbname": os.getenv("POSTGRES_DB"),
    #         "user": os.getenv("POSTGRES_USER"),
    #         "password": os.getenv("POSTGRES_PASSWORD"),
    #         "host": os.getenv("POSTGRES_HOST"),
    #         "port": os.getenv("POSTGRES_PORT"),
    #     }
    # },

    # Graph Store
    "graph_store": {
        "provider": "neo4j",
        "config": {
            "url": os.getenv("GRAPH_STORE_URL"),
            "username": os.getenv("GRAPH_STORE_USERNAME"),
            "password": os.getenv("GRAPH_STORE_PASSWORD"),
        }
    }
}
mem0 = Memory.from_config(config_dict=config)
res = mem0.add("my name is Rosa", "rosa")
print(res)

this is error

WARNING:neo4j.notifications:Received notification from DBMS server: {severity: WARNING} {code: Neo.ClientNotification.Statement.UnknownPropertyKeyWarning} {category: UNRECOGNIZED} {title: The provided property key is not in the database} {description: One of the property names in your query is not available in the database, make sure you didn't misspell it or that the label is available when you run this statement in your application (the missing property name is: name)} {position: line: 20, column: 22, offset: 1336} for query: '\n            MATCH (n)\n            WHERE n.embedding IS NOT NULL AND n.user_id = $user_id\n            WITH n, \n                round(reduce(dot = 0.0, i IN range(0, size(n.embedding)-1) | dot + n.embedding[i] * $n_embedding[i]) / \n                (sqrt(reduce(l2 = 0.0, i IN range(0, size(n.embedding)-1) | l2 + n.embedding[i] * n.embedding[i])) * \n                sqrt(reduce(l2 = 0.0, i IN range(0, size($n_embedding)-1) | l2 + $n_embedding[i] * $n_embedding[i]))), 4) AS similarity\n            WHERE similarity >= $threshold\n            MATCH (n)-[r]->(m)\n            RETURN n.name AS source, elementId(n) AS source_id, type(r) AS relation, elementId(r) AS relation_id, m.name AS destination, elementId(m) AS destination_id, similarity\n            UNION\n            MATCH (n)\n            WHERE n.embedding IS NOT NULL AND n.user_id = $user_id\n            WITH n, \n                round(reduce(dot = 0.0, i IN range(0, size(n.embedding)-1) | dot + n.embedding[i] * $n_embedding[i]) / \n                (sqrt(reduce(l2 = 0.0, i IN range(0, size(n.embedding)-1) | l2 + n.embedding[i] * n.embedding[i])) * \n                sqrt(reduce(l2 = 0.0, i IN range(0, size($n_embedding)-1) | l2 + $n_embedding[i] * $n_embedding[i]))), 4) AS similarity\n            WHERE similarity >= $threshold\n            MATCH (m)-[r]->(n)\n            RETURN m.name AS source, elementId(m) AS source_id, type(r) AS relation, elementId(r) AS relation_id, n.name AS destination, elementId(n) AS destination_id, similarity\n            ORDER BY similarity DESC\n            '
WARNING:neo4j.notifications:Received notification from DBMS server: {severity: WARNING} {code: Neo.ClientNotification.Statement.UnknownPropertyKeyWarning} {category: UNRECOGNIZED} {title: The provided property key is not in the database} {description: One of the property names in your query is not available in the database, make sure you didn't misspell it or that the label is available when you run this statement in your application (the missing property name is: embedding)} {position: line: 16, column: 84, offset: 1070} for query: '\n            MATCH (n)\n            WHERE n.embedding IS NOT NULL AND n.user_id = $user_id\n            WITH n, \n                round(reduce(dot = 0.0, i IN range(0, size(n.embedding)-1) | dot + n.embedding[i] * $n_embedding[i]) / \n                (sqrt(reduce(l2 = 0.0, i IN range(0, size(n.embedding)-1) | l2 + n.embedding[i] * n.embedding[i])) * \n                sqrt(reduce(l2 = 0.0, i IN range(0, size($n_embedding)-1) | l2 + $n_embedding[i] * $n_embedding[i]))), 4) AS similarity\n            WHERE similarity >= $threshold\n            MATCH (n)-[r]->(m)\n            RETURN n.name AS source, elementId(n) AS source_id, type(r) AS relation, elementId(r) AS relation_id, m.name AS destination, elementId(m) AS destination_id, similarity\n            UNION\n            MATCH (n)\n            WHERE n.embedding IS NOT NULL AND n.user_id = $user_id\n            WITH n, \n                round(reduce(dot = 0.0, i IN range(0, size(n.embedding)-1) | dot + n.embedding[i] * $n_embedding[i]) / \n                (sqrt(reduce(l2 = 0.0, i IN range(0, size(n.embedding)-1) | l2 + n.embedding[i] * n.embedding[i])) * \n                sqrt(reduce(l2 = 0.0, i IN range(0, size($n_embedding)-1) | l2 + $n_embedding[i] * $n_embedding[i]))), 4) AS similarity\n            WHERE similarity >= $threshold\n            MATCH (m)-[r]->(n)\n            RETURN m.name AS source, elementId(m) AS source_id, type(r) AS relation, elementId(r) AS relation_id, n.name AS destination, elementId(n) AS destination_id, similarity\n            ORDER BY similarity DESC\n            '
WARNING:neo4j.notifications:Received notification from DBMS server: {severity: WARNING} {code: Neo.ClientNotification.Statement.UnknownPropertyKeyWarning} {category: UNRECOGNIZED} {title: The provided property key is not in the database} {description: One of the property names in your query is not available in the database, make sure you didn't misspell it or that the label is available when you run this statement in your application (the missing property name is: user_id)} {position: line: 3, column: 61, offset: 71} for query: '\n            MATCH (n)\n            WHERE n.embedding IS NOT NULL AND n.user_id = $user_id\n            WITH n, \n                round(reduce(dot = 0.0, i IN range(0, size(n.embedding)-1) | dot + n.embedding[i] * $n_embedding[i]) / \n                (sqrt(reduce(l2 = 0.0, i IN range(0, size(n.embedding)-1) | l2 + n.embedding[i] * n.embedding[i])) * \n                sqrt(reduce(l2 = 0.0, i IN range(0, size($n_embedding)-1) | l2 + $n_embedding[i] * $n_embedding[i]))), 4) AS similarity\n            WHERE similarity >= $threshold\n            MATCH (n)-[r]->(m)\n            RETURN n.name AS source, elementId(n) AS source_id, type(r) AS relation, elementId(r) AS relation_id, m.name AS destination, elementId(m) AS destination_id, similarity\n            UNION\n            MATCH (n)\n            WHERE n.embedding IS NOT NULL AND n.user_id = $user_id\n            WITH n, \n                round(reduce(dot = 0.0, i IN range(0, size(n.embedding)-1) | dot + n.embedding[i] * $n_embedding[i]) / \n                (sqrt(reduce(l2 = 0.0, i IN range(0, size(n.embedding)-1) | l2 + n.embedding[i] * n.embedding[i])) * \n                sqrt(reduce(l2 = 0.0, i IN range(0, size($n_embedding)-1) | l2 + $n_embedding[i] * $n_embedding[i]))), 4) AS similarity\n            WHERE similarity >= $threshold\n            MATCH (m)-[r]->(n)\n            RETURN m.name AS source, elementId(m) AS source_id, type(r) AS relation, elementId(r) AS relation_id, n.name AS destination, elementId(n) AS destination_id, similarity\n            ORDER BY similarity DESC\n            '
WARNING:neo4j.notifications:Received notification from DBMS server: {severity: WARNING} {code: Neo.ClientNotification.Statement.UnknownPropertyKeyWarning} {category: UNRECOGNIZED} {title: The provided property key is not in the database} {description: One of the property names in your query is not available in the database, make sure you didn't misspell it or that the label is available when you run this statement in your application (the missing property name is: name)} {position: line: 10, column: 22, offset: 580} for query: '\n            MATCH (n)\n            WHERE n.embedding IS NOT NULL AND n.user_id = $user_id\n            WITH n, \n                round(reduce(dot = 0.0, i IN range(0, size(n.embedding)-1) | dot + n.embedding[i] * $n_embedding[i]) / \n                (sqrt(reduce(l2 = 0.0, i IN range(0, size(n.embedding)-1) | l2 + n.embedding[i] * n.embedding[i])) * \n                sqrt(reduce(l2 = 0.0, i IN range(0, size($n_embedding)-1) | l2 + $n_embedding[i] * $n_embedding[i]))), 4) AS similarity\n            WHERE similarity >= $threshold\n            MATCH (n)-[r]->(m)\n            RETURN n.name AS source, elementId(n) AS source_id, type(r) AS relation, elementId(r) AS relation_id, m.name AS destination, elementId(m) AS destination_id, similarity\n            UNION\n            MATCH (n)\n  
@koi646
Copy link
Contributor Author

koi646 commented Oct 20, 2024

neo4j database is empty..

@koi646
Copy link
Contributor Author

koi646 commented Oct 21, 2024

Neo4j verison 5.20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants