> ## 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.1 Echo Agent

> Minimal echo bot that repeats your input

Minimal echo bot that repeats your input.

## Code

```python theme={null}
from bindu.penguin.bindufy import bindufy

def handler(messages):
    return [{"role": "assistant", "content": messages[-1]["content"]}]

config = {
    "author": "gaurikasethi88@gmail.com",
    "name": "echo_agent",
    "description": "A basic echo agent for quick testing.",
    "deployment": {
        "url": "http://localhost:3773",
        "expose": True,
        "cors_origins": ["http://localhost:5173"]
    },
}

bindufy(config, handler)
# This will create a bindu agent with name echo_agent and expose it on port 3773

#bindufy(config, handler, launch=True)
# This will create a tunnel to your agent and expose it on port 3773
```

## How It Works

**Handler Function**

* Takes `messages` list as input
* Returns the last user message as assistant response
* `messages[-1]["content"]` gets the most recent message
* We are not calling any llm model here, just returning the last message

**Config**

* `name`: Agent identifier
* `deployment.url`: Local server address
* `deployment.expose`: Makes agent accessible

**Bindufy**

* Wraps your handler with Bindu protocol
* Handles A2A communication

## Dependencies

```bash theme={null}
uv init
uv add bindu
```

## Run

```bash theme={null}
uv run echo_simple_agent.py
```

## 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": "Repeat after me: this is a simple echo test"
            }
          ]
        },
        "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 echo agent
