← Back to articlesLearning about agents / 01

Agent Basics: From Answering Questions to Completing Tasks

Use a research-organizing task to understand why agents need a feedback loop.

AgentFundamentals
On this page
  1. From answers to actions
  2. Understanding the feedback loop
  3. Start with three questions
  4. Try it yourself

From answers to actions

Ordinary question answering often stops at generating text. An agent also needs to choose actions based on its goal and move forward using the results of those actions.

Consider organizing technical reference material: first define the topic, then search for material, check whether the results are relevant, and finally produce a summary. If the search finds no useful content, adjust the query rather than fill in the missing information as though it were fact.

Understanding the feedback loop

A goal does not turn into an answer in a single step. After taking an action, its results need to inform the next decision: is there enough information? Are the results reliable? Is further work needed?

The following illustrative pseudocode was added for this learning example. It is neither code from the original project nor an implementation that can run as written:

// 说明性伪代码:工具、检查函数尚未实现
async function collectNotes(topic: string) {
  for (let attempt = 0; attempt < 3; attempt++) {
    const results = await search(topic, attempt);
    if (isRelevant(results)) return summarize(results);
  }
  return { status: "需要补充信息", notes: [] };
}

Clear stopping conditions matter more than endless retries. This code only illustrates the structure; it does not represent an agent system validated through testing.

Start with three questions

  1. What information can it access?
  2. What actions is it allowed to perform?
  3. How can it tell whether the task is complete or it needs to stop?

Information, permissions, and completion criteria turn abstract “intelligence” into a process that can be inspected.

Try it yourself

Draw the “search—check—organize” workflow, and design separate exit conditions for no results and repeated results.

This article offers learning ideas only, not results measured by the site owner. The next article uses ReAct to explore further how actions and feedback connect.