☕ KOPI Agent Documentation

Singapore Coffee × AI — One command to set up your AI assistant

Introduction

KOPI Agent is a deeply customized AI agent platform based on Hermes Agent, built for Singapore and Southeast Asian users. As simple as ordering coffee at a kopitiam — pick your flavor, one command to install.

☕ Why KOPI? In Singapore, KOPI isn't just coffee — it's a culture. From KOPI O (black coffee) to KOPI Siew Dai (less sugar), each order represents a different strength and sweetness. KOPI Agent works the same way: pick the version that suits you.

Product Line

VersionSingapore KopiDescriptionChatVoiceVideoImageReasoning
KOPI O ClassicKopi O (黑咖啡)Classic original, full-featured
KOPI Siew Dai Less SugarKopi Siew Dai (少糖)Lightweight, same power, cleaner config
KOPI O Flash FastKopi O Peng (冰咖啡)Fast response, quick and crisp
KOPI Gau StrongKopi Gau (厚咖)Strong brew, enhanced reasoning
☕ Singapore Kopi Culture In Singapore's kopitiams (coffee shops), ordering kopi is an art. O means black (Hokkien), Siew Dai means less sugar, Gau means thick/strong, Peng means iced, Gah Dai means extra sweet, Kosong means no sugar, C means with evaporated milk, and Po means diluted/light. KOPI Agent follows the same philosophy — pick your strength and sweetness.

Installation

KOPI O (Classic)

curl -fsSL https://kopiaiagent.com/install.sh | bash

KOPI Siew Dai (Less Sugar)

curl -fsSL https://kopiaiagent.com/install-siew-dai.sh | bash
💡 Installation Process The script automatically handles: OS detection → dependency install → Python check → clone code → create venv → install deps → provision API Key → generate config → pre-install 100+ skills. The last step configures messaging platforms (Telegram / WeChat).

Provide API Key Manually

curl -fsSL https://kopiaiagent.com/install.sh | KOPI_API_KEY=kp-xxx bash

System Requirements

macOS Installation

Full support for Mac — no sudo required, no systemd needed.

curl -fsSL https://kopiaiagent.com/install-siew-dai.sh -o install-siew-dai.sh
bash install-siew-dai.sh
🍎 macOS Notes
  • No sudo required — installs to ~/.kopi/
  • CLI command kopi auto-linked to /usr/local/bin/kopi — works immediately
  • Gateway uses launchd instead of systemd
  • Requires Homebrew for dependencies (auto-detected)
  • Supports Apple Silicon (M1/M2/M3/M4) and Intel Macs

Quick Start

Interactive Chat

kopi

Chat with AI directly in your terminal. Supports tool calls, code execution, file operations, and more.

One-Shot Query

kopi "Write a Python script to batch rename files"

Switch Models

/model kopi-gau       # Switch to strong reasoning version
/model kopi-o-flash   # Switch to fast version
/model kopi-o         # Switch back to classic

CLI Commands

All commands are run from the terminal as kopi <command>. Use kopi --help for full options.

🚀 Core

CommandDescription
kopiStart interactive chat (default)
kopi chatSend a message directly
kopi tuiTerminal UI mode (React-based)
kopi versionShow version info
kopi updateUpdate to latest version
kopi uninstallUninstall KOPI Agent

🔧 Diagnostics & Configuration

CommandDescription
kopi doctorCheck configuration and dependencies
kopi doctor --fixDiagnose and auto-repair issues
kopi configManage configuration (show, set, edit)
kopi setupInitial setup wizard
kopi statusShow system status
kopi status --deepDeep diagnostic across all components
kopi logsView logs (--follow, --level, --session)
kopi debugUpload debug report and get shareable links

🌐 Gateway & Platforms

CommandDescription
kopi gateway startStart messaging gateway (Telegram/WeChat)
kopi gateway stopStop messaging gateway
kopi gateway setupConfigure messaging platforms
kopi whatsappWhatsApp configuration
kopi slackSlack configuration
kopi webhookWebhook management

🧩 Skills & Tools

CommandDescription
kopi skills listList installed skills
kopi skills install <name>Install a skill
kopi skills search <query>Search available skills
kopi toolsManage tools (list/enable/disable)
kopi pluginsList plugins and their status
kopi mcpManage MCP servers
kopi kanbanMulti-agent collaboration board
kopi hooksManage hooks
kopi browserConnect to live Chrome via CDP

