General Agent: agents that invent their own tasks

General Agent: agents that invent their own tasks
General Agent: agents that invent their own tasks
I also explain it in this video, on my Articulator EN channel.

The problemlink

For an agent to learn to use tools, it has to practice on many tasks with very different tools, across the whole post-training pipeline. But in open source, environments with thousands of tools are scarce.

The article's answer is to turn task creation into a two-player game:

  • The synthesizer designs a new task following a fixed schema, with several mechanisms to make sure it is solvable, diverse and hard.
  • The solver tries to solve it many times.

Only tasks whose pass rate lands in a calibrated difficulty band are accepted. And the hardest ones seed the next wave, so the corpus gets harder over time. Every task works on a stateful database and is checked semantically, not by matching the text of the answer.

Anatomy of a tasklink

Every task has the same four pieces: a database, a set of tools that change it, an instruction, and a gold solution with its verification function.

The four pieces of a task: database, tools, instruction and verification.
Database, tools, instruction and verification.

The database is a Pydantic model with the domain's entities and their relationships. The article's example is the day_spa family: there are services (with category, duration and price), therapists (with their specialties and availability) and appointments. A therapist performs a service during an appointment.

class Service(BaseModel):
    id: str
    name: str
    category: str  # massage, facial, body_treatment, nail_care
    duration_minutes: int
    price: float

class Therapist(BaseModel):
    id: str
    name: str
    specialties: list[str]  # service categories they can perform
    is_available: bool = True

class Appointment(BaseModel):
    id: str
    customer_name: str
    service_id: str
    therapist_id: str
    status: str = "booked"

The tools are plain Python functions that read or change the database. The agent never touches it directly. Tools enforce the domain logic (the therapist must be free, able to do that service, above a minimum rating) and return structured feedback.

class TaskTools(Tools):
    db: TaskDB

    @tool
    def list_services(self) -> list[dict]:
        """Return all spa services with details."""
        return [s.model_dump() for s in self.db.services]

    @tool
    def list_therapists(self) -> list[dict]:
        """Return all therapists with their specialties."""
        return [t.model_dump() for t in self.db.therapists]

    @tool
    def book_appointment(self, appointment_id: str, customer_name: str,
                         service_id: str, therapist_id: str) -> dict:
        """Book a spa appointment."""
        # check therapist availability and specialty match
        # mark therapist unavailable, append appointment...

The instruction comes in natural language. In the seed task, day_spa_t0, it reads:

Hi, I'm Sarah and I'd like to book a Swedish Massage. Could you look up the services and therapists, then just go ahead and book me with any available therapist who does massage? Don't worry about asking me to pick, just pick one and book it.

The agent has to figure out on its own which tools to use, and in what order.

Verification and gold solution. To make sure the task can be solved, the synthesizer writes a verification function that checks every constraint in the instruction, and a gold solution that must pass its own verification. For the seed, it's enough to check that Sarah has a booked appointment for that service:

def verify(db: TaskDB) -> float:
    """Check that the target customer has a booked appointment
    for the target service."""
    if not db.target_customer or not db.target_service:
        return 0.0
    for a in db.appointments:
        if (a.customer_name == db.target_customer
            and a.service_id == db.target_service
            and a.status == "booked"):
            return 1.0
    return 0.0

And the gold solution lists the services, lists the therapists and books:

[["list_services", {}],
 ["list_therapists", {}],
 ["book_appointment", {"appointment_id": "A1", "customer_name": "Sarah",
                       "service_id": "S1", "therapist_id": "T1"}]]

Before a task is accepted there's a very simple sanity check:

  • verify(initial_db) == 0.0: the task can't come already solved.
  • verify(gold_db) == 1.0: after replaying the gold solution, verification must pass.

If that fails, something is fundamentally broken. It's a first structural check that the task is solvable.

The difficulty ladderlink

Being solvable isn't enough: a task also has to be a challenge. Following the DeepSeek-V3.2 methodology, the article finds that evolving a task from trivial to hard is much easier than writing a hard task in one shot. So the synthesizer starts with a simple seed and makes it harder step by step, extending the instruction, the database and the tools. Each family has five tiers, t0 to t4, and there are nine strategies to move up:

