Company
Date Published
Sept. 23, 2024
Author
Sigal Shaharabani - Technical Leader, Tikal
Word count
3023
Language
English
Hacker News points
1

Summary

The author of this text is an amateur dancer who uses genAI technologies to find cultural events and festivals in Europe for their dance troupe. They use a generative AI chatbot to get recommendations from various genAI services, but are not satisfied with the quality of the results. The author decides to use Retrieval Augmented Generation (RAG) to enrich and optimize the output of the LLM. They create an external data source using the predictHQ's events API and store their external data in a Couchbase collection. The author then creates a vector search index on the embeddings fields, choosing the dot product as the similarity metric. They use LangChain and LangGraph to build an application that fetches data from the vector store and adds it to the LLM prompt context. The application includes two nodes: "vector_search" (entry point) and "chatbot" (finish point). The chatbot node takes the information from the messages and embeds it into the prompt question to the LLM. The author visualizes their graph using IPython.display.Image and displays a Mermaid diagram of the graph. They demonstrate how to use the graph to stream events and display the output in Markdown format.