# RAG Document Change Tracker: Markdown Deltas (`ailu_studio/rag-document-change-tracker`) Actor

Keep RAG knowledge bases current. Compare public HTML or Markdown documents and export changed blocks with stable IDs, hashes and previous content.

- **URL**: https://apify.com/ailu_studio/rag-document-change-tracker.md
- **Developed by:** [Ailu Studio](https://apify.com/ailu_studio) (community)
- **Categories:** AI, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 output rows

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### RAG Document Change Tracker: Markdown Deltas

Keep RAG knowledge bases current. Compare public HTML or Markdown documents and export changed blocks with stable IDs, hashes and previous content.

RAG and documentation-search teams can upsert changed blocks and remove confirmed obsolete IDs instead of re-embedding every page.

### Quick start

1. Open Input and keep the default example, or supply your own supported source URLs.
2. Start with a small `maxItems` value. Run once with `outputMode: "all"`.
3. Inspect the dataset and OUTPUT summary, including coverage and errors.
4. Repeat with `outputMode: "changes"` using the same history store. Zero rows means no observed changes, not a broken run.
5. Create an Apify Task and Schedule for recurring checks. Use the dataset API or Apify integrations for downstream workflows.

```json
{
  "urls": [
    "https://docs.apify.com/actors/development/permissions"
  ],
  "maxItems": 30,
  "outputMode": "all"
}
```

### Input

| Field | Meaning |
| --- | --- |
| `urls` | 1–20 public HTML or Markdown URLs. HTTP content only; no login, JavaScript browser or recursive crawl. |
| `outputMode` | all returns the current observed snapshot; changes returns only new, updated and confirmed removed items. First run establishes a baseline. |
| `maxItems` | Hard output cap, including removed rows. Changes beyond the cap remain pending for a later run. |
| `stateStoreName` | Optional existing history store name or ID. Otherwise this Actor creates its own persistent store. Use a separate store per independent watchlist and avoid overlapping runs. |

### Output and change handling

Each row has a stable `id`, a `changeType` (`new`, `updated`, `unchanged`, or where supported `removed`) and `fetchedAt`. Updated rows include the previously stored row in `previous`. The OUTPUT record reports row counts, source coverage and errors. Missing fields remain null when unknown.

Use `id` as your destination upsert key. Treat `removed` as a delete instruction only for a source that supports confirmed deletion. In changes mode, unchanged rows are omitted. The first run reports observed items as new. Row caps leave unreported changes pending; use the same settings on the next run to drain them.

### Coverage and limitations

Reads only the supplied URLs and respects robots.txt. It does not render JavaScript, follow links, download PDFs or create embeddings. Markdown keeps code and tables. IDs use URL, heading path, block type and position within the section: inserting a block or renaming a heading may cause additional updates. At most 300 blocks per page are observed. Truncated pages and fetch errors never imply deletions. HTTP 404/410 on an explicitly watched URL can remove its previously seen blocks. Do not silently remove a URL from a watchlist to request deletion; consume removed rows or manage that source in your vector database.

Only public resources are supported. No login, cookies, form submission or access-control bypass is performed. URL readers reject private/reserved hosts and enforce response/request caps. Different watchlists should use separate history stores. Sequential runs are required for a shared store.

### Costs

$2.00 per 1,000 output rows, plus Apify platform usage. New, updated, unchanged (all mode) and removed rows are charged when emitted; omitted unchanged rows in changes mode are not charged. Check the Pricing tab for the active rate.

### API and automation

Use the API tab for generated JavaScript, Python or HTTP examples. Keep your token in an environment variable, never in a shared URL. After a run succeeds, read its default dataset; check OUTPUT before treating a partial result as complete. Download CSV/JSON from the dataset or send it to your own n8n/Make workflow using the returned IDs.

### FAQ

**Why did a repeat run return zero rows?** The same source may not have changed. Use all mode for a current snapshot; do not create a new history store on every run.

**Does this guarantee complete source coverage?** No. Check the source-specific limits and OUTPUT coverage. Fetch failures never replace the previous successful baseline.

**Can I reuse an existing state store?** Yes. Supply its ID/name through the history input so the platform can grant scoped READ/WRITE access. Use only stores intended for this Actor.

**Can I contact support?** Open an issue with the run ID and a sanitized input. Never post API tokens or customer data.

### Source and responsible use

Not affiliated with the source platform. Use data you are authorized to collect and process. Respect source terms and applicable rights. Source documentation: https://docs.apify.com/actors

### Output example

Selected fields from a successful live run; future values and result counts can differ.

```json
{
  "id": "https://docs.apify.com/actors/development/permissions#bce250005d8016e71ad1",
  "url": "https://docs.apify.com/actors/development/permissions",
  "section": "",
  "markdown": "> ## Documentation index\n> \n> Fetch the complete documentation index at: https://docs.apify.com/llms.txt Use this file to discover all available pages before exploring further.",
  "changeType": "new"
}
```

# Actor input Schema

## `urls` (type: `array`):

1–20 public HTML or Markdown URLs. HTTP content only; no login, JavaScript browser or recursive crawl.

## `outputMode` (type: `string`):

all returns the current observed snapshot; changes returns only new, updated and confirmed removed items. First run establishes a baseline.

## `maxItems` (type: `integer`):

Hard output cap, including removed rows. Changes beyond the cap remain pending for a later run.

## `stateStoreName` (type: `string`):

Optional existing history store name or ID. Otherwise this Actor creates its own persistent store. Use a separate store per independent watchlist and avoid overlapping runs.

## Actor input object example

```json
{
  "urls": [
    "https://docs.apify.com/actors/development/permissions"
  ],
  "outputMode": "all",
  "maxItems": 30
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("ailu_studio/rag-document-change-tracker").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("ailu_studio/rag-document-change-tracker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call ailu_studio/rag-document-change-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ailu_studio/rag-document-change-tracker"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/0iVYs33g9awfzuKlj/builds/SVqZLTgh4Ch27fFff/openapi.json
