Skip to content

alejandroOPI/clawdia-bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clawdia Bridge

HTTP bridge that connects Clawdia (Vapi voice assistant) to Clawdius (AI assistant running on Clawdis).

How It Works

You (phone call)
    ↓
Clawdia (Vapi voice AI)
    ↓ POST /ask (tool call)
Clawdia Bridge
    ↓ WebSocket to Gateway
Clawdius (processes request)
    ↓ returns response
Clawdia Bridge
    ↓ returns to Vapi
Clawdia
    ↓ speaks response
You

Quick Start

# Clone
git clone https://github.com/alejandroOPI/clawdia-bridge.git
cd clawdia-bridge

# Install dependencies
npm install

# Run
npm start

Environment Variables

Variable Default Description
BRIDGE_PORT 3847 Port to listen on
GATEWAY_URL ws://127.0.0.1:18789 Clawdis Gateway WebSocket URL

API Endpoints

POST /ask

Clawdia calls this endpoint to ask Clawdius a question.

Vapi Tool Call Format:

{
  "message": {
    "toolCalls": [{
      "id": "tool-call-id",
      "function": {
        "name": "ask_clawdius",
        "arguments": "{\"question\": \"What time is it?\"}"
      }
    }]
  }
}

Response:

{
  "results": [{
    "toolCallId": "tool-call-id",
    "result": "It's 6pm Mexico City time."
  }]
}

Direct Call Format (for testing):

{
  "question": "What time is it?"
}

Response:

{
  "answer": "It's 6pm Mexico City time."
}

GET /health

Health check endpoint.

{
  "status": "ok",
  "mode": "gateway-ws"
}

Vapi Configuration

1. Create Assistant "Clawdia"

In the Vapi dashboard, create an assistant with:

  • Name: Clawdia
  • Voice: Female voice (e.g., Lily from Vapi)
  • Model: Claude or GPT
  • System Prompt:
Eres Clawdia, la asistente de voz de Alejandro. Eres amable, directa y eficiente.

REGLAS:
- Hablas español principalmente
- Se breve en tus respuestas - esto es una llamada telefónica
- Si necesitas información (calendario, emails, clima, etc), usa ask_clawdius
- Clawdius es otro asistente que tiene acceso a toda la información de Alejandro

2. Add Tool

Add this tool to the assistant:

{
  "type": "function",
  "function": {
    "name": "ask_clawdius",
    "description": "Pregunta a Clawdius por información o para ejecutar una acción.",
    "parameters": {
      "type": "object",
      "properties": {
        "question": {
          "type": "string",
          "description": "La pregunta o solicitud para Clawdius"
        }
      },
      "required": ["question"]
    }
  },
  "server": {
    "url": "https://your-server.com/ask"
  }
}

3. Assign Phone Number

Assign a Vapi phone number to the Clawdia assistant.

Exposing to Internet

Tailscale Funnel (Recommended)

npm start
tailscale funnel 3847

Your URL: https://your-machine.tailXXXX.ts.net/

ngrok

npm start
ngrok http 3847

Architecture

The bridge connects to the Clawdis Gateway via WebSocket and uses the agent method to process requests. This means:

  1. Questions go through the same pipeline as WhatsApp/Telegram messages
  2. Clawdius has access to all skills (calendar, email, weather, etc.)
  3. Responses are generated by the same AI that handles other channels

Why WebSocket?

  • Direct connection - No polling, no intermediate services
  • Full access - Same capabilities as other messaging channels
  • Fast - Sub-second latency for most responses

Testing

# Health check
curl http://localhost:3847/health

# Direct question
curl -X POST http://localhost:3847/ask \
  -H "Content-Type: application/json" \
  -d '{"question": "What time is it?"}'

License

MIT

About

HTTP bridge between Vapi voice assistant (Claudia) and Clawdis AI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published