---
title: Setup Guide
slug: v-R4-setup-guide
docTags: 
createdAt: 2026-03-23T19:52:43.281Z
---

Follow the steps below to configure and store data using a **Custom Script** for **MongoDB** in the Generative AI Documents section.

### Step 1 — Navigate to Generative AI Documents

Go to the **Train → Generative AI → Documents** section.

Click **Upload Document** to add a new data source for storage.

![](https://api.archbee.com/api/optimize/FEqjvWZnyymr_PEhXLLlG/rAoN2uSYEEgbNIVaPzkbD_image.png)

### Step 2 — Select Custom as Content Source

In the **Configure Documents to your Knowledge Base** screen, choose **Custom** as the content source.

This option allows you to **upload a Python script that fetches external data and converts it into structured JSON for Mongo storage**.

Provide the required information for the script configuration.

**Script Title:** Enter a descriptive name for the custom script.

**Example**: Doctor Details Mongo

**Category:** Select a category to organize the indexed document.

**Language:** Choose the language used in the indexed content.

![](https://api.archbee.com/api/optimize/FEqjvWZnyymr_PEhXLLlG/OXLXLjndvyVImH3DQ4di9_image.png)

### Step 3 — Add the Custom Script

In the **Custom Indexing** section, paste the Python script that retrieves and formats the external data.

The script should:

- Fetch data from the external source (API, Google Sheets, Sitemap, etc.)
- Convert the data into structured JSON
- Return the JSON output using sys.stdout.write

For Mongo storage, the response should use the **data\_to\_save** field.

This JSON output will be used by the platform to **store the content in MongoDB**.

![](https://api.archbee.com/api/optimize/FEqjvWZnyymr_PEhXLLlG/BRt4PyNFBe2HZKWcZbaZY_image.png)

### Step 4 — Configure Auto Refresh (Optional)

You can enable **AutoRefresh** to automatically update the stored data.

Enable the **AutoRefresh toggle** and set the **Refresh Interval (in days)**.

Example:

Refresh Interval: **7 days**

This ensures the script runs periodically and updates the stored data with the latest information.

After entering the details, click **Continue**.



![](https://api.archbee.com/api/optimize/FEqjvWZnyymr_PEhXLLlG/1xJHExgNIgDBcaL5DxqyJ_image.png)

### Step 5 — Review and Confirm Setup

Review the configuration before starting the storage process.

Verify the following:

- Script Title
- Category
- Language
- Content Source
- Indexing Configuration
- AutoRefresh settings

![](https://api.archbee.com/api/optimize/FEqjvWZnyymr_PEhXLLlG/wSCqdU5BWDgkzmA2B2Il9_image.png)

Once confirmed, click **Save & Start Indexing**.

### Step 6 — Verify Document Status

After processing completes, the document will appear in the **Generative AI Documents list**.

The status will show:



![](https://api.archbee.com/api/optimize/FEqjvWZnyymr_PEhXLLlG/b2Dr8cjqo6Y6W6DQMIbeH_image.png)

## 📚 Next Steps

Once the Mongo DB indexing status shows Ready to Search, configure the agent workflow so the AI can retrieve knowledge from the indexed website content.
➡️ Continue with [Mongo DB Path Setup](docId\:mGhUb2ljG7TRzpINTCZ2D)