🧠 Session & Memory

CommandDescription
kopi sessionsBrowse and resume previous sessions
kopi memoryManage persistent memory
kopi cronManage scheduled tasks
kopi backupBackup management

🔐 Auth & Model

CommandDescription
kopi authAuthentication management
kopi loginLogin to service
kopi logoutLogout
kopi modelSwitch model
kopi profileManage configuration profiles

📊 Other

CommandDescription
kopi acpACP adapter (VS Code / Zed integration)
kopi computer-useComputer use control
kopi dashboardOpen dashboard
kopi insightsUsage analytics
kopi completionShell auto-completion setup

In-Chat Commands

Slash commands available during a conversation (type /help for full list):

💬 Session Management

CommandDescription
/newStart a new session
/clearClear screen and start fresh
/historyShow conversation history
/saveSave current conversation
/retryRetry the last message
/undoRemove last user/assistant exchange
/branchBranch session (explore a different path)
/compressManually compress conversation context
/rollbackList or restore filesystem checkpoints
/snapshotCreate or restore state snapshots
/resumeResume a named session
/sessionsBrowse and resume sessions

⚙️ Configuration

CommandDescription
/model <name>Switch model (e.g. /model kopi-gau)
/personalitySet a predefined personality
/yoloToggle YOLO mode (skip approvals)
/reasoningManage reasoning effort and display
/fastToggle fast/priority processing mode
/voiceToggle voice mode
/skinChange display skin/theme
/verboseCycle tool progress display
/footerToggle metadata footer on replies

🧰 Tools & Skills

CommandDescription
/toolsManage tools (list/enable/disable)
/toolsetsList available toolsets
/skillsSearch, install, or inspect skills
/cronManage scheduled tasks
/kanbanMulti-profile collaboration board
/pluginsList plugins and their status
/browserConnect browser tools to Chrome

📋 Control & Info

CommandDescription
/stopKill all running background processes
/approveApprove a pending dangerous command
/denyDeny a pending dangerous command
/background <prompt>Run a prompt in the background
/queue <prompt>Queue a prompt for next turn
/goalSet a standing goal across turns
/helpShow all available commands
/commandsBrowse all commands and skills
/usageShow token usage and rate limits
/insightsShow usage analytics
/statusShow session info
/copyCopy last response to clipboard
/imageAttach a local image file
/updateUpdate KOPI Agent
/debugUpload debug report
/restartGracefully restart the gateway

Gateway (Messaging Gateway)

KOPI Agent can interact with you via Telegram and WeChat — use AI like chatting with a friend.

Telegram Setup

  1. Search for @BotFather
  2. Send /newbot to create a Bot
  3. Copy the Token you receive
  4. Run kopi gateway setup and enter the Token

systemd Service

systemctl start kopi-gateway     # Start
systemctl stop kopi-gateway      # Stop
systemctl status kopi-gateway    # Status
journalctl -u kopi-gateway -f    # Logs

Models

All models are proxied through KOPI Proxy — no need to bring your own API Key. Use /model <name> to switch in chat.

Model NameTypeDescription
kopi-oFullDefault — strongest overall, voice + video capable
kopi-o-flashFastQuick response, lightweight tasks
kopi-siew-daiFullSiew Dai default — same power, cleaner config
kopi-siew-dai-flashFastSiew Dai fast version
kopi-gauReasoningStrong brew — enhanced reasoning and analysis

Skills

Automatically installs 100+ skills during setup, covering:

CategorySkillsExamples
Core Dev15plan, debugging, TDD, code-review
GitHub6PR workflow, issues, repo management
Research6arXiv, blog monitoring, Jupyter
Productivity8Google Workspace, Notion, PowerPoint
Media5YouTube, Twitter, Spotify
Creative8Architecture diagrams, Comics, Infographics, Pixel art
DevOps5Docker, Kanban, CLI
Other50+Email, Gaming, Smart home, Red team testing

🔌 MCP — Model Context Protocol

What is MCP?

MCP (Model Context Protocol) is a universal standard for connecting AI models to external tools — like a USB port for the AI world.

Before MCP, every AI-tool integration required custom development. With MCP, any tool that provides an MCP Server can be plugged in instantly.