StrategyWhat it doesSpa example
multi_step_reasoningThe answer requires combining results from several tool callsSearch for sensitive-skin facials and filter therapists rated ≥ 4.7 before booking
conditional_rulesConditional constraints that require branchingIf the skin is sensitive, the facial must be for sensitive skin
cross_entity_couplingNo repeats, sums, dependency chains, mutual exclusivity across entitiesNo therapist reused across bookings
stricter_thresholdsBudgets, minimum ratings, capacity capsTotal cost ≤ $195
larger_dbMore entities and more distractorsThe database grows from 26 to 97 entities
schema_extensionNew entity types and relationshipsNew Package and Product entities
tool_proliferationPlausible-looking but irrelevant toolslist_packages and list_products, not needed by the gold solution
noisy_instructionsRealistic typos, 2 to 5 per instruction"treaments", "thas", "dont", "skins been acting up"
ambiguity_resolutionThe agent must disambiguate through tool calls, or tools have less informative namesA "Prenatal Massage" looks perfect for a pregnant client but has medium pressure

Each family has to use at least five different strategies. And above all, every tier is measured: it's tested against a solver model and only accepted if its pass rate lands in a target band, from 0.8-1.0 at t0 down to 0.0-0.2 at t4.

Here's how the spa family grows:

TierTarget bandGPT-5-mini (avg@50)GLM-5.1 (avg@50)ToolsGold stepsEntities
t01.0-0.81.001.003310
t10.8-0.60.751.007626
t20.6-0.40.550.667897
t30.4-0.20.350.10128122
t40.2-0.00.200.22128184

GPT-5-mini, the calibration model, lands in every band by design. GLM-5.1, which wasn't used for calibration, also does worse on the higher tiers, though not in a perfectly ordered way: it scores 10% on t3 and 22% on t4. The article speaks of a "clean" inverse relationship; it is for GPT-5-mini, while GLM-5.1 shows that small bump.

Where models faillink

The most interesting part of the article is its analysis of GLM-5.1's failed attempts.

Tier t2 (GLM-5.1 solves 66%). It adds three strategies (larger database, cross-entity coupling and stricter thresholds) and grows the database from 26 to 97 entities. Olivia asks for a sensitive-skin facial, a gentle massage and a manicure, within budget and with no therapist or room reused. In almost all failures, the model picks a medium-pressure massage instead of a light one: that massage is known for "gentle flowing motions", so the model reasons it counts as gentle. It substitutes world knowledge for what's in the database. (A detail: the tier description mentions a $195 budget, while Olivia's instruction says $200.)

Tier t4 (GLM-5.1 solves 22%). Ambiguity, coupling and typos, with 184 entities. Mia is pregnant, writes with typos, and wants a soft-pressure massage, a sensitive-skin facial and a simple nail treatment, with $210 and only therapists rated 4.7 or higher. A "Prenatal Massage" shows up, contextually perfect, but its pressure field is medium. In most failures, the model books it. The right answer is the Couples Massage, $87 with light pressure: less obvious, but the one that meets the constraint. Budget violations pile up, and there are more failed than successful attempts.

The prenatal massage has medium pressure; the $87 couples massage has light pressure.
The name misleads; the data doesn't.

The two-player gamelink

The synthesizer designs task families and evolves them through the tiers; it was used offline to generate the corpus. The solver plays two roles: it measures difficulty during synthesis, and it's the model that later gets optimized with reinforcement learning.

Both are verifiers environments, Prime Intellect's library, so they plug into its evaluation, training and data generation platform. According to the article, that gives them this infrastructure at scale "for free". For the initial corpus they ran over 1,000 GLM-5.1 synthesizer agents in parallel, over several days, with barely any supervision.

The synthesizer proposes a task, the solver tries it several times and the gate accepts it or sends it back.
The synthesizer proposes, the solver estimates the pass rate, and the gate accepts or retries.

The core insight is that creating a task is itself an agent task. The synthesizer is a language model in a sandbox with access to the General Agent CLI, guided by a skill that defines the task format, the evolution strategies, the gating criteria and the full protocol. The skill keeps the corpus consistent while the agent is free to choose the domain, the tasks and the constraints. The protocol has five steps:

  1. Design: pick a new domain, design the database schema and the tool API.
  2. Seed: write the simplest useful task, its verification and a gold solution that passes it.
  3. Gate: 20 solver rollouts on the seed; with a pass rate of at least 0.80 it's accepted; otherwise, adjust and retry.
  4. Evolve: for each tier from t1 to t4, add strategies, extend the database, write the new task, validate it and gate it against its band (for example, 20-40% for t3).
  5. Validate: the family must use at least five different strategies.

With that loop, every task is structurally valid (the gold solution replays and verification agrees), empirically calibrated (difficulty isn't guessed, it's measured) and diverse (each family combines several independent strategies).

