Documentation

Complete guide to using OctBot - your personal AI assistant with memory.

🚀 Quick Start

1. WebChat

Visit /chat and start chatting immediately. You get 100 free credits.

2. Telegram Bot

Find @your_bot_name on Telegram and send:

/start

📝 Notes & Memory

Save Notes (API)

POST /api/notes
{
  "content": "I love coffee"
}

Get Notes

GET /api/notes

AI automatically references your notes when you chat. This creates "long-term memory".

⏰ Reminders

Create Reminder (API)

POST /api/reminders
{
  "content": "Team meeting",
  "remind_at": "2026-01-30 14:00"
}

Get Reminders

GET /api/reminders

Format: YYYY-MM-DD HH:MM (UTC time)

You'll receive a Telegram notification at the specified time.

🎨 Personalization

Telegram Commands

💰 Pricing

Free Tier

Pay-As-You-Go

Payment (x402 Protocol)

When credits run out, you'll get a 402 response with payment instructions.

Pay with MetaMask on Polygon network. Credits added automatically after transaction confirms.

🔌 API Reference

Chat

POST /api/chat
{
  "message": "Hello"
}

Response:
{
  "reply": "Hi! How can I help?"
}

History

GET /api/history

Response:
{
  "messages": [
    {"role": "user", "content": "Hello", "created_at": 123456},
    {"role": "assistant", "content": "Hi!", "created_at": 123457}
  ]
}

Credits

GET /api/credits

Response:
{
  "credits": 100
}

🔐 Authentication

Anonymous Users

Use X-Session-Id header:

X-Session-Id: your-random-session-id

Telegram Login

Click "Login with Telegram" on /chat to sync data across devices.

JWT token valid for 7 days.

🛠 Self-Hosting

Deploy

git clone https://github.com/2045max/octbot.git
cd octbot
npm install
npm run deploy

Environment Variables

Database Migration

wrangler d1 execute octbot-db --remote --file=schema.sql

📚 Resources