A ready-to-run example is available here!Use
ask_oracle when an agent should consult a stronger or more specialized
model for a second opinion without switching its active model.
When to Use It
ask_oracle is useful when an agent is:
- Stuck or uncertain about its next step
- Comparing implementation approaches
- Reviewing a risky or difficult decision
- Asked by the user to get a second opinion
How It Works
When the agent callsask_oracle:
- The tool loads the saved LLM profile named
oracle. - The Oracle receives a dedicated system prompt and a user message containing the agent’s question and optional context.
- The Oracle returns a text recommendation to the original agent.
- The original agent continues the conversation with its existing model.
The tool does not fall back to the agent’s active model. If the
oracle
profile is missing or cannot be loaded, the tool returns an error observation
telling the agent that the Oracle is unavailable.Configure the Oracle Profile
The tool resolves its model by convention from a saved LLM profile namedoracle. There is no dedicated agent setting for selecting another profile.
To enable it:
- Save a usable LLM configuration under the name
oracle. See LLM Profile Store. - Add
AskOracleToolto the agent’s tools:
LocalConversation reads profiles from
~/.openhands/profiles. If you use a custom profile directory, pass the same
directory to both LLMProfileStore and LocalConversation through
profile_store_dir.
Ask Oracle vs. Switch LLM
ask_oracle makes one stateless call to another model and then returns control
to the original agent. It never changes the active conversation model.
Use switch_profile() or the switch_llm tool instead when subsequent agent
turns should run on a different saved profile. See
LLM Profile Store.
Ready-to-run Example
This example is available on GitHub: examples/01_standalone_sdk/58_ask_oracle_tool/main.py
examples/01_standalone_sdk/58_ask_oracle_tool/main.py
The model name should follow the LiteLLM convention:
provider/model_name (e.g., anthropic/claude-sonnet-4-5-20250929, openai/gpt-4o).
The LLM_API_KEY should be the API key for your chosen provider.Next Steps
- LLM Profile Store - Create and manage reusable LLM configurations
- LLM Metrics - Track usage and cost across the primary and Oracle models
- Custom Tools - Build tools with custom behavior

