Skip to main content
Minimal echo bot that repeats your input.

Code

from bindu.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

uv init
uv add bindu

Run

uv run echo_simple_agent.py

Example API Calls

{
  "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"
}
{
  "jsonrpc": "2.0",
  "method": "tasks/get",
  "params": {
    "taskId": "9f11c870-5616-49ad-b187-d93cbb100003"
  },
  "id": "9f11c870-5616-49ad-b187-d93cbb100004"
}

Frontend Setup

# 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 and try to chat with echo agent