Skip to content

The moment it happens

A Telegram assistant that remembers what you tell it

Tell your bot facts worth keeping and it recalls them later when you ask, even months afterwards.

Runs
The moment it happens
Apps
Pinecone, Telegram
AI
Yes, uses the built-in AI allowance
Access
Telegram bot token; Pinecone read+write

Send this to your assistant

Create a ClickRuntime automation: when I send my Telegram bot a message starting with "remember:", save it in Pinecone. When I ask something, look up my saved memories and answer from them.

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 consultant juggling a dozen clients keeps small facts in their head: which client prefers calls on Fridays, the name of a CFO's new assistant, the gate code at a customer's warehouse, the size of the shirt they promised to send. Notes apps fill up with fragments nobody can find again, and the one detail that matters is always buried.

A Telegram bot with long-term memory solves that with two habits. Type "remember:" and a fact, and it is stored in Pinecone. Later, ask a normal question and the bot searches what you saved by meaning, not exact words, and answers from it.

What you get out of it

  • Capture a fact in the moment

    Facts come up mid-call or in a corridor. Sending a one-line Telegram message takes seconds, so details get saved when you hear them instead of being half-remembered later.

  • Find things without the right keyword

    The bot searches by meaning, so asking "what's the code for the Acme warehouse?" finds a note that said "Acme loading bay gate is 4471". You do not need to remember how you phrased it.

  • Memory that does not expire

    Unlike a chat that loses context after a while, saved facts stay in your index until you delete them. A detail from last spring is as easy to recall as one from this morning.

  • Better client relationships

    Remembering a preference or a personal detail is what makes a client feel looked after. The bot makes that reliable even when you work with many people.

  • Private by design

    The bot only answers your own Telegram account, and memories go into your own Pinecone index. Nothing is shared with a team unless you choose to.

How it works

What happens, step by step

  1. When you send a message to your Telegram bot, ClickRuntime first checks that it came from your own account.

  2. If the message starts with "remember:", the fact is saved in your Pinecone index with today's date, and the bot replies to confirm.

  3. Otherwise it searches your saved memories for the ones closest in meaning to your question.

  4. AI answers using only those memories, preferring the newest when two disagree, and the reply comes back in the same chat.

Before it runs live

  • Connect Pinecone
  • Connect Telegram
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
A Telegram assistant that remembers what you tell itjust nowSucceeded
Telegram · Memory botThe Acme loading bay gate code is 4471 (saved 12 March).

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

  • Act only on the items that match your own rules, and skip the rest
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Slack
  • Combine it with other Pinecone and Telegram 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.
personal_telegram_assistant_with_long_term_memory_in_pinecone.pyexample
from datetime import date
from clickruntime import on_event, credentials, http, ai

OWNER_CHAT_ID = 123456789

def embed(text):
    r = http.post("https://api.pinecone.io/embed", headers={"Api-Key": credentials.secret("PINECONE_API_KEY"), "X-Pinecone-API-Version": "2025-01"},
                  json={"model": "multilingual-e5-large", "inputs": [{"text": text}]})
    return r.json()["data"][0]["values"]

@on_event
def handle(event):
    msg = (event.json or {}).get("message") or {}
    if msg.get("chat", {}).get("id") != OWNER_CHAT_ID:
        return {"ignored": True}
    text, index = msg.get("text", ""), credentials.secret("PINECONE_HOST")
    pc = {"Api-Key": credentials.secret("PINECONE_API_KEY")}
    if text.lower().startswith("remember:"):
        fact = text[9:].strip()
        http.post(f"https://{index}/vectors/upsert", headers=pc, json={"vectors": [
            {"id": str(msg["message_id"]), "values": embed(fact), "metadata": {"text": fact, "date": date.today().isoformat()}}]})
        reply = "Saved."
    else:
        matches = http.post(f"https://{index}/query", headers=pc, json={"vector": embed(text), "topK": 8, "includeMetadata": True}).json()["matches"]
        memories = "\n".join(f"{m['metadata']['date']}: {m['metadata']['text']}" for m in matches)
        reply = ai.generate(f"Memories:\n{memories}\n\nQuestion: {text}", system="Answer from the memories only. Prefer the newest if they disagree. Say if nothing matches.", max_output_tokens=300).text
    http.post(f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/sendMessage", json={"chat_id": OWNER_CHAT_ID, "text": reply})
    return {"saved": text.lower().startswith("remember:")}

FAQ

Common questions

How does it know whether to save or answer?
Messages that start with "remember:" are saved. Everything else is treated as a question and answered from your saved memories.
Can I correct a memory?
Yes. Save the corrected fact with "remember:" again. When two memories disagree, the bot is told to prefer the most recent one and mention the date.
What if it has nothing saved on a topic?
It tells you it has no memory about that, rather than guessing. You can then save the fact for next time.
What permissions does it need?
Telegram bot token; Pinecone read+write. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run for each event the app sends.
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 “A Telegram assistant that remembers what you tell it” from your assistant

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