The solverlink

The solver has three backends, with the same task format and the same scoring. Only the way the agent reaches the tools changes:

  • Local: calls the tools as Python functions in-process. It's the fast one, and the one the gate uses inside the synthesizer's sandbox.
  • OpenCode: an OpenCode agent in a sandbox; each tool is exposed through a local MCP server.
  • RLM: an RLM agent in a sandbox; each @tool is wrapped in a skill the agent calls from its IPython kernel with await <tool>.run(...).

For example, this runs 5×3 rollouts on the spa family with GPT-5-mini as a local solver:

prime eval run general-agent-solver-local -a '{"task": "day_spa"}' -m openai/gpt-5-mini

All trajectories are uploaded to Prime Lab. In the article's example, the model solves the spa seed with two parallel calls (services and therapists) and a single call to book: exactly the optimal strategy.

The corpuslink

With GLM-5.1 (FP8) as the synthesizer and GPT-5-mini as the gate (avg@20), the loop produced 4,504 tasks across 1,040 domains. Each family is its own world, with its own schema, logic and verification, and every task has been measured against at least one model. They also generated over 200,000 traces with GLM-5.1 as the solver in the RLM harness, to estimate difficulty with a much stronger model.

Diversity. The 1,040 families define 8,159 unique tools and 2,222 entity classes (like Customer, Booking or AirspaceZone). 78% of the tools and 66% of the classes appear in a single family; the rest are shared abstractions, like Order, Equipment or get_customer.

All nine strategies are well represented. The most frequent are cross-entity coupling (1,505 tasks) and conditional rules (1,467); the rarest is ambiguity resolution (636), because it takes more careful task design.

Tasks using each strategy: 1505, 1467, 1279, 1209, 1102, 1028, 978, 840 and 636.
How many tasks use each evolution strategy.

Calibration. Across the corpus, difficulty rises in an orderly way with the tier:

TierGPT-5-mini (avg@20)GLM-5.1 (avg@50)ToolsGold stepsEntities
t00.9280.9616.32.510
t10.7570.9289.08.723
t20.6010.89511.413.3240
t30.4070.86313.417.2323
t40.2510.79214.920.5437

GLM-5.1 drops too, but with a much gentler slope. Task by task, GPT-5-mini's distribution shifts from right to left: on t4, most tasks sit below 0.3. GLM-5.1's stays to the right even on t4 (median 0.98), though its tail of failures grows with each tier: the ladder also holds for a model it wasn't calibrated on.

Pass rate by tier: GPT-5-mini drops from 0.93 to 0.25; GLM-5.1 from 0.96 to 0.79.
Both models do worse at each tier; GLM-5.1 with a much gentler decline.

The author's conclusion is honest: with this version of the corpus, there's little room to improve GLM-5.1. To improve tool calling on strong models, the tasks would need to keep evolving, using t4 as the seed and gating against stronger open models.

Does it work for training?link

To stress-test it, they ran two simple experiments, one with reinforcement learning and one with supervised fine-tuning (SFT), and measured on two external benchmarks: BFCL (Berkeley Function Calling Leaderboard, function-calling accuracy across diverse real-world APIs) and a subset of MCP-Atlas (multi-step tool orchestration against real MCP servers).

Reinforcement learning. They trained Qwen3-30B-A3B-Instruct on the whole corpus except the trivial t0 seeds: 200 steps with a constant learning rate of 1e-6, batches of 32×16 rollouts and 32k-token sequences. Average reward climbs from 30% to somewhere between 60 and 70% (the text says "~70%"; the smoothed curve peaks a bit lower), with the steepest gains in the first 100 steps. And turns per rollout go from about 8 to about 24: the model learns to make more tool calls and solve its tasks more reliably. Note that this is measured on the same tasks it trains on; there are no external benchmarks in this experiment.

RL training: average reward climbs from 30% to between 60 and 70%, and turns per rollout from about 8 to about 24.
More reward and more turns over 200 steps.

Supervised fine-tuning. They took the Nemotron-3-Nano-30B-A3B base model and trained it on 4,417 GLM-5.1 conversations from the corpus, with their tool calls and results, without any filtering: 200 steps, learning rate 5e-5 with a 50-step warmup, batch size 8 and 64k context on 16 H200s. The loss drops from 0.6 to 0.1, with most of the learning in the first 80 steps.

