WhoBuilt

Knowledge Graphs & GraphRAG: Techniques for Building Effective GenAI Applications

Nov 1, 2024· 1 h 40 min· 23K views·Watch on YouTube

Speaker

Zach Blumenthal leads an interactive AI Engineer workshop on building GraphRAG applications with Neo4j, using a fashion recommendation example and help from workshop assistants Andreas, Michael Hunger, and Torge.

Build a graph and add text search

Blumenthal explains retrieval-augmented generation and combines vector search, graph traversal, and graph data science. The workshop loads H&M fashion data into Neo4j as customers, articles, products, departments, and purchase transactions. Product descriptions are embedded and indexed so prompts such as “denim jeans” can retrieve similar products.

Personalize results with purchase patterns

The workshop connects vector results to customers’ purchase histories. It finds customers with overlapping purchases, then uses what those peers bought to rerank product suggestions. Blumenthal notes that combining scores by multiplication is a starting point; filtering and ranking choices depend on data density and should be evaluated with labeled outcomes.

Use graph embeddings for recommendations

Blumenthal uses Neo4j Graph Data Science to project co-purchase behavior onto article relationships and create 120-dimensional FastRP node embeddings. A k-nearest-neighbors step writes “customers also like” relationships, which can support recommendations across multiple hops. The resulting vectors represent graph structure and help infer links that would be difficult to find with repeated queries alone.

Combine retrieval in an email assistant

Two retrievers feed a LangChain prompt: personalized search results and recommendations based on graph embeddings. GPT-4o uses those products, a customer name, interests, and the time of year to draft a recommendation email. In the Gradio demo, the same search prompt can produce different products for different customers, while changing the season steers the email’s seasonal framing.

Takeaways

  • Combine semantic similarity with graph relationships when recommendations need both relevance and customer context.
  • Use purchase overlap as a practical collaborative-filtering signal, and test reranking methods against labeled outcomes.
  • Graph embeddings can turn multihop structure into vectors and inferred links for recommendation tasks.
  • Keep retrieval and generation separate: provide the LLM curated product lists and clear constraints for its response.

Mentioned in this talk

Search inside this talk

What was claimed 13

Related talks