LangChain Proposes Goal Engineering for Long AI Agent Tasks

Share

LangChain's Harrison Chase proposes goal engineering: when you give an AI agent an open-ended goal, the key is to set its scope so people can give feedback easily. Read the sales team example that explains why, plus a prompt that has your AI agent regroup your repetitive work by action.

Machine translation. Read the original

LangChain founder Harrison Chase published an article on the official LangChain blog on November 14 proposing "goal engineering." AI agents are now taking on open-ended, long-running goals, such as "improve the performance of our ads." What decides success is how you set the agent's scope, so that a person can give it feedback easily while it works. Chase even argues that prompt engineering and context engineering will fade away, and only goal engineering will remain.

What goal engineering is about

AI agents have grown in ability. They started by only writing text, then they learned to call tools and make decisions, and now they can complete an entire task. The next step is to give an agent an open-ended goal and let it keep working until the goal is done.

The problem is context. When an agent does poorly, it is usually missing some information. Some information is easy to provide, like documents and API permissions. The hardest thing to provide is experience that exists only in someone's head, such as brand tone or how to speak to a particular customer. That is written down nowhere. The only way to teach it is through feedback, each time a person checks the agent's work.

So the core idea of the article is this: when you design an agent's goal and scope, first decide where a person will check its work and how much they will check at once, so that feedback is cheap and reusable.

An example from a sales team

The article describes how Actively, a company that builds agents for sales teams, changed its approach:

Version How work was split Result
First version One agent per customer, with the goal of moving that customer forward Salespeople had to switch between many agents, and what one agent learned about a customer could not be passed on to the others
Second version Split by action, such as prospecting for new customers or moving early deals forward. Each agent handled many customers at once The same kind of task could be checked in batches, and feedback on one task was automatically applied to similar tasks

The key is that methods for prospecting and how firm the tone should be are shared across customers. When you split by customer, that experience gets scattered. When you split by action, the scope of feedback matches the scope of the agent. Customer data is mostly objective information stored in systems, so a background agent can gather it on its own.

What it means for you

Even if you only give tasks to your own AI agent, this idea helps:

  • Assign by type of task, not by one object: For example, ask it to "draft all this week's follow-up emails for every customer" instead of "handle everything for customer A." When similar tasks sit together, a fix you make once can help all of them.
  • Write your corrections down as rules: Each time you say "this tone is too harsh" or "this kind of table needs a total row," have the agent record it. Next time, it can follow the rule on similar tasks.
  • Let it gather objective data, and keep judgment for yourself: Let the agent organize the customer list and history. You decide on tone and tradeoffs.

If you want an AI agent to keep working on a goal until it finishes, first read the OpenCode goal tutorial.

How to get started

Take a task you repeat often, and have your AI agent split it up with goal engineering in mind:

I want to rethink the work I give you using the "goal engineering" approach. A task I repeat often is: [for example: write weekly follow-up emails for 20 customers]. Please help me:

1. First ask me how I do this now, how many items there are each time, and which parts of your output I most often change
2. Regroup the work by "same kind of action," not by customer or project. Explain why each group belongs together
3. Design a way to check each group: how many items I should review at once, and which few points tell me whether the work is good
4. Create a "my rules" file. Record every correction I give you there, and read that file first on similar tasks
5. List which information you can gather yourself, and which judgments must stay with me

Show me the plan first. Do not start working until I confirm.

I have it create a "my rules" file so your experience stays on record. Otherwise, each correction only helps in that one conversation, and you would have to teach it again in a new one.

Things to note

  • This is LangChain's opinion piece. The author's claim that prompt engineering will disappear is a judgment, not a settled fact.
  • Batch processing by action suits repetitive work. For one-time large projects, it is clearer to give tasks one at a time.
  • To understand why context matters so much, read the context handbook.
Done with this one? Mark it to track your path.Sign in
Save it for laterSign in
Questions about this piece?Ask AI about this

Comments (0)

No comments yet. Start the conversation.

Sign in to join the discussion.Sign in