> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ai21.com/llms.txt
> Use this file to discover all available pages before exploring further.

# File Library

> How to Use File Library in AI21 Studio 

## Overview

The **File Library** in AI21 Studio serves as a centralized **knowledge base** for uploading, organizing, and managing organizational documents.

Once uploaded, these documents can be used to provide relevant context to Large Language Models (LLMs) when generating responses, enabling more accurate, grounded, and domain-aware outputs.

## Key Capabilities

* **Upload workspace documents** in supported formats (PDF, DOCX, HTML, TXT, Markdown)
* **Define data schemas** to enforce structure and consistency across similar document types
* **Search files** by name, date, ID, labels, or source
* **Select and filter documents** in the File Library
* **Edit file metadata**, including labels and paths
* **Delete outdated or unused files**

## **Upload a Document to File Library**

### **Step 1: Open the File Library Section**

<Expandable title="Content">
  Navigate to [<u>File Library</u>](https://studio.ai21.com/v2/workspaces/429d8ce9-0f35-4626-a48c-231d28db34a8/rag-engine) from the left-hand menu in AI21 Studio.

  <img src="https://mintcdn.com/ai21-demo/TOeFiF_5boUnKc42/images/FileLibrarynavigation.png?fit=max&auto=format&n=TOeFiF_5boUnKc42&q=85&s=5ab147e64c225cdc2896f921df62a76d" alt="File Librarynavigation Pn" width="1863" height="687" data-path="images/FileLibrarynavigation.png" />
</Expandable>

### **Step 2: Add a Document**

<Expandable title="Content">
  Click the **Add Document** button.

  <img src="https://mintcdn.com/ai21-demo/TOeFiF_5boUnKc42/images/clickonadddocument.png?fit=max&auto=format&n=TOeFiF_5boUnKc42&q=85&s=0398f954c734372956fafc8f6c6a5b6c" alt="Clickonadddocument Pn" width="1863" height="687" data-path="images/clickonadddocument.png" />
</Expandable>

### **Step 3: Select One or More Files to Upload**

<Expandable title="Content">
  Supported file formats: **PDF, DOCX, TXT, HTML**, and **Markdown**.

  <Info>
    You can upload up to **50 files,** each up to **100MB** in size, with a total limit of **1GB**.
  </Info>

  <img src="https://mintcdn.com/ai21-demo/TOeFiF_5boUnKc42/images/selectfilestolibrary.png?fit=max&auto=format&n=TOeFiF_5boUnKc42&q=85&s=9838c13fafe0fb922451696002f5ef8e" alt="Selectfilestolibrary Pn" width="1868" height="767" data-path="images/selectfilestolibrary.png" />

  <img src="https://mintcdn.com/ai21-demo/TOeFiF_5boUnKc42/images/chooseaspecificfile.png?fit=max&auto=format&n=TOeFiF_5boUnKc42&q=85&s=341662c38c55f91da2e76e0bbd517f84" alt="Chooseaspecificfile Pn" width="1869" height="896" data-path="images/chooseaspecificfile.png" />
</Expandable>

### **Step 4: Label Your Documents**

<Expandable title="Content">
  Add new or existing labels to your documents, or leave the field blank to skip this step.\
  Type labels and press enter to add.

  <img src="https://mintcdn.com/ai21-demo/fvYV9rXl_voJTySg/images/Labelyourdocument.png?fit=max&auto=format&n=fvYV9rXl_voJTySg&q=85&s=4223553d6941bcf1ce2d7b975b7f3db4" alt="Labelyourdocument Pn" width="1862" height="791" data-path="images/Labelyourdocument.png" />
</Expandable>

### **Step 5: Connect**

<Expandable title="Content">
  Click **Connect** to start ingesting the data.

  <img src="https://mintcdn.com/ai21-demo/fvYV9rXl_voJTySg/images/connectthedataconnector.png?fit=max&auto=format&n=fvYV9rXl_voJTySg&q=85&s=88672e57ef42fb9a6ca20d0487f3c9ac" alt="Connectthedataconnector Pn" width="2906" height="1396" data-path="images/connectthedataconnector.png" />
</Expandable>

### **Step 6: View the New Files in File Library**

<Expandable title="Content">
  Once uploaded, the new documents will appear in the list.

  <img src="https://mintcdn.com/ai21-demo/fvYV9rXl_voJTySg/images/Uploadedfile.png?fit=max&auto=format&n=fvYV9rXl_voJTySg&q=85&s=1f19bc666c13936cf2f5d2b04fd0496d" alt="Uploadedfile Pn" width="1850" height="749" data-path="images/Uploadedfile.png" />

  ##
</Expandable>

## Search and Filter Files

### Step 1: Choose a Filter

<Expandable title="Content">
  Select how you want to filter the files from the dropdown menu. \
  You can filter files by:

  * Name
  * Date
  * ID
  * Label
  * Source

      <img src="https://mintcdn.com/ai21-demo/dvJVHvv1CQCXVWca/images/Filter.png?fit=max&auto=format&n=dvJVHvv1CQCXVWca&q=85&s=13bd62e33c0a80a660fb4d2de23a9133" alt="Filter Pn" width="1455" height="708" data-path="images/Filter.png" />
</Expandable>

### Step 2: Search for Specific Documents

<Expandable title="Content">
  Fill in the search field based on your selected filter.\
  \
  For example:

  * If you filter by **label**, the search field becomes a dropdown showing all available labels.

      <img src="https://mintcdn.com/ai21-demo/dvJVHvv1CQCXVWca/images/Searchbylabel.png?fit=max&auto=format&n=dvJVHvv1CQCXVWca&q=85&s=f8ee698e16dd107476fe6f1a2e29458e" alt="Searchbylabel Pn" width="1452" height="706" data-path="images/Searchbylabel.png" />

  If you filter by **date**, enter a date, and the matching results will automatically appear.
</Expandable>

### Optional: Select all documents

<Expandable title="Content">
  To select all documents in the File Library, click **Select All**.

  <img src="https://mintcdn.com/ai21-demo/dzf1I4EozPL5kIq-/images/clickselectall.png?fit=max&auto=format&n=dzf1I4EozPL5kIq-&q=85&s=a36f633eeac1b41107bb14c7cadd19d2" alt="Clickselectall Pn" width="1452" height="710" data-path="images/clickselectall.png" />

  <img src="https://mintcdn.com/ai21-demo/GbZGVKd_-lMu1RUU/images/WarchSelectall.png?fit=max&auto=format&n=GbZGVKd_-lMu1RUU&q=85&s=3f6ad4464587e45a93378ab124b6b372" alt="Warch Selectall Pn" width="1455" height="711" data-path="images/WarchSelectall.png" />
</Expandable>

## Delete Files From File Library

### **Step 1:** Locate and Select the File(s) You Want to Delete

<Expandable title="Content">
  In the table, select the file you want to delete from the \*\*Name \*\*column.

  <img src="https://mintcdn.com/ai21-demo/4aYVgsQJYtgytrm8/images/Selectafile.png?fit=max&auto=format&n=4aYVgsQJYtgytrm8&q=85&s=f196c2e09afffeff8307631134f81a60" alt="Selectafile Pn" width="1849" height="749" data-path="images/Selectafile.png" />
</Expandable>

### **Step 2:**  Delete the Selected Files

<Expandable title="Content">
  * On the right side of the table, click the (⋮) icon.

      <img src="https://mintcdn.com/ai21-demo/CA37nkobpGJ0Ke-s/images/choosedelete.png?fit=max&auto=format&n=CA37nkobpGJ0Ke-s&q=85&s=36fd2ca38006737d633bac890195b91d" alt="Choosedelete Pn" width="1847" height="736" data-path="images/choosedelete.png" />

  * Click  **Delete**.

      <img src="https://mintcdn.com/ai21-demo/CA37nkobpGJ0Ke-s/images/CLICKDELETE.png?fit=max&auto=format&n=CA37nkobpGJ0Ke-s&q=85&s=3853323ebf1d3e7ac96c32293723089c" alt="CLICKDELETE Pn" width="1597" height="704" data-path="images/CLICKDELETE.png" />
</Expandable>

### **Step 3:** Confirm Deletion

<Expandable title="Content">
  A confirmation dialog will appear. Choose whether to delete the file or cancel the action.

  <img src="https://mintcdn.com/ai21-demo/CA37nkobpGJ0Ke-s/images/Confirmthisisthefileyouwanttodelete.png?fit=max&auto=format&n=CA37nkobpGJ0Ke-s&q=85&s=4b621a44473910ed10048a836fd7b282" alt="Confirmthisisthefileyouwanttodelete Pn" width="1913" height="841" data-path="images/Confirmthisisthefileyouwanttodelete.png" />
</Expandable>

### Step 4: View the Updated Document List

<Expandable title="Content">
  After deleting the selected file(s), the updated document list will be displayed in the File Library.

  <img src="https://mintcdn.com/ai21-demo/1J_PCGvE2Ph1W9CH/images/Updatedlistfilelibrary.png?fit=max&auto=format&n=1J_PCGvE2Ph1W9CH&q=85&s=7809f6190a5bc1fa81fda511d5fe2dc3" alt="Updatedlistfilelibrary Pn" width="1866" height="665" data-path="images/Updatedlistfilelibrary.png" />
</Expandable>

## **Next steps**

Check the API Refernce:

* [Upload Workspace Files](https://docs.ai21.com/reference/manage-library-ref/upload-workspace-files)
* [**List Library Files**](https://docs.ai21.com/reference/manage-library-ref/list-library-files)
* [**Update File**](https://docs.ai21.com/reference/manage-library-ref/update-file)
* [**Delete File**](https://docs.ai21.com/reference/manage-library-ref/delete-file)

Use the File Library in [AI21 Studio](https://studio.ai21.com/v2?tab=file_library).
