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

# Knowledge bases

> Create searchable document collections for chat, Agents, Workflows, and the Knowledge Folder API.

<Frame>
  <img src="https://mintcdn.com/langdock-34/78qhP-OosPWYzEyv/images/knowledge_base_icon.png?fit=max&auto=format&n=78qhP-OosPWYzEyv&q=85&s=f4929e25d451bd3e8ce938481061ae32" alt="Knowledge base icon" style={{borderRadius: '6px'}} width="1638" height="708" data-path="images/knowledge_base_icon.png" />
</Frame>

Knowledge bases help you find specific information across larger document collections. Instead of opening every file in chat, add your reference material once and use the Knowledge base when you need the model to search for the most relevant sections.

Use Knowledge bases for policies, handbooks, product documentation, support articles, manuals, and other reference material. Use [Folders](/en/using-langdock/library/folders) when you want to work directly with files, compare them, update them, or save generated files back.

<Info>
  Knowledge bases were previously called Knowledge Folders. The Knowledge Folder API keeps its existing endpoint names.
</Info>

## Search a Knowledge base from chat

Knowledge bases are most useful when you need an answer from a large set of reference documents. Select a Knowledge base in chat, then ask the model to find the information you need.

For example, you can ask Langdock to:

* Find the parental leave policy in an employee handbook
* Compare onboarding guidance across several internal documents
* Answer a support question from product documentation
* Find the right security policy for a customer questionnaire

<Steps>
  <Step title="Open a chat">
    Start a new chat or open an existing one.

    <Frame>
      <img src="https://mintcdn.com/langdock-34/78qhP-OosPWYzEyv/images/knowledge_bases_start.png?fit=max&auto=format&n=78qhP-OosPWYzEyv&q=85&s=de470e7aafb6b1264ea5cba619e4b116" alt="Sidebar menu with New chat selected" style={{borderRadius: '6px'}} width="1762" height="584" data-path="images/knowledge_bases_start.png" />
    </Frame>
  </Step>

  <Step title="Choose a Knowledge base">
    Type `@`, search for the Knowledge base, and select it from the list.

    <Frame>
      <img src="https://mintcdn.com/langdock-34/78qhP-OosPWYzEyv/images/knowledge_bases_selection.png?fit=max&auto=format&n=78qhP-OosPWYzEyv&q=85&s=517c8e40cb0333bb71635dbeccc25561" alt="Chat input with a Knowledge base selected" style={{borderRadius: '6px'}} width="1762" height="1006" data-path="images/knowledge_bases_selection.png" />
    </Frame>
  </Step>

  <Step title="Ask a question">
    For example, ask the model to find the parental leave policy in the employee handbook. The model searches the Knowledge base for relevant sections and answers from those sources.
  </Step>
</Steps>

When you use a Knowledge base in chat, Langdock searches for relevant sections from your documents. It does not send every document to the model.

## Create a Knowledge base and add documents

You can create Knowledge bases from the [Library](/en/using-langdock/library/introduction). Open the Library from the left sidebar, find the Folders section, click the arrow next to **Create folder**, and select **Knowledge base**.

<Frame>
  <img src="https://mintcdn.com/langdock-34/78qhP-OosPWYzEyv/images/knowledge_bases_create.png?fit=max&auto=format&n=78qhP-OosPWYzEyv&q=85&s=327b231186cc028418e6e18b01e9e125" alt="Folders section with the Create folder dropdown open and Knowledge base selected" style={{borderRadius: '6px'}} width="2310" height="654" data-path="images/knowledge_bases_create.png" />
</Frame>

After you create a Knowledge base, upload documents from your computer or use the Knowledge Folder API for automated uploads. Knowledge bases are built for text-based reference material that should be searched later.

<Tabs>
  <Tab title="Upload from computer">
    1. Open your Knowledge base
    2. Click **Upload files** or drag documents into the Knowledge base
    3. Wait until the files finish processing
  </Tab>

  <Tab title="API upload">
    Use the Knowledge Folder API when you need to upload, update, delete, retrieve, or search files programmatically. For write operations, the API key itself needs the Editor role on the Knowledge base. The Viewer role covers search and retrieval.

    See the [Knowledge Folder API reference](/en/developer/knowledge-folder-api/sharing) for authentication, rate limits, and endpoint details.
  </Tab>
</Tabs>

<Warning>
  Knowledge bases accept supported text-based formats such as PDF, DOCX, TXT, Markdown, and presentations. They do not accept tabular files, images, or audio.
