# Creating a Knowledge Base

### The Knowledge Base Dashboard

StackAI allows you to create a knowledge base from uploaded documents, tables, Dropbox, Google Drive, Sharepoint, etc.&#x20;

In the [**Knowledge Base Dashboard**,](https://www.stackai.com/dashboard/knowledge-bases) you can customize upload settings, upload files, import data from external connections, and manage access permissions.&#x20;

<figure><img src="/files/lEzM9LzJzl9IJUDbMs8l" alt=""><figcaption></figcaption></figure>

You can also create new knowledge bases on the fly from within the workflow builder. Right click to add a Knowledge Base node and import files there.

<figure><img src="/files/TPaQFkF6ReyNfQCjp1dP" alt=""><figcaption></figcaption></figure>

***

### Upload Settings

Before importing any files, you can customize how files are processed and indexed in your knowledge base using **Upload Settings**. This step is optional, as the default settings suffice for most use cases.

<figure><img src="/files/rFpSxoH8PxXrdmyTgj5B" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/H9tHMxPl38laKGnVjsaP" alt=""><figcaption></figcaption></figure>

1. **Chunking Algorithm**: Choose where and how files are broken down for indexing. Sentence-based chunking is more granular; files are broken down into sentence chunks.&#x20;
2. **Chunk Length**: Define the maximum size of each chunk in characters.&#x20;
3. **Chunk Overlap**: Specify how much content should overlap between chunks. Some overlap can improve retrieval, as it avoids fragmentation.
4. **OCR (Optical Character Recognition)**: This setting will slow down the indexing process for the knowledge base. Only enable this if you need to extract text from images or visual-heavy presentations.&#x20;
5. **Advanced Data Extraction**: Activate for enhanced processing of complex files.
6. **Embedding Model**: Select the AI model for embedding and indexing files.

#### Example Setting:

* Chunking Algorithm: Sentence-based
* Chunk Length: 2,500 characters
* Embedding Model: `text-embedding-3-large`

#### **A note on chunking algorithms**

StackAI implements both `sentence` and `naive` chunking algorithms:

**Naive Algorithms** are typically simpler and less sophisticated. They often rely on basic methods like searching for specific keywords or phrases.&#x20;

* **Lack of Context Understanding:** they usually don't understand the context or the structure of the language. For example, a naive algorithm might count the frequency of words without understanding their meaning or part of speech.&#x20;
* **Speed and Efficiency:** due to their simplicity, these algorithms can be faster and more efficient, especially for straightforward tasks.&#x20;
* **Limitations:** naive algorithms are generally less accurate in complex language processing tasks. They might miss nuances, sarcasm, or idiomatic expressions.

**Sentence Chunking Algorithms** are more sophisticated. They involve breaking down text into syntactically correlated parts of words like noun phrases, verb phrases, etc.&#x20;

* **Context and Structure Understanding:** sentence chunking algorithms understand the structure of a sentence. They analyze parts of speech and how words relate to each other in a sentence.
* **Accuracy:** they are more accurate in understanding the meaning and context of sentences. This makes them suitable for complex tasks like sentiment analysis, information extraction, and language translation.&#x20;
* **Resource Intensity:** these algorithms are usually more resource-intensive due to their complexity. They might require more computational power and time to process text.

To learn more about best practices with regard to chunking, see our guide to chunking [here](/getting-started/core-ai-concepts/chunking.md).

***

### Upload Files

The most straightforward way to create a knowledge base is by uploading files from your computer.

<figure><img src="/files/eZZnXwegzVFh0LGZGXUr" alt=""><figcaption></figcaption></figure>

#### Supported File Types:

* **Word Documents**: `.doc`, `.docx`, `.json`
* **PDF Files**: `.pdf`
* **PowerPoint Presentations**: `.ppt`, `.pptx`
* **Excel Spreadsheets**: `.xls`, `.xlsx`

***

### Import from Connection

You can import files from external connections such as **Dropbox**, **Google Drive**, **Notion**, and **SharePoint** from the knowledge base dashboard. Be aware that the more files you import, the longer it will take to process them.

<figure><img src="/files/ubrIVfH1hpyUH2zefVGb" alt=""><figcaption><p>Import from Connection</p></figcaption></figure>

**Auto Sync Files**

If you are importing from a connection, you may want your files to automatically sync with your connection so that if a file is updated at the source, it is also updated in your StackAI Knowledge Base. When Auto Sync is turned on, the knowledge base will sync with the source once a week.

<figure><img src="/files/bbtsW5eM3EYeYcnoMy2Q" alt=""><figcaption><p>Auto Sync</p></figcaption></figure>

You can also re-sync the files on-demand by clicking "Sync Files." This is useful if you have added a new file and you would like it to be reflected you StackAI KB immediately.

<figure><img src="/files/qKr48E1yNIotAbyQqgeA" alt=""><figcaption><p>Sync Files</p></figcaption></figure>

***

### Role-Based Access Control (RBAC)

Control who can view, edit, or manage your knowledge bases with [RBAC](/welcome-to-stackai/security-and-governance/security-in-stackai/connection-and-knowledge-base-permissions.md). You can assign roles and permissions to individuals or groups:

1. **Admin**: Full control over the knowledge base, including editing and sharing.
2. **Viewer**: Read-only access.
3. **Groups**: Share with predefined groups for streamlined collaboration.

Learn more about Workspace and Folder Access [here](/welcome-to-stackai/security-and-governance/security-in-stackai/workspace-and-folder-access.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stackai.com/workflow-builder/core-nodes/knowledge-bases/creating-a-knowledge-base.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