What Can MCP Do?

MCP transforms your AI from a "chat bot" into a digital worker that connects to real systems:

MCP ServerWhat the AI Can Do
🕐 TimeQuery time, timezone conversion
📁 FilesystemRead/write files in designated folders
🐙 GitHubBrowse repos, manage Issues & PRs, search code
🗄️ DatabaseQuery SQLite, PostgreSQL, and other databases
🌐 Web / APIFetch web pages, call external APIs
💼 Business SystemsConnect CRM, order management, inventory, finance
💬 MessagingIntegrate Telegram, WhatsApp, Email

Native MCP in KOPI Agent

KOPI Agent has a built-in MCP client. No plugin development needed — just configure which MCP Servers to connect in your config file:

# ~/.kopi/config.yaml
mcp_servers:
  time:
    command: "uvx"
    args: ["mcp-server-time"]
  filesystem:
    command: "uvx"
    args: ["mcp-server-filesystem", "/path/to/folder"]

After configuration, when you ask "What time is it in Singapore?", the agent automatically calls the MCP time tool — no guessing, real data.

How It Works

You: "What time is it in Singapore?"
  ↓
KOPI Agent detects the question needs real-time data
  ↓
Calls MCP Server (time tool)
  ↓
Gets accurate answer from the time server
  ↓
Responds: "It's 3:45 PM SGT (UTC+8)"

The Bottom Line

💡 One sentence: MCP lets AI Agent connect to real business systems — files, databases, APIs, messaging — turning a chatbot into a capable digital employee.

📋 Use Cases

Case 1: Customer Service Automation

A retail company uses KOPI Agent to handle customer inquiries via WhatsApp. The agent connects to their order database via MCP, so when a customer asks "Where is my order #1234?", it queries the database directly and responds with real tracking info — no human needed.

Case 2: Developer Productivity

A software team connects KOPI Agent to their GitHub repos via MCP. Developers can ask "What PRs are open?" or "Summarize the latest issues" directly in Telegram. The agent reads GitHub in real-time and provides summaries.

Case 3: Business Intelligence

A SME owner connects their sales database via MCP. Every morning, they ask KOPI Agent "What were yesterday's sales?" and get instant reports — no need to log into dashboards or write SQL queries.

Case 4: Document Management

A law firm uses MCP to connect their document folder. Lawyers can ask "Find all contracts mentioning Company X" and the agent searches through files instantly, returning relevant documents with summaries.

Case 5: Multi-Platform Monitoring

A media company connects Telegram, WhatsApp, and Email via MCP. Their KOPI Agent monitors all channels and can respond, forward messages, or alert the team when urgent matters arise.

Case 6: YouTube Subtitle Archive Live

A content creator built a Subtitle Archive (字幕档案馆) powered by KOPI Agent + MCP. The system extracts YouTube video subtitles via MCP SSE Bridge, generates AI-powered content summaries, and presents them in a searchable, beautifully formatted web interface. Features include one-click subtitle extraction, automatic topic tagging, and visual content cards — all orchestrated by KOPI Agent behind the scenes.

🔗 View Live Demo →

Case 7: Quantitative Strategy Rankings Pro

A quant trading team uses KOPI Agent to automate backtesting and strategy ranking. The agent runs 320+ backtests across 16 assets and 8 strategies on 15-minute timeframes, then generates interactive ranking dashboards with Chart.js visualizations. Scoring factors include total return, Sharpe ratio, max drawdown, and win rate — all computed and published by KOPI Agent without manual intervention.

🔗 View Live Rankings →

Case 8: AI-Generated Knowledge Comics Creative

KOPI Agent generates full manga-style knowledge comics from a single topic prompt. Using the baoyu-comic skill, it creates dramatic storylines, AI-generated artwork, and multi-panel comic layouts — turning complex topics like Singapore's bird conservation crisis into engaging visual narratives. One command, complete comic book.

🔗 Read the Comic →

Case 9: Intelligent Trading Dashboard Pro

AMT Capital uses KOPI Agent to power a real-time quantitative trading dashboard. Connected to Alpaca Markets API, the system tracks portfolio value, P&L, buying power, and position details — all updated every 30 seconds. Features include a Trading Masters strategy library, Vanderbilt AI portfolio analysis, interactive equity curve charts, and one-click investment report generation. KOPI Agent orchestrates market data fetching, risk computation, and strategy execution in the background.

