> ## Documentation Index
> Fetch the complete documentation index at: https://allhandsai-feat-ask-oracle-tool.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Ask Oracle

> Let an agent consult a saved Oracle LLM profile for stateless second-opinion advice.

> A ready-to-run example is available [here](#ready-to-run-example)!

Use `ask_oracle` when the active agent should ask a stronger or more specialized saved LLM profile for a second opinion without switching its own active profile.

## When to Use It

`ask_oracle` is useful when an agent is stuck, comparing approaches, or wants another model to review a risky decision. The Oracle call is stateless from the Oracle's point of view: it receives a dedicated Oracle system prompt plus the agent's question and optional context, returns a text recommendation, and does not take over the conversation.

## Configure the Oracle Profile

First save the LLM you want to use as the Oracle with `LLMProfileStore`. Then set `oracle_llm_profile` on `OpenHandsAgentSettings` to the saved profile name.

```python icon="python" focus={10} wrap theme={null}
from openhands.sdk import LLM, OpenHandsAgentSettings

settings = OpenHandsAgentSettings(
    llm=LLM(model="openai/gpt-5-nano"),
    oracle_llm_profile="oracle",
)
agent = settings.create_agent()
```

When `oracle_llm_profile` is unset, the tool is not added. When it is set, the agent receives an `ask_oracle` tool and can consult that saved profile while keeping its regular LLM unchanged.

## Ready-to-run Example

<Note>
  This example is available on GitHub: [examples/01\_standalone\_sdk/55\_ask\_oracle\_tool/main.py](https://github.com/OpenHands/software-agent-sdk/blob/main/examples/01_standalone_sdk/55_ask_oracle_tool/main.py)
</Note>

```python icon="python" expandable examples/01_standalone_sdk/55_ask_oracle_tool/main.py theme={null}
# content is auto-synced
```
