Skip to content

Home

OpenFang

Your AI assistant, wherever you chat

License Python 3.13+


OpenFang is a lightweight AI agent gateway inspired by OpenClaw. It connects LLMs to your messaging channels with tools, skills, and persistent memory — all in ~5K lines of Python.

Run it locally. Own your data. Extend it freely.

Quick Start

# Works everywhere. Installs uv if needed. 🐍
curl -fsSL https://raw.githubusercontent.com/aidiss/openfang/main/install.sh | bash

Then just:

openfang chat
# Try without installing (PyPI coming soon)
uvx openfang chat
git clone https://github.com/aidiss/openfang.git
cd openfang && uv sync
uv run openfang chat   # Use uv run in dev mode

The gateway runs at localhost:18789 with a web UI for chat, sessions, and configuration.

What It Does

  • Multi-Channel Inbox


    Connect Telegram, Discord, and more. One assistant, all your chats.

  • Persistent Memory


    Remembers context across conversations. Your assistant learns your preferences.

  • Powerful Tools


    Files, shell, web browsing, cron jobs. The assistant can actually do things.

  • Extensible Skills


    Add capabilities via Markdown files. No code required for new skills.

  • FastAPI Gateway


    REST API + WebSocket events. Build on top of it.

  • Role-Based Permissions


    Control who can use dangerous tools. Admin, developer, or open access.

Channels

Channel Status Notes
Telegram Ready Full support with bot token
Discord Ready Slash commands + DMs
WhatsApp Planned Coming soon
Slack Planned Coming soon
Signal Planned Coming soon

Configuration

Environment variables or .env file:

# Required: LLM provider
OPENAI_API_KEY=sk-...              # Or use Anthropic

# Channels (add tokens to enable)
OPENFANG_TELEGRAM_BOT_TOKEN=...    # From @BotFather
OPENFANG_DISCORD_BOT_TOKEN=...     # From Discord Developer Portal

# Server
OPENFANG_HOST=0.0.0.0
OPENFANG_PORT=18789

Architecture

src/openfang/
├── agents/            # Top-level agent personas (YAML)
├── capabilities/      # Adapter implementations
├── channels/          # Telegram, Discord, ...
├── gateway/           # FastAPI server + web UI
├── messaging/         # Message dispatcher + resolver
├── skills/            # Markdown skill definitions
├── subagents/         # Specialized task delegation
├── protocols.py       # Port interfaces (hexagonal)
├── deps.py            # Dependency injection
├── agent.py           # pydantic-ai agent factory
├── tools.py           # ~40 agent tools
└── chat.py            # Conversation management

Built on:

Why OpenFang?

OpenFang is OpenClaw's little sibling — same spirit, smaller footprint (~5K lines vs 314K). See README for design philosophy and principles.

Next Steps