Skip to content

Azure AI Search

The image shows a cartoon-like computer interface featuring a "retrieval index" with a magnifying glass icon and several files, which are illustrated with animal icons of cats and dogs. This represents the process of indexing in a vector database. There is a visual flow from the files to the database, using icons to depict cats and dogs for the purpose of similarity search. The style is characterized by bold geometric shapes, using a limited corporate color palette of five colors, and maintaining a simple 8-bit aesthetic.
Generated by 🤖 AI

The retrieval APIs has been extended to support Azure AI Search. This allows you to index files using embeddings into a vector database that can be used for similarity search. This is commonly referred to as Retrieval Augmented Generation (RAG).

// index creation
const index = retrieval.index("animals", { type: "azure_ai_search" })
// indexing
await index.insertOrUpdate(env.files)
// search
const res = await index.search("cat dog")
def("RAG", res)

GenAIScript provides a simple and efficient way to interact with Azure AI Search. It will handle chunking, vectorization, and indexing of the files. The retrieval.index function creates an index with the specified name and type. The insertOrUpdate function indexes the files into the database. Finally, the search function retrieves the files that match the query.

One can also use the command line interface to index files ahead of time.