https://retellai.com/?utm_source=discord&utm_medium=seo logo
i got an error when adding a knowledgebaseSays err...
# ❓・ai-evy-support
k
@AI Evy i got an error when adding a knowledgebase Says error creating knowledgebase sourcefile
a
Thanks for tagging me @K Rudy. I'll look through relevant sources and get back to you shortly.
### Answer When adding sources to a knowledge base, there are a few important things to check: File Limits: - Maximum 25 files per knowledge base [(1) ]() - Each file limited to 50MB - For CSV, TSV, XLS, and XLSX files: max 1000 rows and 50 columns Use the SDK: For adding knowledge base sources, you should use the official Retell SDK rather than direct HTTP requests. [(2) ]() , [(3) ]() Here's the correct approach using the JavaScript SDK: [(4) ]()
Copy code
javascript
import Retell from 'retell-sdk';
import fs from 'fs';

const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;

async function main() {
  const knowledgeBaseResponse = await client.knowledgeBase.addSources(
    "knowledge_base_xxxxxxxxxxxx",
    {
      knowledge_base_files: [
        fs.createReadStream("./sample.txt") ,
      ],
    }
  ) ;
  console.log(knowledgeBaseResponse.knowledge_base_id) ;
}

main() ;
Supported file formats include: .bmp, .csv, .doc, .docx, .eml, .epub, .heic, .html, .jpeg, .png, .md, .msg, .odt, .org, .p7s, .pdf, .ppt, .pptx, .rst, .rtf, .tiff, .txt, .tsv, .xls, .xlsx, .xml [(1) ]() Could you share: 1. What file type you're trying to upload? 2. The file size? 3. Are you using the SDK or direct API calls?
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) [[2] internal server error on create knowledge base by API](https://discord.com/channels/1186424376300679209/1391417148215136376) [[3] Internal Server Error when adding KB Source using API](https://discord.com/channels/1186424376300679209/1457130128206200873) [[4] Add Knowledge Base Sources](https://docs.retellai.com/api-references/add-knowledge-base-sources) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.