{"id":14959601,"url":"https://github.com/tomasonjo/neogpt-recommender","last_synced_at":"2025-06-19T19:36:33.546Z","repository":{"id":153657831,"uuid":"623451190","full_name":"tomasonjo/NeoGPT-Recommender","owner":"tomasonjo","description":"Context-aware knowledge-graph based chatbot using GPT4 and Neo4j","archived":false,"fork":false,"pushed_at":"2024-01-07T12:10:36.000Z","size":118,"stargazers_count":155,"open_issues_count":0,"forks_count":50,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-02T12:43:59.969Z","etag":null,"topics":["chatbot","chatgpt","gpt4","neo4j","streamlit"],"latest_commit_sha":null,"homepage":"https://medium.com/neo4j/context-aware-knowledge-graph-chatbot-with-gpt-4-and-neo4j-d3a99e8ae21e","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomasonjo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-04T11:57:39.000Z","updated_at":"2025-04-30T08:36:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"b5231bc0-3fbe-42b5-a0c5-c401cd9a80d7","html_url":"https://github.com/tomasonjo/NeoGPT-Recommender","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tomasonjo/NeoGPT-Recommender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasonjo%2FNeoGPT-Recommender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasonjo%2FNeoGPT-Recommender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasonjo%2FNeoGPT-Recommender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasonjo%2FNeoGPT-Recommender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomasonjo","download_url":"https://codeload.github.com/tomasonjo/NeoGPT-Recommender/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasonjo%2FNeoGPT-Recommender/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260816874,"owners_count":23067393,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatbot","chatgpt","gpt4","neo4j","streamlit"],"created_at":"2024-09-24T13:20:12.187Z","updated_at":"2025-06-19T19:36:28.533Z","avatar_url":"https://github.com/tomasonjo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NeoGPT-Recommender\n\nIdea behind this repository is to create a context-aware chatbot that can read from and update a Neo4j database.\nThe Cypher is generated using GPT-4 endpoint, while the answers are generated with gpt-3.5-turbo model based on the information from the database.\n\nLearn more: https://medium.com/neo4j/context-aware-knowledge-graph-chatbot-with-gpt-4-and-neo4j-d3a99e8ae21e\n\n## Neo4j database\n\nThe project uses the [Recommendation project](https://sandbox.neo4j.com/?usecase=recommendations) that is available as part of the Neo4j Sandbox.\nIf you want a local instance of Neo4j, you can restore a database dump that is available [here](https://github.com/neo4j-graph-examples/recommendations/tree/main/data).\n\n## Environment variables\n\nMake sure to populate the environment variables as shown in the `.env.example` file\n\n## Start the project\n\nRun the project using\n\n```\ndocker-compose up\n```\n\nand then open the localhost:8501 address in your favourite browser\n\n![Chatbot](./chatbot.png)\n\n## Training examples for the english2cypher part\n\nYou can use the following example to get an idea what this chatbot is capable of\n\n```\n# I don't like comedy\nMATCH (u:User {id: $userId}), (g:Genre {name:\"Comedy\"})\nMERGE (u)-[:DISLIKE_GENRE]-\u003e(g)\nRETURN distinct {answer: 'noted'} AS result\n# I like comedy\nMATCH (u:User {id: $userId}), (g:Genre {name:\"Comedy\"})\nMERGE (u)-[:LIKE_GENRE]-\u003e(g)\nRETURN distinct {answer: 'noted'} AS result\n# I have already watched Top Gun\nMATCH (u:User {id: $userId}), (m:Movie {title:\"Top Gun\"})\nMERGE (u)-[:WATCHED]-\u003e(m)\nRETURN distinct {answer: 'noted'} AS result\n# I like Top Gun\nMATCH (u:User {id: $userId}), (m:Movie {title:\"Top Gun\"})\nMERGE (u)-[:LIKE_MOVIE]-\u003e(m)\nRETURN distinct {answer: 'noted'} AS result\n# What is a good comedy?\nMATCH (u:User {id:$userId}), (m:Movie)-[:IN_GENRE]-\u003e(:Genre {name:\"Comedy\"})\nWHERE NOT EXISTS {(u)-[:WATCHED]-\u003e(m)}\nRETURN {movie: m.title} AS result\nORDER BY m.imdbRating DESC LIMIT 1\n# Who played in Top Gun?\nMATCH (m:Movie)\u003c-[:ACTED_IN]-(a)\nRETURN {actor: a.name} AS result\n# What is the plot of the Copycat movie?\nMATCH (m:Movie {title: \"Copycat\"})\nRETURN {plot: m.plot} AS result\n# Did Luis Guzmán appear in any other movies?\nMATCH (p:Person {name:\"Luis Guzmán\"})-[:ACTED_IN]-\u003e(movie)\nRETURN {movie: movie.title} AS result\n# Do you know of any matrix movies?\nMATCH (m:Movie)\nWHERE toLower(m.title) CONTAINS toLower(\"matrix\")\nRETURN {movie:m.title} AS result\n# Which movies do I like?\nMATCH (u:User {id: $userId})-[:LIKE_MOVIE]-\u003e(m:Movie)\nRETURN {movie:m.title} AS result\n# Recommend a movie\nMATCH (u:User {id: $userId})-[:LIKE_MOVIE]-\u003e(m:Movie)\nMATCH (m)\u003c-[r1:RATED]-()-[r2:RATED]-\u003e(otherMovie)\nWHERE r1.rating \u003e 3 AND r2.rating \u003e 3 AND NOT EXISTS {(u)-[:WATCHED|LIKE_MOVIE|DISLIKE_MOVIE]-\u003e(otherMovie)}\nWITH otherMovie, count(*) AS count\nORDER BY count DESC\nLIMIT 1\nRETURN {recommended_movie:otherMovie.title} AS result\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasonjo%2Fneogpt-recommender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomasonjo%2Fneogpt-recommender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasonjo%2Fneogpt-recommender/lists"}