Skip to content

Commit 3abee10

Browse files
authored
Docs: Add documentation for model steering (experimental). (google-gemini#21154)
1 parent 64b3a76 commit 3abee10

3 files changed

Lines changed: 178 additions & 0 deletions

File tree

docs/cli/model-steering.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Model steering (experimental)
2+
3+
Model steering lets you provide real-time guidance and feedback to Gemini CLI
4+
while it is actively executing a task. This lets you correct course, add missing
5+
context, or skip unnecessary steps without having to stop and restart the agent.
6+
7+
> **Note:** This is a preview feature under active development. Preview features
8+
> may only be available in the **Preview** channel or may need to be enabled
9+
> under `/settings`.
10+
11+
Model steering is particularly useful during complex [Plan Mode](./plan-mode.md)
12+
workflows or long-running subagent executions where you want to ensure the agent
13+
stays on the right track.
14+
15+
## Enabling model steering
16+
17+
Model steering is an experimental feature and is disabled by default. You can
18+
enable it using the `/settings` command or by updating your `settings.json`
19+
file.
20+
21+
1. Type `/settings` in the Gemini CLI.
22+
2. Search for **Model Steering**.
23+
3. Set the value to **true**.
24+
25+
Alternatively, add the following to your `settings.json`:
26+
27+
```json
28+
{
29+
"experimental": {
30+
"modelSteering": true
31+
}
32+
}
33+
```
34+
35+
## Using model steering
36+
37+
When model steering is enabled, Gemini CLI treats any text you type while the
38+
agent is working as a steering hint.
39+
40+
1. Start a task (for example, "Refactor the database service").
41+
2. While the agent is working (the spinner is visible), type your feedback in
42+
the input box.
43+
3. Press **Enter**.
44+
45+
Gemini CLI acknowledges your hint with a brief message and injects it directly
46+
into the model's context for the very next turn. The model then re-evaluates its
47+
current plan and adjusts its actions accordingly.
48+
49+
### Common use cases
50+
51+
You can use steering hints to guide the model in several ways:
52+
53+
- **Correcting a path:** "Actually, the utilities are in `src/common/utils`."
54+
- **Skipping a step:** "Skip the unit tests for now and just focus on the
55+
implementation."
56+
- **Adding context:** "The `User` type is defined in `packages/core/types.ts`."
57+
- **Redirecting the effort:** "Stop searching the codebase and start drafting
58+
the plan now."
59+
- **Handling ambiguity:** "Use the existing `Logger` class instead of creating a
60+
new one."
61+
62+
## How it works
63+
64+
When you submit a steering hint, Gemini CLI performs the following actions:
65+
66+
1. **Immediate acknowledgment:** It uses a small, fast model to generate a
67+
one-sentence acknowledgment so you know your hint was received.
68+
2. **Context injection:** It prepends an internal instruction to your hint that
69+
tells the main agent to:
70+
- Re-evaluate the active plan.
71+
- Classify the update (for example, as a new task or extra context).
72+
- Apply minimal-diff changes to affected tasks.
73+
3. **Real-time update:** The hint is delivered to the agent at the beginning of
74+
its next turn, ensuring the most immediate course correction possible.
75+
76+
## Next steps
77+
78+
- Tackle complex tasks with [Plan Mode](./plan-mode.md).
79+
- Build custom [Agent Skills](./skills.md).
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Use Plan Mode with model steering for complex tasks
2+
3+
Architecting a complex solution requires precision. By combining Plan Mode's
4+
structured environment with model steering's real-time feedback, you can guide
5+
Gemini CLI through the research and design phases to ensure the final
6+
implementation plan is exactly what you need.
7+
8+
> **Note:** This is a preview feature under active development. Preview features
9+
> may only be available in the **Preview** channel or may need to be enabled
10+
> under `/settings`.
11+
12+
## Prerequisites
13+
14+
- Gemini CLI installed and authenticated.
15+
- [Plan Mode](../plan-mode.md) enabled in your settings.
16+
- [Model steering](../model-steering.md) enabled in your settings.
17+
18+
## Why combine Plan Mode and model steering?
19+
20+
[Plan Mode](../plan-mode.md) typically follows a linear path: research, propose,
21+
and draft. Adding model steering lets you:
22+
23+
1. **Direct the research:** Correct the agent if it's looking in the wrong
24+
directory or missing a key dependency.
25+
2. **Iterate mid-draft:** Suggest a different architectural pattern while the
26+
agent is still writing the plan.
27+
3. **Speed up the loop:** Avoid waiting for a full research turn to finish
28+
before providing critical context.
29+
30+
## Step 1: Start a complex task
31+
32+
Enter Plan Mode and start a task that requires research.
33+
34+
**Prompt:** `/plan I want to implement a new notification service using Redis.`
35+
36+
Gemini CLI enters Plan Mode and starts researching your existing codebase to
37+
identify where the new service should live.
38+
39+
## Step 2: Steer the research phase
40+
41+
As you see the agent calling tools like `list_directory` or `grep_search`, you
42+
might realize it's missing the relevant context.
43+
44+
**Action:** While the spinner is active, type your hint:
45+
`"Don't forget to check packages/common/queues for the existing Redis config."`
46+
47+
**Result:** Gemini CLI acknowledges your hint and immediately incorporates it
48+
into its research. You'll see it start exploring the directory you suggested in
49+
its very next turn.
50+
51+
## Step 3: Refine the design mid-turn
52+
53+
After research, the agent starts drafting the implementation plan. If you notice
54+
it's proposing a design that doesn't align with your goals, steer it.
55+
56+
**Action:** Type:
57+
`"Actually, let's use a Publisher/Subscriber pattern instead of a simple queue for this service."`
58+
59+
**Result:** The agent stops drafting the current version of the plan,
60+
re-evaluates the design based on your feedback, and starts a new draft that uses
61+
the Pub/Sub pattern.
62+
63+
## Step 4: Approve and implement
64+
65+
Once the agent has used your hints to craft the perfect plan, review the final
66+
`.md` file.
67+
68+
**Action:** Type: `"Looks perfect. Let's start the implementation."`
69+
70+
Gemini CLI exits Plan Mode and transitions to the implementation phase. Because
71+
the plan was refined in real-time with your feedback, the agent can now execute
72+
each step with higher confidence and fewer errors.
73+
74+
## Tips for effective steering
75+
76+
- **Be specific:** Instead of "do it differently," try "use the existing
77+
`Logger` class in `src/utils`."
78+
- **Steer early:** Providing feedback during the research phase is more
79+
efficient than waiting for the final plan to be drafted.
80+
- **Use for context:** Steering is a great way to provide knowledge that might
81+
not be obvious from reading the code (e.g., "We are planning to deprecate this
82+
module next month").
83+
84+
## Next steps
85+
86+
- Explore [Agent Skills](../skills.md) to add specialized expertise to your
87+
planning turns.
88+
- See the [Model steering reference](../model-steering.md) for technical
89+
details.

docs/sidebar.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@
4747
"label": "Plan tasks with todos",
4848
"slug": "docs/cli/tutorials/task-planning"
4949
},
50+
{
51+
"label": "Use Plan Mode with model steering",
52+
"badge": "🔬",
53+
"slug": "docs/cli/tutorials/plan-mode-steering"
54+
},
5055
{
5156
"label": "Web search and fetch",
5257
"slug": "docs/cli/tutorials/web-tools"
@@ -106,6 +111,11 @@
106111
{ "label": "MCP servers", "slug": "docs/tools/mcp-server" },
107112
{ "label": "Model routing", "slug": "docs/cli/model-routing" },
108113
{ "label": "Model selection", "slug": "docs/cli/model" },
114+
{
115+
"label": "Model steering",
116+
"badge": "🔬",
117+
"slug": "docs/cli/model-steering"
118+
},
109119
{
110120
"label": "Notifications",
111121
"badge": "🔬",

0 commit comments

Comments
 (0)