> ## 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.8 Premium Research Assistant

> Simple research assistant that charges for usage

Simple research assistant that charges for usage.

## Code

```python theme={null}
"""Research Assistant Agent behind paywall

A Bindu agent that finds and summarizes information.
Uses DuckDuckGo for web search capabilities.

Features:
- Web search integration
- Information summarization
- Research assistance

Usage:
    python agno_paywall_example.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()

agent = Agent(
    instructions="You are a research assistant that finds and summarizes information.",
    model=OpenRouter(
        id="openai/gpt-4o-mini",
        api_key=os.getenv("OPENROUTER_API_KEY")
    ),
    tools=[DuckDuckGoTools()],
)

config = {
    "author": "your.email@example.com",
    "name": "research_agent",
    "description": "A research assistant agent",
    "deployment": {
        "url": "http://localhost:3773",
        "expose": True,
        "cors_origins": ["http://localhost:5173"]
    },
    "execution_cost": {
        "amount": "$0.0001",
        "token": "USDC",
        "network": "base-sepolia",
        "pay_to_address": "0x2654bb8B272f117c514aAc3d4032B1795366BA5d",
        "protected_methods": [
            "message/send"
        ]
    }
}

def handler(messages: list[dict[str, str]]):
    result = agent.run(input=messages)
    return result

if __name__ == "__main__":
    os.environ["AUTH_ENABLED"] = "false"
    bindufy(config, handler)
```

## How It Works

**Instructions**

* Defines agent as research assistant
* Finds and summarizes information from web
* Provides comprehensive research results
* Maintains informative and helpful tone

**Tools**

* `DuckDuckGoTools()`: Search web for current information
* Web search integration for real-time data
* Information gathering and summarization

**Model**

* `gpt-4o-mini`: Cost-effective model for research tasks
* Via OpenRouter API integration
* Configurable through environment variables

**Payment**

* `execution_cost`: \$0.0001 USDC per request
* `base-sepolia` network for transactions
* Protected `message/send` method requires payment

## 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 premium-research-assistant.py
```

**Examples:**

* "Research the latest developments in quantum computing"
* "Find information about renewable energy trends in 2024"
* "What are the current market trends in artificial intelligence?"

## 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": "Research the latest developments in quantum computing"
            }
          ]
        },
        "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 premium research assistant
