{"id":20519794,"url":"https://github.com/dianaow/products-knowledge-graph","last_synced_at":"2025-09-25T11:30:55.354Z","repository":{"id":221004236,"uuid":"753111591","full_name":"dianaow/products-knowledge-graph","owner":"dianaow","description":"Implementing Retrieval-Augmented Generation (RAG) with constructed Knowledge Graph","archived":false,"fork":false,"pushed_at":"2024-10-02T14:27:57.000Z","size":2255,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-15T22:16:04.646Z","etag":null,"topics":["knowledge-graph","langchain","langchain-python","neo4j","rag","vector-search"],"latest_commit_sha":null,"homepage":"https://dianaow.com/blog/knowledge-graph-rag/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dianaow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-02-05T13:49:27.000Z","updated_at":"2024-10-02T14:28:44.000Z","dependencies_parsed_at":"2024-02-05T17:45:10.984Z","dependency_job_id":null,"html_url":"https://github.com/dianaow/products-knowledge-graph","commit_stats":null,"previous_names":["dianaow/products-knowledge-graph"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dianaow%2Fproducts-knowledge-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dianaow%2Fproducts-knowledge-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dianaow%2Fproducts-knowledge-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dianaow%2Fproducts-knowledge-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dianaow","download_url":"https://codeload.github.com/dianaow/products-knowledge-graph/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234184049,"owners_count":18792801,"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":["knowledge-graph","langchain","langchain-python","neo4j","rag","vector-search"],"created_at":"2024-11-15T22:16:23.079Z","updated_at":"2025-09-25T11:30:49.983Z","avatar_url":"https://github.com/dianaow.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Implementing Retrieval-Augmented Generation (RAG) with a Knowledge Graph (KG)\n\n### Constructing a KG with skincare products found on an e-commerce website\n### Product similarity search with vector embeddings\nTools: Python, OpenAI (free tier), LangChain, Neo4j\n\n### Set up\n1. Create a Python virtual environment where the dependencies for this project will be installed.\n```\ncd server\npython3 -m venv venv\n```\n\n2. Activate the environment and install all the packages available in the requirement.txt file.\n```\nsource venv/bin/activate\npip install -r ./requirements.txt\n```\n\n3. If a  `.env` file is not present in the server folder, create one to store the private OpenAI API key, which is required to use the LLMs. \n```\nOPENAI_API_KEY=XXXXXX\nNEO4J_PW=XXX\n```\n\n4. Run the Python script to web scrape product information found online.\n```\npython3 web_scrape.py\n```\n\n5. The `llm_kg.ipynb` file explains:\n- How to use LLM to extract new relations from product descriptions and construct Knowledge Graph\n- Methods to query the graph database (based on embeddings, LLM-generated entities in prompt, Cypher)\n\n\n![Image of Knowledge Graph](https://github.com/dianaow/products-knowledge-graph/blob/main/graph_overview.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdianaow%2Fproducts-knowledge-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdianaow%2Fproducts-knowledge-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdianaow%2Fproducts-knowledge-graph/lists"}