PIRASOFT.ONLINE v1.0 USER: GUESTTIME:
PIRASOFT.ONLINE

PERSONAL ARCHIVE & CREATIVE LOG

02_COMRADEBOT / README.MD

PROJECT DIRECTORY 02 / 04

COMRADEBOT

IRC is a text-based chat protocol and it is still one of my favourite palces of the internet. ComradeBot is my little self-hosted bot on IRC. It is built with Python and uses Ollama to run local LLM's. The bot can be adressed by nickname and then it joins the conversation, with recent channel history to give it some context. It can also do web-search, summary and calculate on request.

PERSONALITY

Its personality lives in a plain text system prompt, so it can be rewritten and reloaded by an authorised administrator without restarting the bot. You can make it any character or personality you want.

HOW IT WORKS

The bot connects to IRC with optional TLS and NickServ identification, then sends conversational requests to an Ollama chat model. The model and generation settings are configurable, so it can run against a local Ollama server or any other endpoint that you control.

SQLite keeps a rolling history of up to 500 messages per network and channel. Normal replies use a smaller, trimmed context window, with limits on previous bot replies to reduce repetition. Generated responses are also checked against recent replies; a near-duplicate gets one retry. Long answers are split into lines suitable for IRC.

BUILT-IN TOOLS

  • Channel summaries: !summary catches you up on recent conversation, with an optional message count.
  • Web search: !search returns results through Tavily when an API key is configured. At the date of building this, Tavily had a generous amount of requests on their free tier.
  • Local utilities: arithmetic and date/time requests are handled directly in Python. The calculator parses expressions using Python's AST.
  • Runtime information: !model, !uptime and !status report the current configuration and process status.

Per-user and per-channel rate limits keep AI requests under control, with optional access lists. Configuration uses environment files, and an included systemd service template makes it possible to run separate instances for different IRC networks.

ComradeBot is free software under the GNU GPL v3 or later. The source, setup instructions and example personality are available on GitHub.

↗ COMRADEBOT ON GITHUB

← ALL PROJECTS

UTF-8 / READ ONLYEOF ▒
Enlarged artwork