# Generalist Agent

## **Generalist Agent** ([v6.1.0](https://docs.tabnine.com/main/getting-started/tabnine-cli/features/subagents/pages/risy3bTOlfBfgFRRXK8K#v6.1.0))

The Generalist Agent in Tabnine CLI is a general-purpose sub-agent that handles turn-intensive or data-heavy tasks on behalf of the main session. It has access to the same tools as the primary agent, but runs as a delegated worker whose entire execution is consolidated into a single result — keeping the main session history lean and efficient.

This matters because the main session carries its full history with every turn. The larger that history grows, the more expensive each subsequent interaction becomes. Delegating heavy work to the Generalist Agent contains that cost without sacrificing capability.

### **When to use the Generalist Agent**

The Generalist Agent is invoked either manually (with the `/generalist` flag) or automatically by Tabnine CLI when a task is well-suited to delegation. You do not need to invoke it explicitly — the primary agent determines when to delegate based on the nature of the request.

Delegation is most appropriate for the following scenarios:

* Batch refactoring or fixes across many files (e.g., adding license headers, renaming symbols project-wide)
* Commands expected to produce high-volume output (e.g., verbose builds, exhaustive search results)
* Exploratory investigations with uncertain scope or many intermediate steps

For simple, surgical tasks — single-file edits, direct questions, or changes that can be resolved in one or two steps — the primary agent handles the work directly. Delegation is an efficiency tool, not a default.

### **How it works**

When the primary agent delegates a task, the Generalist Agent executes it in full using the complete toolset. The primary agent receives a single consolidated summary of the work done, rather than a turn-by-turn trace. This keeps the main session history short and subsequent interactions fast.

The Generalist Agent is not a separate mode you configure. It is an internal capability that Tabnine CLI uses as part of its normal operation and has access to the full Tabnine CLI toolset.

### **Relationship to other agents**

Tabnine CLI includes several specialized sub-agents. The Generalist Agent is purpose-built for breadth — capable across all domains rather than specialized in one.

| Agent                            | Best used for                                                  |
| -------------------------------- | -------------------------------------------------------------- |
| **Generalist Agent**             | Batch tasks, high-volume output, exploratory investigation     |
| **Codebase Investigator**        | Architecture mapping, dependency analysis, root-cause research |
| **Remote Codebase Investigator** | Cross-repo search, remote codebase analysis                    |

### **Limitations**

Because the Generalist Agent's execution is returned to the main session as a single consolidated summary, you do not get a turn-by-turn trace of the steps it took. If you need full visibility into every action the agent performs — for example, for audit or compliance purposes — run the task directly in the main session instead of delegating it.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tabnine.com/main/getting-started/tabnine-cli/features/subagents/generalist-agent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
