Nearest Neighbors, Distant Words: Unleashing the Power of ANN in LLMs

Mikk Rätsep

Milad Rastian


You’ve mastered the “Hello World” of Large Language Models (LLMs) and are eager to expand your skills to build a real application. However, you quickly realize that basic knowledge is not enough.

This journey involves numerous steps, including selecting the right model, data gathering, fine-tuning, retrieval methods and embeddings that enhance the performance and quality of your application.

In this talk, we will focus on a retrieval method called approximate nearest neighbors (ANN): what they are, how to use them, and how to integrate them with other LLMs like OpenAI and LLaMA2. The goal is to improve the quality of responses while minimizing costs and overcome the techincal limitation that LLM have.

This presentation will be conducted in a Livebook notebook.

Key takeaways:

Introduce the audience to:

  • ANN
  • Embedding in LLM
  • Vector Database (e.g pgvector)
  • Intro in building apps with langchain hex package


  • People who are new to the world of AI and LLMs and are still trying to get their heads around these complex technologies and jargons

Level: Intermediate

Tags: Langchain, LLM, Vector-database

Format: In-person