Integrating Your KB via API
Why Use API-Based KB Integration?
Instead of manually uploading static documents, API-based integration allows AI Agents to retrieve real-time, structured information directly from your internal systems or databases.
This method is particularly beneficial for managing frequently updated or large-scale knowledge bases. API integration is ideal for:
Large and Complex Datasets β Efficiently handling extensive, structured information, such as product catalogs, customer data, or transactional records.
Real-Time Information β Providing AI Agents with up-to-date data, such as inventory levels, pricing, customer support records, and more.
Even if your content does not change frequently, API integration may still be the best choice when handling large, structured, or complex datasets. Hereβs why:
Product catalogs should always be integrated via API (e.g., Google Sheets, Shopify) rather than as static documents to ensure better searchability and retrieval efficiency.
Complex, high-volume content is easier to manage via integration rather than static uploaded documents.
π Note: This article assumes a minimum level of technical knowledge, as API integration requires setup and maintenance, making it less immediate than document uploads.
Two Main API Use Cases
Connecting to Internal Tools or Systems (e.g., CRM, ticketing, ERP) for real-time information access.
Connecting a Google Sheet to dynamically retrieve structured data.
1. API Integration with Your Internal Tools
Instead of manually uploading large knowledge bases, API integration enables AI Agents to fetch real-time data from systems like e-commerce platforms (e.g. Shopify, Magento), CRMs (e.g. Salesforce, Zendesk, HubSpot), ERPs, or internal databases.
This dynamic approach is perfect for continuously updated, large-scale datasets.
Example 1: Integration with an E-Commerce Platform (e.g., Shopify) Imagine integrating an e-commerce platform, such as Shopify, with your AI Agent to dynamically retrieve product catalogs, pricing, and availability. Rather than uploading static documents for each product, the AI Agent can query Shopify in real time to access the most up-to-date information on stock levels, prices, and product details whenever a customer asks about a product.
Example 2: Integration with CRM (e.g., Salesforce) An AI Agent can also be connected to your CRM system (e.g., Salesforce) to retrieve customer information, support data, and ticket history. This allows the AI Agent to provide real-time, personalized responses based on live data rather than relying on outdated, static documents. For instance, instead of storing all past support tickets in your KB, the AI Agent can query Salesforce to fetch open ticket history for a specific user during their inquiry.

Step-by-Step Integration Process
Pass the Data to the AI Agent or use it in a Workflow
Configure the AI Agent to reference the stored variable and incorporate the API data into its responses by specifying the variable in a dedicated custom section of the AI Agent block. This ensures that the AI Agent uses real-time data instead of relying on static KB documents.
If additional checks or data manipulations are required before the agent provides a final response, the variables containing the API-fetched data can be used in any other workflows.
β
Best Practices for KB Integration via API
Limit API requests to specific, relevant queries to avoid unnecessary data fetching.
Filter information within the API call to retrieve only the necessary data, improving efficiency.
Use variables to store and dynamically handle API responses, ensuring smooth integration into AI workflows.
Ensure API security by using authentication tokens and encrypting sensitive data to protect privacy and maintain data integrity.
2. API Integration with Google Sheets
Sometimes, directly calling external system APIs isnβt feasible. This can occur in two situations:
The data is stored in a custom management system that doesnβt expose APIs.
The exposed APIs are too slow, negatively impacting the chat user experience.
In these cases, we offer a simple and effective solution: Google Sheets. We treat the spreadsheet like a database: by adding the data you want to retrieve into the sheet, you can access it in real time through the agent.
How does it work in the workspace?
We provide an internal API that allows you to run SQL queries on a Google Sheet, managing access via Google authorization. You can choose between using a publicly accessible spreadsheet or a private one, accessing it with a Google service account.
Google Sheets offers a flexible way to structure and retrieve KB data. This method works particularly well for e-commerce catalogs, support knowledge bases, or structured company FAQs.
Example: Product Information for an E-Commerce Store Imagine an AI agent providing product details for an online store with 1,000 products that have a slow update rate. Instead of having to expose a dedicated API, just upload the data to the sheet and the API connection will allow real-time retrieval of product information.

Hereβs a detailed overview of this service.
Step-by-Step Integration Process
Create Your Google Sheet
Organize content into separate tabs, each corresponding to a different AI Agent or topic.
Structure the columns to allow easy filtering through SQL queries, ensuring that column names are clear and consistent for efficient data retrieval (e.g., "Product Name," "Price," "Stock Level").
Configure API Calls in Your Workflow
Use indigo.aiβs internal document processing service for structured data retrieval and ensure that information is extracted in a well-organized manner.
Insert the API block into your AI workflows to enable data retrieval from Google Sheets.
Customize the SQL query based on the workflow's requirements to fetch only relevant information for specific tasks (e.g., fetching product details when a customer asks about a particular item).
β
Best Practices for Google Sheets API Integration
Use structured tabs for different data sets (e.g., Product Info, Pricing, Stock) to keep data organized and easy to query.
Minimize unnecessary API calls to avoid excessive processing load, ensuring faster retrieval times and optimized performance.
Last updated
Was this helpful?