# Adaptive reasoning agent

> Adaptive reasoning agent - Showcases an agent's ability to **adapt its reasoning behavior** based on
> conversation dynamics.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-05-01T23:10:47.736535+00:00` (UTC).

## Primary page

- [Adaptive reasoning agent](https://docs.datarobot.com/en/docs/api/dev-learning/accelerators/llm-and-genai-apps/adaptive-agent.html): Full documentation for this topic (HTML).

## Related documentation

- [Developer documentation](https://docs.datarobot.com/en/docs/api/index.html): Linked from this page.
- [Developer learning](https://docs.datarobot.com/en/docs/api/dev-learning/index.html): Linked from this page.
- [AI accelerators](https://docs.datarobot.com/en/docs/api/dev-learning/accelerators/index.html): Linked from this page.
- [LLM and GenAI applications](https://docs.datarobot.com/en/docs/api/dev-learning/accelerators/llm-and-genai-apps/index.html): Linked from this page.

## Documentation content

# Adaptive reasoning agent

[Access this AI accelerator on GitHub](https://github.com/datarobot-community/ai-accelerators/tree/main/generative_ai/adaptive-agent)

This accelerator showcases an agent's ability to adapt its reasoning behavior based on conversation dynamics. The agent acts as a customer support representative for the "DataInsight Pro" analytics platform.

In this example, the agent uses:

- GPT-4o for complex reasoning when corrections are detected.
- GPT-4o-mini for fast responses during smooth conversation flow.
- GPT-4o-mini as a reflection model to analyze the last three conversation turns and detect user corrections.

Specifically, the agent dynamically switches between models based on conversation analysis:

| Scenario | Model used | Behavior |
| --- | --- | --- |
| Conversation flowing smoothly | GPT-4o-mini | Fast, direct responses |
| User corrects the agent | GPT-4o | More thorough reasoning |
| User rephrases question | GPT-4o | Agent recognizes confusion |
| Positive feedback received | GPT-4o-mini | Returns to efficient mode |

The following diagram provides an overview that illustrates the agent architecture.

```
┌─────────────────────────────────────────────────────────────┐
│                     Frontend (React)                        │
│  ┌─────────────┐  ┌──────────────────────────────────────┐  │
│  │ Model Mode  │  │      Reflection Log Panel            │  │
│  │  Indicator  │  │  (shows gpt-4o-mini reasoning)       │  │
│  └─────────────┘  └──────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────┘
                              │
┌─────────────────────────────────────────────────────────────┐
│                   Adaptive Agent                            │
│  1. Store conversation history (last 3 turns)               │
│  2. Call reflection model (gpt-4o-mini) before response     │
│  3. Switch model based on correction detection              │
│     - Corrections detected → GPT-4o (thorough)              │
│     - Smooth conversation → GPT-4o-mini (fast)              │
└─────────────────────────────────────────────────────────────┘
```

The following script, with model adaptation noted, is applied in the accelerator:

| Turn | User prompt | Expected behavior | Model |
| --- | --- | --- | --- |
| 1 | "What pricing plans do you offer?" | Lists 3 tiers (Starter, Pro, Enterprise) | GPT-4o-mini |
| 2 | "How do I export data?" | General export explanation | GPT-4o-mini |
| 3 | "No, I meant export to CSV specifically, not PDF" | Correction detected! Detailed CSV instructions | GPT-4o |
| 4 | "Can I schedule automated exports?" | Thorough answer with plan requirements | GPT-4o |
| 5 | "Thanks, that's helpful!" | Positive acknowledgment | GPT-4o-mini |
