RAG

a.k.a. Retrieval-augmented generation

Allow LLMs use data outside of their training set, by:

  1. Querying a large dataset (e.g. a db) for information relevant to your query.
  2. Including that information in the LLM prompt

Example:

  1. Load documents (websites, PDFs, .md files)
  2. Create embeddings for the documents
  3. Store them in a vector db (e.g. sqlite w. a vector extension or ChromaDB)
  4. Find the closest documents in a vector db given the query
  5. Pass those documents to the LLM prompt as context
  6. Return the prompt result

Deep learning

Want to receive my work as I publish it? Subscribe here.

a giant foot-shaped snail with a house on its back. the house is still in construction, with a big crane towering above it The image is a stylized black-and-white illustration. In the lower left corner, there is a small, cozy-looking house with smoke rising from its chimney. The smoke, however, does not dissipate into the air but instead forms a dark, looming cloud. Within the cloud, the silhouette of a large, menacing face is visible, with its eyes and nose peeking through the darkness. The creature, perhaps a cat, appears to be watching over the house ominously, creating a sense of foreboding or unease.