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.
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
When you send a message to your Telegram bot, ClickRuntime first checks that it came from your own account.
If the message starts with "remember:", the fact is saved in your Pinecone index with today's date, and the bot replies to confirm.
Otherwise it searches your saved memories for the ones closest in meaning to your question.
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
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
- 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
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?
Can I correct a memory?
What if it has nothing saved on a topic?
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
Ask a Telegram bot questions about your documents
Send a PDF to your bot and it is added to your library; ask a question and you get an answer drawn from those documents.
See how it worksStore new reviews in Pinecone and flag bad ones on Telegram
Every new review of your business is saved for later analysis, and you get a Telegram message the same day about any one- or two-star review.
See how it worksGet error alerts with a plain-English explanation
When one of your jobs or systems fails, #ops gets the error and a one-line guess at the cause, without the same error twice in an hour.
See how it worksKeep exploring
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.