Skip to main content

Claude/ChatGPT Prompt to Build an Autonomous Research Agent on a Budget

Build an autonomous research agent that plans, searches, cites, and respects a hard token budget. Copy-ready agent loop and prompts.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt

                                

What this prompt does

This prompt has the model act as a senior AI agent engineer and specify an autonomous research agent tightly enough to build, returning working pseudocode and prompts rather than hand-waving. You set the [model], a hard [budget] in tokens, the [tools] it can use, and the [report_format], and it produces the full agent loop, token accounting, tool-use prompts, summarisation strategy, citation handling, and final assembly.

The structure works because it treats the runaway loop as the central risk: an agent that quietly eats the whole [budget] before producing anything useful. Steps for token accounting and a stop condition are what make the agent safe to run unattended, and they're meant to be wired before adding more [tools]. Citation handling ties every claim to a fetched source, and the output is shaped to [report_format] with a self-critique pass. By demanding working pseudocode and prompt templates rather than hand-waving, the prompt gives you the loop, the contracts for each tool, and the compression strategy you actually need to keep a long run coherent.

When to use it

  • You're building an agent that plans, searches, and writes a report on its own.
  • You need a hard token [budget] enforced so runs can't spiral in cost.
  • You want a plan-act-observe-reflect loop with an explicit stop condition.
  • You need every claim mapped to a fetched source for verifiable output.
  • You want note-compression so long runs stay under budget.
  • You want the agent safe enough to run unattended.
  • You want a self-critique pass that catches weak claims before the report ships.

Example output

Expect full pseudocode for the agent loop — plan, act, observe, reflect, with a stop condition — followed by every prompt template. You'll get token accounting that tracks spend per step and halts gracefully near [budget], input/output contracts for each of your [tools], a summarisation strategy, citation handling, and final assembly into [report_format] plus a self-critique pass. It's a buildable blueprint, not prose advice.

Pro tips

  • Set [budget] to a real ceiling you can afford; it's the value the stop condition defends, so vague numbers make the safety guarantee meaningless.
  • Wire token accounting and the stop condition (steps 1 and 2) before adding more [tools] — that order is what keeps unattended runs safe.
  • List [tools] precisely (e.g. web_search, fetch_url, save_note) so each gets a clear input/output contract.
  • Choose [model] deliberately; a pricier model burns the [budget] faster, which changes how aggressive your note compression must be.
  • Specify [report_format] concretely (e.g. structured Markdown with sections and a sources list) so final assembly has a target to hit.
  • Keep the citation rule strict so the self-critique pass can flag claims with no fetched source.

Frequently Asked Questions

How does it stop the agent from burning the whole budget?
Token accounting tracks spend per step and halts gracefully as it nears `[budget]`, paired with an explicit stop condition in the loop. The prompt advises wiring these before adding tools, since a runaway loop is the main risk.
Does every claim get a source?
Yes. Citation handling is a deliverable, designed so every claim maps to a fetched source. A self-critique pass at the end can then catch any claim that lacks a supporting citation before the report ships.
Can I use any model with this?
Yes, set the `[model]` variable to whatever you run. Note that a more expensive model consumes your `[budget]` faster, which makes the summarisation and note-compression strategy more important on long research runs.
What shape is the final report?
Whatever you specify in `[report_format]`, such as structured Markdown with sections and a sources list. The final assembly step targets that shape, so describing it concretely gives you a more usable output.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

More in AI Chatbot & Agent Building Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

Claude Code Expert · Online

👋

Hey there!

Quick Actions

WhatsApp Instant reply

Chat on WhatsApp

+880 1723 741224 · Instant reply

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

[email protected]

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support