January 28, 2025
How to Add Content to a Knowledge Base Using Dumpling AI’s API
Keeping your knowledge base up-to-date is vital for ensuring accurate and efficient access to information. Dumpling AI’s Add to Knowledge Base API simplifies this process by automating content uploads and indexing. By integrating this API with Make.com, you can create a seamless workflow for updating your knowledge base.
In this guide, we’ll explore the API, describe how Make.com modules can be configured, and outline their inputs, uses, and potential applications.
What Does the API Do?
The Add to Knowledge Base API allows you to upload content into a specific knowledge base, where it’s split into smaller chunks, embedded, and made searchable for similarity-based queries.
Automating the Process with Make.com
Make.com offers a visual interface to automate workflows. Here’s how you can set up a scenario for updating your knowledge base.
Step 1: Set Up the Trigger Module
Module: Google Drive: Watch Files
- Inputs:
- Folder ID: Specify the folder to monitor for new files.
- File Type: Choose the file type (e.g., PDF, DOCX).
- Use: Detects new files in the specified folder.
Step 2: Retrieving the File from Google Drive
This ensures the PDF file is retrieved in a format that can be processed by Dumpling AI.
- Add Google Drive Module for File Retrieval
- Add Google Drive: Get a File.
- Connection: Use the existing Google Drive connection.
File ID: Map the file ID from the previous Google Drive trigger ({{1.id}}).
Step 3: Extract Text from the File
Module: Dumpling AI: PDF to Text
- Add Dumpling AI Module
- Add Dumpling AI: PDF to Text.
- Connection: Choose your Dumpling AI account.
- Input Method: Set to Base64.
- File: Map the base64-encoded file data from the previous Google Drive step ({{base64(3.data)}}).
- Configure Extraction Settings
Pages: Leave blank to extract text from all pages or specify page numbers if needed.
Step 4: Adding Extracted Text to Dumpling AI’s Knowledge Base Using HTTP Request
This step uses the HTTP request module to send the extracted text to Dumpling AI’s knowledge base via the API.
Add HTTP Request Module
- Add HTTP: Make a Request.
- Configure the module:
- Method: POST.
- URL: https://api.dumplingai.com/api/v1/knowledge-bases/add.
Headers:
{
“Content-Type”: “application/json”,
“Authorization”: “Bearer YOUR_API_KEY”
}
- Body Type: Raw.
Request Body:
{
“knowledgeBaseId”: “YOUR_KNOWLEDGE_BASE_ID”,
“name”: “{{2.name}}”,
“content”: “{{3.text}}”
}
Step 4: Notify the Team
Module: Slack: Send a Message
- Inputs:
- Channel ID: Specify the Slack channel for notifications.
- Message: Craft a message to inform the team about the update.
Use: Keeps stakeholders informed about new knowledge base updates.
Best Practices for Using Make.com with Dumpling AI
- Optimize Content:
Ensure the uploaded content is concise and relevant to minimize credit usage (1 credit per 10,000 characters). - Monitor Usage:
Use Make.com’s error-handling features to retry failed requests or alert you about issues.
Review API Documentation:
Refer to the Dumpling AI API Documentation for details on rate limits and advanced configurations.
Conclusion
This workflow is a game-changer for businesses handling large volumes of documents. Automating the process ensures your knowledge base stays up-to-date with minimal effort. Whether it’s contracts, research papers, or reports, all your critical information is just a search away. If you’d like to learn how to add resources to your Dumpling AI knowledge base using the dedicated Dumpling AI module in Make.com, be sure to check out this detailed guide: Here