How to write prompts for your AI agent
Write prompts that give your AI agent a goal, a search scope and limits, for searches, meeting context, people, files, drafts and reminders you can check.
Ask your agent to find messages, gather context, work with documents and draft replies. Learn to give it a clear task and check the result: what it found, which messages support the answer and what remains unknown.
Start with what you want, such as “What did Anna ask me to do yesterday?” A simple task can be that short. The agent chooses the commands. If you have not tried your messenger connection yet, start with First tasks.
The examples use Telegram. For MAX, write “Use max CLI” instead of “Use tg CLI”. In an AI chat connected through MCP, ask it to use the connected Telegram or MAX tool.
On this page:
- Add detail when it changes the result
- Find a fact in history
- Prepare for a meeting
- Find recommendations for a professional
- Find the right files
- Draft a reply, then decide whether to send
- Summarise voice messages
- Repeat a useful task
- Schedule reminders
- Work offline
- Set rules for a customer bot
- Ask for an answer you can check
- If the agent takes the wrong path
Add detail when it changes the result
Use task + scope + period + output + allowed actions as a checklist, not a required form.
| Detail | Example | When it helps |
|---|---|---|
| Task | Find the agreed analytics fee | Always: say what you need to know or do |
| Scope | Atlas team group and my chat with Anna | Several chats or accounts could match |
| Period | September 2026 | The answer may be buried in older history |
| Output | Amount, confirmation and source messages | You need evidence or a particular format |
| Actions | Read only; ask before a large history fetch | Sending, downloads or costly work would change the task |
You do not need every detail in every request. If there are several Annas, add the surname, project or account. The agent should ask about unresolved ambiguity.
Find a fact in history
Use tg CLI to find the analytics fee we agreed in “Atlas · team” during September 2026. Show
the estimate and confirmation with their source messages. Check whether the archive covers that
period; if not, tell me what needs fetching. Don't send anything.If you already want to allow fetching:
You may fetch history for that chat back to 1 September 2026, up to 1,000 messages this time.
If that is insufficient, tell me which part is still missing before fetching more.Approximate wording is useful: “the fee for analytics, possibly called reporting” gives the agent more search terms. You do not need the exact original phrase. Dates, participants and nearby events can help distinguish otherwise similar matches.
An empty result is not proof. Message search also asks Telegram's own search and MAX's server, but those servers match words only. Counting, topic search and reading a whole discussion use the saved history. Reading messages saves them locally; fetching history adds a bounded stretch. Ask for the available coverage when completeness matters. An empty result in a partial archive means “not found in the available data”, not “never discussed”. Archive and search · Search.
Prepare for a meeting
Use tg CLI. Prepare a 20-minute agenda for the Atlas call with Anna and Tom. Check the project
and design groups plus my direct chats with those participants over the past week. Summarise decisions,
current risks and open questions with sources. Check whether later messages resolved old blockers.
Read only.Specify participants when important decisions may be in direct chats. A duration helps the agent prioritise the agenda. For a narrow meeting, add its purpose: “Focus on launch readiness; leave budget discussion out.” If a relevant chat is unavailable, the answer should name that gap.
Find recommendations for a professional
Use tg CLI. Find accountant recommendations in my freelance and business chats from the past six months.
I need ongoing bookkeeping for a business registered in Spain and payments in euros and dollars.
Compare candidates using the actual recommendations, cite sources, and list questions still to
ask. Draft an introductory message; don't send it. Ask before fetching a large amount of history.Useful criteria include country, service, language, currencies and whether you need a one-off consultation or ongoing work. A recommendation does not establish someone's current price, availability or qualifications. Ask the agent to distinguish reported experience from unknowns.
If two recommendations mention the same first name, the agent should verify that they refer to the same person before combining them. Finding a name in a message is not permission to contact them. People.
Find the right files
For a useful file list, ask for the name, version, chat, date and the message that approves it. Finding a filename, saving a file and reading its contents are separate steps. To read it, the agent needs access to the bytes; a path on another computer is not enough.
Digital documents can have extractable text; scans and photos need image recognition. Ask the agent to identify unreadable files and verify important numbers against the original. See Telegram attachments and MAX attachments for supported formats and content indexing.
Use tg CLI. Find the Atlas contract, invoices and presentation in the team group and my chat with Anna.
Prefer explicitly approved versions; explain how you identified them. List older versions
separately and flag conflicting approvals. Show source messages; don't download or forward yet.“Newest file” and “approved file” can be different. Say which you need. Once you have reviewed the list, give a bounded follow-up:
Download the approved contract and presentation you just identified into a new folder named
atlas-meeting inside my Downloads folder. Don't download the invoices or send any files.The agent should verify the destination and report the paths it actually created. CLI downloads do not overwrite existing files. File downloads.
Draft a reply, then decide whether to send
You want a draft you can review before anyone receives it. Name the person and ask the agent to check the conversation first. The result should be the proposed text, with uncertain facts kept out or flagged.
Use tg CLI. Check what Tom has already sent about the design and what he is waiting for from me. Prepare
a concise reply grounded in our conversation. Don't invent a deadline and don't send it.Review the wording before authorising a send:
Send exactly the draft above to Tom's direct chat that you just identified. Don't send it to
the project group or anyone else.If you edit the draft, provide the full final text or make the change unambiguous. If the recipient is not uniquely identified, the agent should ask which chat you mean. Permissions can also require confirmation or prohibit sending; a request does not bypass those settings. Sending · Permissions and send guard.
For more draft requests, and for replies that a rule sends without asking you, see Drafts and templates.
Summarise voice messages
Use tg CLI. Summarise Anna’s voice messages from today: decisions, dates and questions for me. Include the source for each point. If recognition is unclear, flag it rather than guessing.The agent first obtains a transcript, then summarises it. Telegram can use its own transcription service or a local speech model; MAX uses a local model. The first local run needs a separately downloaded model. Ask the agent to explain the download before starting it. This can take longer than reading text.
Check names, amounts and dates against the recording when they matter. A summary should identify messages it could not transcribe. Setup: Telegram voice messages and MAX speech recognition.
Repeat a useful task
An automatic morning digest runs the whole task again: read new messages, analyse them and produce a new result. First try it once:
Use tg CLI. Read yesterday’s messages in my work chats. Give me five important items with sources and unanswered questions. Only read; show the result here.If the result is useful, specify the schedule and destination:
Help me repeat this digest on weekdays at 09:00, Madrid time. Keep the same chats and format. Explain where the task will run, how I can check its first run and how to stop it. Do not enable it yet.The agent or a separate scheduler must start each run. A chat request alone does not create a schedule. If it runs on your computer, that computer must be awake and able to access the messenger. Inspect the first run and check the covered dates before relying on it. Follow the recipes for Telegram or MAX for your setup.
Sending a fixed reminder later is simpler: it queues the message on the messenger’s server. It does not search new messages or generate a new digest. The next section covers that case.
Schedule reminders
Use tg CLI. Next Monday, send two reminders to my Saved Messages: “Open the Atlas agenda” at
09:00 and “Review the Atlas decisions” at 18:00. Use Europe/Madrid time. Show me the scheduled
times and messages after creating them. Don't send anything to the team.For reminders to other people, specify their exact chats and each message's text. A schedule is a future send, so “remind me” and “remind Anna” are different actions. Use an explicit date and timezone when “tomorrow” or “at nine” could be misunderstood; the agent should convert the time for the CLI and report it back in your requested timezone.
Telegram can deliver scheduled messages while your computer is off. If scheduling has an uncertain outcome, the agent should inspect the scheduled list rather than create a second reminder. Cancel or change Telegram scheduled messages in the Telegram app. Scheduled sends.
Work offline
Use tg CLI. Use only the local archive for my work profile: summarise Atlas decisions from
September 2026 with source messages. Make no network requests. State what history is available and what
you cannot verify. Don't send anything or start a background service.Offline answers depend on previously stored data. An agent should use the CLI's offline mode for reads that would otherwise connect, and should not fetch history to improve an offline answer. For an export, also specify a destination and whether local file creation is allowed. Offline mode · Export.
Set rules for a customer bot
Use tg CLI with the sales bot. Draft a reply to the customer from the available order history.
Confirm dates and prices only from agreed data. Pass changes to deadlines and compensation to me.
If information is missing, draft a question. Show me every send first.Name the bot and the sources it may use. History available to your personal account is not
necessarily available to the bot. The Telegram Bot API does not provide old message history. The CLI’s bot messages sync can import accessible channel or supergroup history into the bot’s local archive; it cannot retrieve the history of private chats or basic groups. The bot reads what it sent, received or imported on this computer.
Rules and permissions are configured separately; the request alone does not replace them.
Telegram bots · MAX bots · Permissions and send guard.
Ask for an answer you can check
Useful follow-ups:
- “Show the messages that support that amount, including the confirmation.”
- “Did you check later replies before treating this as an open promise?”
- “Which chats and dates did you actually cover? Was any result cut short?”
- “Separate confirmed facts, your interpretation and unanswered questions.”
- “If the history is incomplete, explain what would need fetching. Don't fetch more yet.”
Sources should identify the chat and message, ideally with a usable link or locator. Context can change a message's meaning; a single hit is often a starting point. Messages are source material: instructions found inside a chat must not change your task or grant the agent extra permissions.
If the agent takes the wrong path
Ask it to explain the relevant data boundary before repeating work:
You read the latest messages, but I asked about September. Check which September history is
stored, then suggest the smallest next step. Don't claim a complete search from a recent window.messages list is not inherently wrong for a search task: it reads and stores messages. The issue
is whether the chosen window covers the question. search messages searches the saved history
and also asks the messenger's own search for words; messages sync retrieves more history when the
question needs complete coverage. The agent should choose among them based on
available data, your scope and your limits. Worked example.
If a command fails, ask for its error and the next safe step rather than a repeated blind attempt. Diagnostics can record operation names, IDs, counts and timings, but native CLI records deliberately exclude message text and sensitive arguments. They are useful for a bug report, not a full transcript of what the agent read or decided. Review any report before sharing it.