hAIry Botter is a lightweight, backend-agnostic AI server designed to decouple the AI logic from the frontend. Inspired by the WhatsApp Python Chatbot, this project aims to be more flexible by offering a simple HTTP API that supports history, context, and external tools.
Whether you are building a CLI, a Telegram bot, or a web interface, you just need to make a simple HTTP call to hAIry Botter to get started.
- 🧠 Gemini Powered: Uses the latest Google Gemini models.
- 🔌 MCP Support: Implements the Model Context Protocol to call external servers/functions (includes example implementation).
- 💾 Smart History: Session-based history storage (
history-geminifolder) with optional auto-summarization to save context window. - 📚 RAG Capable: Built-in Retrieval-Augmented Generation. Drop text documents into the
bot-contextfolder to chat with your data. - 🎭 Custom Personality: Configurable base prompts via
personality.json. - 🖼️ Multi-modal: Native support for Image and PDF inputs.
- 🚀 Ready-to-use Clients: Includes CLI, Telegram, and Facebook Messenger clients.
The easiest way to get up and running is via Docker Compose.
- Copy
.env.exampleto.env. - Set your
GEMINI_API_KEYin the file. - Run the stack:
docker-compose upPrerequisites: Go installed on your machine.
- Set the required environment variable:
export GEMINI_API_KEY="your_api_key_here"
- Run the server:
go run cmd/bot-server/main.go
You can configure the server using Environment Variables.
| Variable | Description | Default | Required |
|---|---|---|---|
GEMINI_API_KEY |
Your Google Gemini API access key. | - | ✅ |
ADDR |
Server listen address. | :8080 |
❌ |
GEMINI_MODEL |
The specific model version to use. | gemini-2.5-flash |
❌ |
MCP_SERVERS |
Comma-separated list of MCP HTTP stream servers (e.g., http://localhost:8081/mcp). |
- | ❌ |
SEARCH_ENABLE |
Allow Google Search (Warning: conflicts with MCP). | false |
❌ |
HISTORY_SUMMARY |
Message count trigger for history summarization (0 to disable). |
20 |
❌ |
LOG_LEVEL |
Logging verbosity (debug, info, warn, error). |
info |
❌ |
Note on MCP: You cannot use the same function name across different MCP servers. Since functions are mapped to clients, duplicate names will override previous ones.
The server exposes a simple HTTP endpoint.
If you don't provide a User ID, the server generates a new session and returns it in a cookie.
curl -v -X POST [http://127.0.0.1:8080/message](http://127.0.0.1:8080/message) \
-d "message=Hi there"To maintain history, pass the sessionID cookie returned from the first call.
curl -v -X POST \
-H "Cookie: sessionID=MGVQOSOZWPMKWAJBQN5KWFR3DF" \
[http://127.0.0.1:8080/message](http://127.0.0.1:8080/message) \
-d "message=Hi again"If your frontend manages users, pass the ID via header.
curl -v -X POST \
-H "X-User-ID: unique-user-123" \
[http://127.0.0.1:8080/message](http://127.0.0.1:8080/message) \
-d "message=Hi there"Send files using multipart/form-data.
curl -v -X POST \
-F "message=What is on this image?" \
-F "payload=@local_image.jpg" \
[http://127.0.0.1:8080/message](http://127.0.0.1:8080/message)This repo comes with ready-made clients to demonstrate capabilities.
An interactive terminal chat.
# Optional: Set SERVER_URL if not using localhost:8080
go run cmd/cli-client/main.goRequires a Bot Token from BotFather.
export BOT_TOKEN="your_telegram_token"
# Optional: restrict access to specific usernames
export USERNAME_LIMITS="user1,user2"
go run cmd/client-telegram/main.goTip: Captions on images are treated as the prompt.
Requires a configured Facebook App/Page.
Env Variables:
ACCESS_TOKEN,VERIFY_TOKEN,APP_SECRET(Required)ADDR(Default::8082)AI_SERVICE(Default:http://127.0.0.1:8080)
go run cmd/client-messenger/main.goTip: Use ngrok http 8082 to expose this to Facebook for local testing.
Security Warning: Please do not run this server on the public internet without additional authentication. It is intended as an internal helper tool. Public exposure could lead to excessive API usage and costs.
💡 Pro Tip: If you add a Shell MCP server, you can add "OpenClaw skills" into the RAG processing folder. These "skills" are text files that become part of the prompt, allowing the AI to execute shell-based function calls!
