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

# 1.10 Motivational Agent

> A Bindu agent that provides motivation, encouragement, and positive inspiration

A Bindu agent that provides motivation, encouragement, and positive inspiration.

## Code

Create `motivational-agent.py` with the code below, or save it directly from your editor.

```python theme={null}
"""Motivational Coach Agent

A Bindu agent that provides motivation, encouragement, and positive inspiration.
Helps users stay motivated, overcome challenges, and achieve their goals.

Features:
- Daily motivation and positive affirmations
- Goal setting and achievement strategies
- Overcoming procrastination and self-doubt
- Web search for inspirational content and success stories
- OpenRouter integration with gpt-oss-120b

Usage:
    python motivational_agent.py

Environment:
    Requires OPENROUTER_API_KEY in .env file
"""

import os
from bindu.penguin.bindufy import bindufy
from agno.agent import Agent
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.models.openrouter import OpenRouter

from dotenv import load_dotenv

load_dotenv()

# Define your agent
agent = Agent(
    instructions=(
        "You are a motivational coach and personal development guide. "
        "Your job is to inspire, encourage, and motivate users to achieve their goals. "
        "Provide positive affirmations, practical advice for overcoming challenges, "
        "strategies for success, and help users build confidence and resilience. "
        "Be empathetic, supportive, and uplifting while maintaining a professional tone. "
        "Draw inspiration from successful people, psychology, and proven motivational techniques. "
        "When users face specific challenges, provide actionable steps and encouragement."
    ),
    model=OpenRouter(
        id="openai/gpt-oss-120b",
        api_key=os.getenv("OPENROUTER_API_KEY")
    ),
    tools=[DuckDuckGoTools()],  # optional: for inspirational quotes and success stories
)


# Configuration
# Note: Infrastructure configs (storage, scheduler, sentry, API keys) are now
# automatically loaded from environment variables. See .env.example for details.
config = {
    "author": "jerphinasmi24@gmail.com",
    "name": "motivational_agent",
    "description": "A motivational coach agent for personal development and goal achievement",
    "deployment": {
            "url": "http://localhost:3773",
            "expose": True,
            "cors_origins": ["http://localhost:5173"]
        },
}


# Handler function
def handler(messages: list[dict[str, str]]):
    """Process messages and return agent response.

    Args:
        messages: List of message dictionaries containing conversation history

    Returns:
        Agent response result
    """
    result = agent.run(input=messages)
    return result


# Bindu-fy it
bindufy(config, handler)
```

## How It Works

**Motivational Coaching**

* Provides personalized encouragement and positive affirmations
* Offers practical strategies for overcoming procrastination
* Helps users build confidence and resilience
* Maintains empathetic yet professional tone

**Web Search Integration**

* `DuckDuckGoTools()`: Finds inspirational quotes and success stories
* Draws from real-world examples and proven motivational techniques
* Provides context-aware motivation based on user needs

**Agent Instructions**

* Comprehensive persona as motivational coach
* Focus on actionable advice and encouragement
* Psychology-based motivation techniques
* Support for goal achievement and personal development

## Dependencies

```bash theme={null}
uv init
uv add bindu agno python-dotenv
```

## Environment Setup

Create `.env` file:

```bash theme={null}
OPENROUTER_API_KEY=your_openrouter_api_key_here
```

## Run

```bash theme={null}
uv run motivational-agent.py
```

**Examples:**

* "I'm feeling unmotivated to work on my project"
* "Help me overcome my fear of public speaking"
* "Give me some encouragement for my job interview tomorrow"
* "I'm struggling with procrastination, what should I do?"

## Example API Calls

<AccordionGroup>
  <Accordion title="Message Send Request">
    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "method": "message/send",
      "params": {
        "message": {
          "role": "user",
          "kind": "message",
          "messageId": "9f11c870-5616-49ad-b187-d93cbb100001",
          "contextId": "9f11c870-5616-49ad-b187-d93cbb100002",
          "taskId": "9f11c870-5616-49ad-b187-d93cbb100003",
          "parts": [
            {
              "kind": "text",
              "text": "I'm feeling unmotivated to work on my project"
            }
          ]
        },
        "configuration": {
          "acceptedOutputModes": ["application/json"]
        }
      },
      "id": "9f11c870-5616-49ad-b187-d93cbb100003"
    }
    ```
  </Accordion>

  <Accordion title="Task get Request">
    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "method": "tasks/get",
      "params": {
        "taskId": "9f11c870-5616-49ad-b187-d93cbb100003"
      },
      "id": "9f11c870-5616-49ad-b187-d93cbb100004"
    }
    ```
  </Accordion>
</AccordionGroup>

## Frontend Setup

```bash theme={null}
# Clone the Bindu repository
git clone https://github.com/GetBindu/Bindu

# Navigate to frontend directory
cd frontend

# Install dependencies
npm install

# Start frontend development server
npm run dev
```

Open [http://localhost:5173](http://localhost:5173) and try to chat with the motivational agent
