Skip to content

Hourly

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.

Runs
Hourly
Apps
Pinecone
AI
Not needed
Access
API key

Send this to your assistant

Create a ClickRuntime automation: every hour, check the record count in my Pinecone index docs-search and post to #ops in Slack if it drops below 100,000 or falls more than 10% from yesterday.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A retrieval system built on Pinecone assumes the index holds what you put in it. Then a bad deployment deletes a namespace, a cleanup script uses the wrong filter, or an ingestion job overwrites records with an empty batch. Search quality drops, users see worse answers, and the team spends days wondering why before anyone looks at the vector count.

Every hour, the index's stats are described to get the current total number of vectors. The number is compared with a threshold and with the figure stored from the previous check, and if it falls sharply, a Slack message is posted. A steady or growing count produces no noise. Hourly checks suit teams without a dedicated on-call rotation for data systems.

It is aimed at engineers who run production search or an assistant and want a tripwire for accidental deletions.

What you get out of it

  • Catch accidental deletions within an hour

    A sudden drop in vectors is a clear sign something has gone wrong. Hourly checks cap the time a broken cleanup job can run before someone is told. The earlier you know, the smaller the repair job becomes.

  • Protect answer quality

    Missing records mean missing answers. Discovering and restoring them quickly keeps users from seeing a degraded assistant that quietly stops finding relevant material. Missing records mean missing answers. Quick discovery keeps users from seeing a degraded assistant that silently stops finding relevant material, which damages trust far more slowly than it can be rebuilt.

  • Works regardless of the cause

    Whether the loss came from a bug, a mistaken delete call or a failed upsert, the count shows it. You do not need to predict every failure mode in advance.

  • Time to restore from a backup

    An early alert means a recent backup can be restored with little loss. Waiting a week to notice makes the gap much harder to fill and to explain. The sooner you know, the less you lose between that backup and the failure.

  • A guard for team handoffs

    When new engineers run scripts against the index, a safety net helps. A message in Slack tells the whole team something changed, so no one is blamed for a silent failure.

How it works

What happens, step by step

  1. Every hour, ClickRuntime checks how many records are in your Pinecone index.

  2. It compares the count with your minimum, such as 100,000, and with yesterday's count.

  3. If the count is below the minimum or has dropped by more than 10% since yesterday, it posts to #ops in Slack with today's and yesterday's numbers.

Before it runs live

  • Connect Pinecone

What you get

RunsHourly
Get warned if your index loses recordstoday, 9:00Succeeded
Slack · #opsPinecone docs-search has 84,120 records (yesterday 131,402).

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
vector_count_drop_alert.pyexample
from datetime import date
from clickruntime import on_trigger, credentials, notify, http, state

HOST = "https://docs-search-abc123.svc.us-east-1-aws.pinecone.io"  # index docs-search
MIN_RECORDS = 100_000

@on_trigger
def run(event):
    stats = http.post(f"{HOST}/describe_index_stats", json={},
                      headers={"Api-Key": credentials.secret("PINECONE_API_KEY")}).json()
    count = stats["totalVectorCount"]
    daily = state.get("daily") or {}
    yesterday = daily.get("count") if daily.get("date") != date.today().isoformat() else daily.get("prev")
    if daily.get("date") != date.today().isoformat():
        state.set("daily", {"date": date.today().isoformat(), "count": count, "prev": daily.get("count")})
    if count < MIN_RECORDS or (yesterday and count < yesterday * 0.9):
        notify.slack(f"Pinecone docs-search has {count:,} records (yesterday {yesterday or 'unknown'}).", channel="#ops")
    return {"count": count}

FAQ

Common questions

How is a sharp drop defined?
You set it, either as a minimum count or as a percentage drop from the last check. A common choice is ten percent in an hour. Ask your AI assistant to set the rule that fits how often your index is updated.
Will it work with namespaces?
The index stats include counts per namespace, so you can watch the total or a particular namespace. If a single namespace holds your main data, monitoring it directly is usually more sensitive. Both views are available.
Does a planned bulk delete trigger the alert?
It will, because it cannot tell planned from accidental. When you plan a large cleanup you can pause the check for that window or simply treat the message as confirmation that the cleanup worked. That makes the alert useful either way.
What permissions does it need?
API key. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (hourly). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Get warned if your index loses records” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.