RAG Engine Overview

AI21's RAG Engine offers enterprises an all-in-one solution for implementing Retrieval-Augmented Generation. You can use the RAG Engine to upload your documents (PDF, DOCX, HTML, or TXT), query those documents in natural language, search for topics within those documents, and more.

The RAG Engine comprises the following parts, each of which can be called individually:

  • A document library manager: Upload files into the library and parse the content into text and content. The library can read several different formats, including PDFs, and can understand complex structures such as tables.
  • A tokenizer to help parse the documents and any queries against them.
  • A segmentation engine that divides a document into similar adjacent topic blocks.
  • An embedding engine that generates a vector representation of text, to enable the model to understand the source documents as well as a submitted query.
  • Semantic search, which can search documents in the library for specific topics or keywords.
  • A Contextual Answers model to query your documents and generate an answer based solely on the content of those documents.

Library specifics

To see details such as supported file formats and max file sizes, see the file upload reference.


Seamless integration between retrieval and generation

RAG Engine automatically integrates with many of our task-specific models, so you can surface search results or provide a grounded answer to a query based on your organizational data – all within a single API call. You can also connect RAG Engine with a foundation model like Jurassic – and use Semantic Search results within a prompt.

Support for several file formats

The RAG Engine supports several different file types including PDF. The parser understands complex layouts, including tables.

Built-in data source integration

You can integrate your organization’s data sources, such as Google Drive, Amazon S3, and others, to automatically sync documents with RAG Engine. To enable data source integration, contact us.

Secure and appropriate access to documents

The RAG Engine adheres to organizational user and group permissions with a comprehensive approach that addresses the intricate needs of document management in modern, data-intensive environments.

Current limitations

  • OCR functionality is not available at this time. Only PDF documents that contain a text layer are supported.
  • Some PDFs may take longer to process, depending on their content.