Beginner 3 min read

Build your first AI agent in 30 minutes

Step-by-step walkthrough. Use Cursor, LangChain, or Claude to build a research agent.

Your first agent in five steps

Goal

Find five papers and summarise them.

Tools

Web search and a page reader.

Model

Claude, GPT or Gemini.

Wire it and run

  • Cursor
  • LangChain
  • Claude

Your first agent

It runs the goal on its own.

Check the output

  • Read the summary
  • Improve the instructions
  • Run it again

Step by step

  1. Pick one goal

    For example: find five papers on a topic and summarise them.

  2. Give it tools

    Web search to find pages, and a reader to open each one.

  3. Choose a model

    Claude, GPT or Gemini does the thinking.

  4. Wire it and run

    Use Cursor, LangChain or Claude to connect the parts and start it.

  5. Check the output

    Read the summary, improve the instructions, run it again.

Small goal first. Add tools only when the agent needs them.

What you will build

In this guide you build a small research agent: you give it a question, it searches the web, reads a few sources, and returns a short summary with links. It is a good first agent because the result is easy to check and nothing it does can break anything.

You need an AI assistant that can search the web, such as Claude or ChatGPT with web search turned on, or a coding tool like Cursor if you prefer to work in code. The steps below work with any of them.

Step 1: Write the goal in one sentence (3 minutes)

A vague goal gives a vague agent. Write the job as one sentence with a clear finish line, for example: "Given a topic, find the four most useful recent sources, and write a 200 word summary with a link to each source."

The finish line (four sources, 200 words, links) is what lets the agent know when to stop, and what lets you check its work.

Step 2: List the steps you would take (5 minutes)

Write the steps as if you were teaching a new colleague. Search for the topic. Skip ads, forums and pages older than a year. Open the four best results and read them. Note the main point of each. Write the summary in plain words. Put the links at the end.

These steps become the core of the agent's instructions. Most weak agents fail because this list was never written down.

Step 3: Turn it into instructions (7 minutes)

Combine the goal and the steps into one block of instructions. Add a role ("You are a careful research assistant"), the rules ("Only use sources you actually opened. Never invent a link. If you cannot find four good sources, say how many you found.") and the output format (a title, the summary, then a numbered list of links).

Save these instructions somewhere you can reuse them: a saved project, a custom assistant, or a text file. Reuse is what turns a one time prompt into an agent.

Step 4: Give it the tool and run it (5 minutes)

Turn on web search, paste the instructions, and give it a topic you already know well. Knowing the topic lets you judge the answer. Watch what it does: which searches it runs, which pages it opens, and where it hesitates.

Step 5: Check and fix (10 minutes)

Open every link. Check that each one works and says what the summary claims. If a source was weak, add a rule (for example, "prefer official documentation and established news sites"). If the summary was too long, tighten the format. Run it again on a second topic.

Two or three rounds of this usually give you an agent you can trust for the job. Keep a short list of the rules you added. That list is your agent's real value.

Where to go next

Once the research agent works, try a second tool, such as saving the summary to a document or a notes app. Add one tool at a time and test after each. When you are ready for agents that act inside your other apps, look at MCP servers, which connect assistants to tools like your files, calendar or project tracker.