On a schedule
Keep your index in sync with your website
Every week new and edited pages are re-added, removed pages are deleted, and you get an email with the counts.
- Runs
- On a schedule
- Apps
- Pinecone
- AI
- Not needed
- Access
- API key
Send this to your assistant
Create a ClickRuntime automation: every Sunday at 2am, read the sitemap at example.com/sitemap.xml, add new or changed pages to my Pinecone index docs-search, delete pages that are gone, and email me how many were added, updated and removed.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A company that puts its website, help center or documentation into a Pinecone index for search or an assistant has a freshness problem. Pages are edited, new articles are published, and old ones are removed, yet the index still reflects the day it was first built. Answers then cite a retired pricing page or miss the latest guide, and nobody knows the index is stale until a customer complains.
Each week, the sitemap or content API is fetched and every page is hashed. The hashes are compared with those stored from the last run, and only pages that changed are split into chunks and upserted as text records using Pinecone's integrated embedding. Records for pages that no longer exist are deleted, and a summary email says what was added, updated and removed.
It suits teams running a support assistant, internal search or retrieval over public content.
What you get out of it
Answers reflect the current site
Weekly refreshes mean the index catches up with edits, new pages and removals. A support assistant stops quoting last quarter's pricing or a feature that was renamed. Customers get correct answers instead of confidently stated outdated ones.
Only changed pages are processed
Hashing each page lets the sync skip everything that did not change. That keeps runs quick and avoids re-embedding thousands of unchanged pages week after week. Lower processing also keeps embedding costs predictable as your site grows.
Deleted pages stop appearing
Removing records for pages that are gone prevents the index from returning dead links. Customers are not sent to a retired page because of an old record that was never cleaned up.
Integrated embedding keeps setup simple
Pinecone's integrated embedding turns text into vectors inside the index, so no separate embedding service is needed. That means fewer moving parts to maintain and fewer keys to manage. Teams without machine learning experience can still maintain it.
A summary you can read in a minute
The email lists what changed in the week. If a run adds nothing for a month, or removes a surprising number of pages, you notice a problem with the source rather than silently serving stale data.
How it works
What happens, step by step
On your chosen schedule, ClickRuntime reads your website's sitemap and fetches the text of every page.
It compares each page with the version it saved last time and skips pages that haven't changed.
New and edited pages are split into chunks and added to your Pinecone index.
Pages that are no longer in the sitemap are removed from the index.
You get an email with the number of pages added, updated and removed.
Before it runs live
- Connect Pinecone
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Pinecone steps into one automation
Under the hood
The code that runs this automation
import hashlib, json, re
from clickruntime import on_trigger, credentials, notify, http, state
HOST = "https://docs-search-abc123.svc.us-east-1-aws.pinecone.io" # index docs-search
SITEMAP = "https://example.com/sitemap.xml"
@on_trigger
def run(event):
headers = {"Api-Key": credentials.secret("PINECONE_API_KEY"), "X-Pinecone-API-Version": "2025-04"}
hashes = state.get("hashes") or {}
urls = re.findall(r"<loc>(.*?)</loc>", http.get(SITEMAP).text)
added = updated = 0
for url in urls:
text = re.sub(r"\s+", " ", re.sub(r"<[^>]+>", " ", http.get(url).text)).strip()
digest = hashlib.sha256(text.encode()).hexdigest()
if hashes.get(url) == digest:
continue
added, updated = (added + 1, updated) if url not in hashes else (added, updated + 1)
chunks = [text[i:i + 2000] for i in range(0, len(text), 2000)][:50]
body = "\n".join(json.dumps({"_id": f"{url}#{n}", "chunk_text": c, "url": url}) for n, c in enumerate(chunks))
http.post(f"{HOST}/records/namespaces/docs/upsert", data=body,
headers={**headers, "Content-Type": "application/x-ndjson"}).raise_for_status()
hashes[url] = digest
removed = [u for u in hashes if u not in urls]
if removed:
http.post(f"{HOST}/vectors/delete", headers=headers,
json={"namespace": "docs", "filter": {"url": {"$in": removed}}}).raise_for_status()
for u in removed:
hashes.pop(u)
state.set("hashes", hashes)
notify.email_me("Pinecone docs-search sync", f"Added {added}, updated {updated}, removed {len(removed)} pages.")
return {"added": added, "updated": updated, "removed": len(removed)}FAQ
Common questions
How are long pages handled?
What if my site has no sitemap?
Does it need a Pinecone index with integrated embedding?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Get warned if your index loses records
If your vector count falls below a floor or drops sharply since yesterday, you hear about it in Slack within the hour.
See how it worksBack up your index every week
Every week a fresh backup of your index is created and you get an email with its ID.
See how it worksKnow the moment your website goes down
Your team hears in Slack when the site stops responding or slows down, and again when it's back.
See how it worksKeep exploring
Set up “Keep your index in sync with your website” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.