---
title: "Add Datasource"
description: "Queue a knowledge-base file for ingestion."
canonical_url: "https://docs.vettero.com/build/workflows/blocks/kb/add-datasource"
---
# Add Datasource

> Queue a knowledge-base file for ingestion.

<block-meta block="Yes" channels="Any" folder="kb" group="Knowledge Base" groupTo="/build/workflows/blocks/kb" icon="i-lucide-file-plus" pipe="Value" scope="Any" tool="Yes" type="kb.add-datasource">



</block-meta>

**Add Datasource** (canvas label **KB Add Datasource**) queues a file already in the workspace for ingestion into a [knowledge base](https://docs.vettero.com/data/knowledge-bases).

<warning>

Ingestion runs in the background. This block continues as soon as the datasource is queued — the file is not searchable yet. Check **status** with [Get Datasource](https://docs.vettero.com/build/workflows/blocks/kb/get-datasource) (or [List Datasources](https://docs.vettero.com/build/workflows/blocks/kb/list-datasources)) before you [Query](https://docs.vettero.com/build/workflows/blocks/kb/query).

</warning>

**Structured** is for row-like files (CSV, JSONL, Excel, text). **Unstructured** is for documents. Strict knowledge bases only accept structured content. Uploads are limited to **25MB** on the knowledge base page; the file you pass here must already exist (for example from an [Upload](https://docs.vettero.com/build/workflows/blocks/in/file) step).

## Configure

<table>
<thead>
  <tr>
    <th>
      Setting
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Knowledge base
      </strong>
    </td>
    
    <td>
      Store to ingest into (required)
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Datasource type
      </strong>
    </td>
    
    <td>
      <strong>
        Structured
      </strong>
      
       or <strong>
        Unstructured
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        File ID
      </strong>
    </td>
    
    <td>
      Workspace file id to ingest (required)
    </td>
  </tr>
</tbody>
</table>

## Handles

<table>
<thead>
  <tr>
    <th>
      Handle
    </th>
    
    <th>
      Role
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        In
      </strong>
      
       (target)
    </td>
    
    <td>
      Incoming connection
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Out
      </strong>
      
       (source)
    </td>
    
    <td>
      Continues after the datasource is queued
    </td>
  </tr>
</tbody>
</table>

## Pipe schema

The next block reads this on the data pipe (`pipe.value`). The value is a datasource object:

<table>
<thead>
  <tr>
    <th>
      Key
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Datasource id
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        type
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <code>
        structured
      </code>
      
       or <code>
        unstructured
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        content
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Stored content reference
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        addedAt
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      When it was added
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Processing status
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        processedAt
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      When processing finished, if done
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        error
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Error message when processing failed
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        progress
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Progress text while processing
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        file
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      File id when set
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        url
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Source URL when set
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        config
      </code>
    </td>
    
    <td>
      object
    </td>
    
    <td>
      Extra ingestion settings
    </td>
  </tr>
</tbody>
</table>

## Use case

- After a chat file upload, ingest the document so later [Query](https://docs.vettero.com/build/workflows/blocks/kb/query) steps can search it.
- Poll [Get Datasource](https://docs.vettero.com/build/workflows/blocks/kb/get-datasource) until `status` shows the file is ready.

<block-page-nav>



</block-page-nav>


## Sitemap

See the full [sitemap](https://docs.vettero.com/sitemap.md) for all pages.
