DEV Community

João Victor Sant'ana
João Victor Sant'ana

Posted on

Three Ways to Run AI Specialists Without Repeating the Same Discovery Work

Ask an agent to publish a local directory to GitHub and watch how much work happens before it can touch GitHub. It has to resolve the path, find the repository root, identify which files belong in the publication, and figure out the destination. In a ReAct loop, each observation becomes input to the next model call. As the conversation grows and earlier observations lose prominence, the agent can end up checking facts it already discovered.

At ThinkIac, we wanted to keep the flexibility of that loop while giving specialists a way to do their own scoped work and pass the results forward. That led to three execution modes built around one question: who decides when a specialist runs, and what does the main agent receive before it starts?

1. In prompt mode, the main agent does the work

The existing behavior is still the default. ThinkIac appends the instructions of the specialist pinned to the session to the main agent’s prompt. The main agent interprets those instructions, calls tools, and carries the task through its own loop.

This is a good fit when the specialist mostly contributes conventions or domain guidance. A GitHub profile can tell the agent how to prepare a branch or verify a destination without creating another model call just to interpret those instructions.

The cost appears when guidance turns into investigation. The main agent still has to decide which queries to run, interpret the results, and keep the relevant facts in context across subsequent steps. The prompt appendix tells it how to inspect a repository. The inspection still happens inside the main loop.

2. In on-demand mode, the main agent delegates specific questions

The Runtime classifies which eligible specialists are relevant to the request. The main agent starts without specialist prompt appendices or precomputed evidence. During execution, it can call consult_specialist with a profile ID and a specific question.

For example, after discovering that a directory sits inside a larger repository, the agent can ask the Files specialist:

Which tracked changes are under this path, and which files would be outside the requested scope?

The main agent decides when the answer is needed. Only the explicitly requested specialist runs. It can also consult an eligible profile that the classifier skipped. That fallback matters because relevance can change as the agent learns more about the task. The initial request might say nothing about GitHub. A remote discovered later can make a GitHub consultation relevant.

This mode fits tasks where the next question depends on the previous answer. It saves speculative specialist runs, but the main agent still pays for the steps required to identify the question and delegate it.

3. In automatic mode, the Runtime runs relevant specialists first

In automatic mode, the Runtime uses the classification result to execute selected specialists before the main agent’s first model call. The main agent receives the original request plus structured results from those runs.

For the same publication request, the responsibilities look like this:

  1. Files resolves the path, identifies the repository root, and reports candidate files and any uncertainty about the scope.
  2. GitHub inspects the destination. If the request already names the repository, that check can run alongside Files. If the destination depends on the local remote, GitHub needs the Files result first.
  3. The main agent uses those findings to resolve any remaining ambiguity and carry out the authorized publication.

Each pilot specialist has read-only tools and a narrow assignment. Its result contains facts, references, missing inputs, and blockers. The Files specialist can report which files it found and where it looked. The GitHub specialist can report what it learned about the destination. Both results are small enough for the main agent to act on without replaying the full investigation.

Automatic activation adds work before the first response. Independent checks can overlap, while dependencies create a critical path. The mode pays off when the upfront work replaces several discoveries the main agent would otherwise make in sequence.

Relevance, permissions, and model selection are separate decisions

ThinkIac filters the candidate profiles for the turn and sends one relevance question per candidate in a batch. The pilot uses perplexity/pplx-decider-v1.3:free through OpenRouter’s Decisions API. A batch can select zero, one, or several specialists. The decision model has its own provider and model setting, so it can be changed independently of the main session model. OpenRouter Decisions API

A relevance score determines whether a profile is worth running. The profile’s tool allowlist and the turn’s permissions determine what it can do. Direct consultation skips the relevance gate while keeping the same permission checks. If the classifier times out or returns an invalid batch, automatic activation is skipped and direct consultation stays available.

Automatic runs and direct consultations share the same specialist executor. It takes an explicit tool allowlist, a step budget, and an output schema. A profile can specify its own provider and model. When it omits a model, the executor inherits the session’s effective model for that turn, including a manual selection. The Specialist activation setting keeps In prompt as the default. An observation option runs the classifier and records which specialists it would have selected, with direct consultation still available.

What the pilot verified

Eight controlled tests covered prompt composition, explicit delegation, automatic evidence handoff, model inheritance, and fallback when classification fails. One test checked that selecting only Files adds only Files evidence to the main agent’s prompt. Another verified that on-demand mode can consult an eligible specialist the classifier skipped.

We also exercised the real OpenRouter classifier separately. It returned HTTP 200 in two smoke cases, selecting Files for a local listing request and returning an empty selection for a translation request. The controlled tests used simulated specialist responses. A live end-to-end chat run with real specialists and measurements of latency, cost, and repeated tool calls are still pending.

Explore ThinkIac

ThinkIac is a modular runtime for composing agents, tools, and automations. If you’re building agents that repeatedly rediscover the same facts, I’d love to hear where you draw the line between prompt guidance, on-demand delegation, and work the runtime should do upfront.

Explore the project, open an issue with a workflow you’d like to try, or drop the repo a star if you want to follow along. ThinkIac on GitHub

Top comments (1)

Collapse
 
ayushdhanani369 profile image
Ayush Dhanani •

The GitHub check needing the Files result first is the part I would keep. It is the same problem as a main agent trusting a summary of something it never read.

I build Aladdin, a job agent. The main agent holds the application, and a fresh worker reads the actual page and form for each one. When the two disagree, the worker's read wins, because it saw the actual form. Your pilot specialists reporting facts and references instead of conclusions is the same instinct.

One thing I would add to the result is an explicit stop. Missing inputs and blockers are already in your format, but I found the stop itself matters most. In my case, if the form cannot be read, the worker does not guess. It asks the user instead. A result that only lists facts still leaves room for the main agent to act on a guess.