Notebooks
W
Weaviate
RetrievalAugmentedGeneration Weaviate (1)

RetrievalAugmentedGeneration Weaviate (1)

vector-searchdotnetvector-databaseretrieval-augmented-generationllm-frameworksfunction-callingweaviate-recipesintegrationssemantic-kernelPythongenerative-aillm-agent-frameworks

Introduction - RAG with Semantic Kernel

Implements a simple workflow of retrieve then generate. using semantic kernel to help with prompt engineering and orchestrating OpenAI API calls and Weaviate as knowledgebase from which to retreive semantically relevant context. This allows us to not only control what is being generated but also cite sources.

Setup

[ ]

OS-specific notes:

  • if you run into SSL errors when connecting to OpenAI on macOS, see this issue for a potential solution
  • on Windows, you may need to run Docker Desktop as administrator
[ ]

Then, we register the memory store to the kernel:

[ ]

First with no RAG, just Generate:

[ ]
[ ]

Manually adding memories

Let's create some initial memories "About Me". We can add memories to our weaviate memory store by using save_information_async

[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]