13 Knowledge graph-powered retrieval augmented generation

 

This chapter covers

  • The AI agents: LLMs made useful
  • Retrieval Augmented Generation: grounding LLMs using context
  • Building first KG-powered Retrieval Augmented Generation system

The year 2023 could be considered as a year of true AI upheaval. Data scientists and ML engineers alike working in Natural Language Processing and Understanding domain were not just given a new toy, but their whole work lives were soon turned upside down. The release of OpenAI’s GPT-3.5 model at the end of 2022 marked a truly transformative change. Suddenly, one didn’t need to spend months, or more likely years, on building custom training datasets and models for each specific downstream task. With as little as a bit of clever prompt engineering, almost anyone, not just ML specialists, could build applications in natural language domain.

Although Large Language Models are powerful, they are far from a magic solution for everything. As more and more people got hands-on, it became apparent that true transformative changes won’t happen quickly, they have to be deserved: the technology needs to go through the usual hype cycle. Anyone who tried to go beyond simple fun exercises with chatbotting in “question in, answer out” manner quickly realized that lots of work remains to be done, not just on the model architecture and training side of things. The concept of AI Agents, related implementation libraries and whole LLMOps was born.

13.1 The AI Agents

13.2 Chatting with the Large Language Model

13.3 Challenges in production environment

13.4 Chatting with the AI about private data

13.4.1 Retrieval Augmented Generation

13.4.2 Vector-based RAG limitations

13.4.3 Graph RAG

13.4.4 Reasoning Agents

13.4.5 Let’s chat with our Knowledge Graph!

13.5 Summary

13.6 References