With just those 4.4k traces, BFCL goes from 18.9% to 52.3% and MCP-Atlas from 0.6% to 12.1%. For comparison, the final post-trained version of the model scores 73.5% and 45.5%, but with orders of magnitude more data. So it doesn't catch up; what stands out is how much it moves with so little data. (The text says the base model "starts near zero on both benchmarks"; that's true for MCP-Atlas, while BFCL starts at 18.9%. And in the figure, the last BFCL point, at step 160, sits around 51.7%.)

Fine-tuning: BFCL goes from 18.9% to 52.3% and MCP-Atlas from 0.6% to 12.1%.
BFCL and MCP-Atlas at intermediate SFT checkpoints.

What's nextlink

The broader goal is to close the loop toward self-improving agents that build their own environments automatically. To get there, Prime Intellect wants to train agents, not just models (any task in any harness) and to compose several agents in one episode (synthesizer and solver, solver and grader…). The concrete next steps:

  • Harder corpus: use the hardest tier as the seed and gate against a stronger model, to get tasks that challenge frontier models.
  • Other domains: the same recipe to generate environments for terminal use or document retrieval, grounded in real-world seed data.
  • Multi-agent training: today synthesis runs offline and leaves a fixed corpus, but since both agents are verifiers environments, the game itself can be trained. That would let the corpus evolve during training. It's future work; it doesn't exist yet.
  • Abstractions: a preview of what will become verifiers v1 decouples tasks (what to solve) from harnesses (how to solve it), and General Agent is the perfect playground because it mixes local and sandboxed execution, task-specific tools and a multi-agent subtask.

To sum uplink

General Agent turns task creation into a game between two agents. One invents tasks with a database, tools and verification, and the other measures how hard they are. The result is a 4,504-task corpus that calibrates itself and can keep getting harder. With it, a base model improves a lot at function calling with very few traces, although for the strongest models the corpus still falls short.

In one sentence

Creating a task is itself an agent task; so is measuring how hard it is.

Sourceslink

Continue reading

Last posts -->

Have you seen these projects?

Gymnasia

Gymnasia Gymnasia
Expo
React Native
TypeScript
OpenAI
Anthropic

Fitness app with two agents that run entirely on the device, with no backend, so the user's data never leaves the phone. A BYOK conversational coach with local tools and a remote system prompt with offline fallback, plus a food estimator that pulls macronutrients out of a photo of the plate, with barcode scanning against OpenFoodFacts.

LangGraph Deep Researcher

LangGraph Deep Researcher LangGraph Deep Researcher
Python
LangGraph
FastAPI
React
TypeScript
Docker

Multi-agent research system built with LangGraph. A supervisor breaks your question down into topics and launches search sub-agents in parallel; each one compresses its findings before handing them to a writer agent that produces the final sourced markdown report. Live streaming over WebSockets, a configurable model per role and bring-your-own API keys that are never persisted server-side.

Tau

Tau Tau
Python
LangChain

Multi-agent tutoring system for secondary school students, with one agent per subject and course material written and validated by a team of teachers. It was used with real students at a private school in Spain and at a secondary school in Colombia.

View all projects -->
>_ Available for projects

Do you have an AI project?

Let's talk.

maximofn@gmail.com

Machine Learning and AI specialist. I develop solutions with generative AI, intelligent agents and custom models.

Do you want to watch any talk?

Last talks -->

Do you want to improve with these tips?

Last tips -->

Use this locally

Hugging Face spaces allow us to run models with very simple demos, but what if the demo breaks? Or if the user deletes it? That's why I've created docker containers with some interesting spaces, to be able to use them locally, whatever happens. In fact, if you click on any project view button, it may take you to a space that doesn't work.

Flow edit

Flow edit Flow edit

FLUX.1-RealismLora

FLUX.1-RealismLora FLUX.1-RealismLora
View all containers -->
>_ Available for projects

Do you have an AI project?

Let's talk.

maximofn@gmail.com

Machine Learning and AI specialist. I develop solutions with generative AI, intelligent agents and custom models.

Do you want to train your model with these datasets?

short-jokes-dataset

HuggingFace

Dataset with jokes in English

Use: Fine-tuning text generation models for humor

231K rows 2 columns 45 MB
View on HuggingFace →

opus100

HuggingFace

Dataset with translations from English to Spanish

Use: Training English-Spanish translation models

1M rows 2 columns 210 MB
View on HuggingFace →

netflix_titles

HuggingFace

Dataset with Netflix movies and series

Use: Netflix catalog analysis and recommendation systems

8.8K rows 12 columns 3.5 MB
View on HuggingFace →
View more datasets -->