</Warning>

<Note>
  Knowledge bases can contain up to **1,000 files**. Each file can contain up to **8 million characters**.
</Note>

## Share search access with the right people

You can share Knowledge bases with individuals, groups, or your entire workspace. Use Viewer access when someone should search documents, and Editor access when they should also add, remove, or manage documents.

| Permission                        | Owner | Editor | Viewer |
| --------------------------------- | ----- | ------ | ------ |
| View Knowledge base and documents | ✓     | ✓      | ✓      |
| Search documents in chat          | ✓     | ✓      | ✓      |
| Use in Agents                     | ✓     | ✓      | ✓      |
| Add documents                     | ✓     | ✓      |        |
| Remove documents                  | ✓     | ✓      |        |
| Share with others                 | ✓     | ✓      |        |
| Delete Knowledge base             | ✓     |        |        |
| Transfer ownership                | ✓     |        |        |

Workspace admins have full control over all Knowledge bases.

## Convert a Knowledge base to a folder

If you started with a Knowledge base but want to work with the files directly instead of searching them, you can convert it to a regular [folder](/en/using-langdock/library/folders). Files and sharing access move to the new folder, and the original Knowledge base is removed.

Convert a Knowledge base when you want to:

* Open files in chat, compare them, or edit them
* Save generated files back to the same location
* Add spreadsheets, images, or other file types that Knowledge bases don't accept

<Steps>
  <Step title="Open the Knowledge base">
    In the [Library](/en/using-langdock/library/introduction), open the Knowledge base you want to convert. You need Editor or Owner access.
  </Step>

  <Step title="Select Convert to folder">
    Open the more actions menu and select **Convert to folder**.
  </Step>

  <Step title="Confirm the conversion">
    Review the confirmation dialog, then confirm. The files and existing sharing access move to a new folder, and the Knowledge base is removed.
  </Step>
</Steps>

<Note>
  Folders have lower limits than Knowledge bases: up to **100 files** and **250 MB** total. If your Knowledge base has more files, remove some before converting.
</Note>

<Warning>
  You can't convert a Knowledge base that's still connected through API access, Assistants, chats, or Automations. Remove those connections first, then try again.
</Warning>

## Choosing the right setup

Knowledge bases work best when you need to search across many documents. Use the options below when you want to work directly with files or give an Agent access to the same reference material.

### Use a Folder to work with files

Use a [Folder](/en/using-langdock/library/folders) when you want to open files in chat, compare them, update them, or save generated files back. Folders are better for active work with a smaller set of files.

Use a Knowledge base when you want to search a larger collection for the right answer.

### Add a Knowledge base to an Agent for search

Add a Knowledge base to an [Agent](/en/using-langdock/agents/configuration) when the Agent should search the same reference material while answering. This is useful for HR policies, product documentation, compliance documents, and support knowledge.

## FAQ

<AccordionGroup>
  <Accordion title="My Knowledge base is not appearing in @mentions">
    Check that you have at least Viewer access, then type more of the Knowledge base name to narrow the results.
  </Accordion>

  <Accordion title="The model is not finding relevant information">
    Check that your documents finished processing, then rephrase your question with more specific terms. Verify that the information exists in the uploaded documents.
  </Accordion>

  <Accordion title="I cannot upload certain file types">
    Knowledge bases accept supported text-based formats such as PDF, DOCX, TXT, Markdown, and presentations. Use a [Folder](/en/using-langdock/library/folders) when you need to work with spreadsheets, images, audio, or generated files.
  </Accordion>

  <Accordion title="What should go into a Knowledge base instead of a direct attachment?">
    Use a Knowledge base for information that should be reused across chats, agents, workflows, or API usage. It is best for larger or longer-lived document collections where Langdock should search relevant sections instead of sending every file in full each time.
  </Accordion>

  <Accordion title="How fresh is Knowledge base content?">
    Uploaded Knowledge base content is available after processing. Synced content depends on the sync source and refresh process, so newly added or changed files may not be searchable immediately. If recent content is missing, check processing or sync status before assuming the model ignored the file.
  </Accordion>

  <Accordion title="Why are some files not searchable in a Knowledge base?">
    Files may not be searchable if the format is unsupported, the file failed processing, the content cannot be extracted reliably, or the source permissions prevent access. Spreadsheets and tabular data are not supported by Knowledge bases and should be used directly in chat instead.
  </Accordion>
</AccordionGroup>
