> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orxhestra.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Human-in-the-Loop

> Let AI agents ask users questions interactively with an ask_human tool pattern. Pause execution, collect input, and resume.

Create an `ask_human` tool that lets the agent ask the user questions interactively:

```python theme={null}
from langchain_core.tools import tool

@tool
def ask_human(question: str) -> str:
    """Ask the human user a question and return their response."""
    print(f"\n  Agent asks: {question}")
    return input("  Your answer: ").strip()

agent = LlmAgent(
    name="Assistant",
    model=model,
    tools=[ask_human, book_meeting, send_email],
    instructions=(
        "When you don't have enough information to complete a task, "
        "use the ask_human tool to ask the user for the missing details."
    ),
)
```

The agent will call `ask_human` whenever it needs clarification, then use the response to proceed.

<Note>
  **Full example** - See `examples/human_in_the_loop.py` for a complete runnable demo.
</Note>
