WingFy RAG PHP — Natural Chat

Status: OK

Endpoint

Quick Start

  1. Run sql/schema.sql in MySQL.
  2. Edit config.php (DB, OpenAI key, optional Bearer).
  3. Put your EN knowledge files in knowledge/ and run php ingest.php.
  4. ManyChat → External Request → URL: https://YOUR_DOMAIN/webhook.php, Method: POST
  5. Headers: Content-Type: application/json + Authorization: Bearer <>
  6. Body:
    {
      "text": "{{last_text_input}}",
      "user_id": "{{user.id}}",
      "name": "{{user.name}}",
      "channel": "{{channel.type}}"
    }
  7. Map response field reply → Custom Field (e.g., ai_reply) and send it in a Message.