🔗 View Live Dashboard →

Getting Started with MCP

Ready to connect your tools? Run kopi mcp to manage MCP servers, or check the Configuration section for setup details.

Configuration

Config file is located at ~/.kopi/config.yaml:

# Model Configuration
model:
  default: kopi-o              # Default model
  provider: custom
  base_url: https://kopiaiagent.com/kp/v1
  api_key: kp-xxxxxxxx         # Auto-provisioned during install
  context_length: 256000

# Agent Configuration
agent:
  max_turns: 90

# Terminal Configuration
terminal:
  timeout: 180

# Display Configuration
display:
  skin: default
  show_cost: true

# Memory Configuration
memory:
  memory_enabled: true
  user_profile_enabled: true

Troubleshooting

Installation Failed

⚠️ Common Issues
  • dpkg interrupted → Run sudo dpkg --configure -a
  • Python version too old → Script will auto-install 3.11+
  • Network issues → Ensure you can reach kopiaiagent.com

API Issues

⚠️ 401 Invalid API Key
  • Check ~/.kopi/config.yaml api_key in config is correct
  • Confirm base_url is https://kopiaiagent.com/kp/v1
  • Run kopi doctor to diagnose

Gateway Issues

⚠️ Telegram Bot Not Responding
  • Check systemctl status kopi-gateway
  • Check logs journalctl -u kopi-gateway -f
  • Confirm Bot Token is correct
✅ Get Help GitHub Issues: github.com/LINYIQ66/kopi-agent

Billing & Finance

KOPI includes a built-in billing engine that tracks token usage, calculates costs, generates invoices, and manages payments. All financial data is stored separately from the proxy database.

Architecture

request_logs (raw API calls, read-only)
    ↓ daily aggregation (4:00 AM)
daily_usage (per client × model × day)
    ↓ monthly invoice generation
invoices (draft → finalized, immutable)
    ↓ payment recording
payment_ledger (bank-grade audit trail)

Pricing

ModelInputOutput
KOPI O$0.005/1K$0.015/1K
KOPI O Flash$0.0005/1K$0.0015/1K
KOPI Siew Dai$0.005/1K$0.015/1K
KOPI Gau$0.00075/1K$0.003/1K

Finance Dashboard

Access the admin billing dashboard at https://readinghero.xyz/finance/. Features:

Reconciliation

The billing engine includes a built-in reconciliation system that verifies request_logs matches daily_usage aggregates. Run manually:

python3 /opt/kopi-finance/billing_engine.py reconcile 2026-05-15
# → {"status": "PASS", "discrepancies": 0}

Topup System

When a client approaches or exceeds their daily token limit, the system can generate a payment link for instant topup. After payment, the client's limit is automatically increased.

Topup Packages

PackageTokensPrice
Starter10M$5.00
Growth50M$18.00
Scale200M$60.00
Enterprise1B$250.00

Flow

Client hits limit (100% usage)
    ↓
System generates payment link
    ↓
Client pays (Stripe / manual)
    ↓
Limit auto-upgraded (old + new tokens)
    ↓
Client resumes usage

API Endpoints

MethodPathDescription
GET/finance/api/check-limitsCheck all client limits
POST/finance/api/topup/requestGenerate payment link
POST/finance/api/topup/confirmConfirm payment & upgrade
GET/finance/api/topup/historyTopup history
POST/finance/api/set-limitManually set limit
POST/finance/webhook/stripeStripe webhook (ready)

Client Statements

KOPI generates bank-grade client statements with full audit trail. Every financial transaction is recorded with before/after balance states.

Statement Contents

Ledger Integrity

Every entry in the payment ledger includes:

Charges do not affect the account balance — only actual payments/refunds do.

Invoice Lifecycle

draft → finalized → sent → paid
                      ↘ void (if cancelled)

Once an invoice is finalized, it cannot be edited. Adjustments are made via new ledger entries.

API Endpoints

MethodPathDescription
GET/finance/api/clientsAll clients with usage & revenue
GET/finance/api/invoicesInvoice list
GET/finance/api/overviewCompany-level totals
POST/finance/api/simulate-paymentTest payment (dev only)

Mockup Previews

Three statement UI styles are available for review: