Running an AI Agent Inside Telegram, Discord and Slack With CowAgent
Set up CowAgent, a free open-source agent, in Telegram, Discord or Slack: desktop install, model keys, bot tokens, memory, skills and what it costs to run.
This article is published in English.
Chat apps are where a lot of people already live. Telegram, Discord and Slack carry the messages, the conversations and more and more of the actual work. So why should an AI assistant demand yet another browser tab, another application and a fresh conversation every time you need it?
A more natural arrangement puts the agent where the work already happens. Picture a persistent assistant inside your existing chat platforms that takes messages, keeps context, remembers earlier exchanges, plans tasks and gets things done, all without a separate interface.
CowAgent is one open-source project that does this. It's free, runs on your own computer or a small server, and plugs into Telegram, Discord or Slack. After setup it's an always-on assistant reachable through the same channels you use every day. Setup is simple, but a fair amount happens behind the scenes. Knowing how the agent talks to those platforms, manages conversations, keeps memory and turns messages into actions makes it much easier to customise.
Why run an agent yourself instead of using a hosted chatbot
A chatbot in a browser tab is fine for the odd question. It stops being enough when the goal moves from asking things to getting continuing work done. A tab doesn't recall last week unless the product stores history somewhere. It isn't sitting in a group chat waiting to be mentioned. It can't be scheduled to post a morning summary or be triggered by a teammate's message in the small hours.
An agent that runs continuously on a machine you control, wired straight into a messaging platform, behaves differently. It stays online like a small server or background service. It keeps memory across sessions instead of starting blank each time. You can reach it from your phone through the chat app you already have open, with nothing new to install and no extra login to remember. And since the software is open source, how it stores conversations and makes decisions isn't hidden inside a closed system.
What CowAgent is
The project describes itself as a free, open-source agent that does three things a simple Q&A bot doesn't. It plans tasks and doesn't just reply to one message in isolation. It uses tools, so it can read files, run commands, search the web or call outside services, going beyond generating text. And it remembers earlier conversations, carrying context forward and not treating each message as brand new.
Under those abilities sits a flexible layer for connecting to language models. It isn't tied to one provider. You can point it at Claude, GPT, Gemini, DeepSeek or around a dozen others by supplying an API key for the one you prefer. That matters because model quality, price and availability shift constantly, and a tool locked to one vendor ages badly. Treating the model as a swappable part keeps the agent useful whichever provider happens to lead.
Step one: download the desktop client
The quickest start is the desktop client for macOS and Windows. Unlike a pure command-line install, the desktop build bundles the backend inside the application, so there's no separate server process to configure before anything works. Downloading and installing it is the whole first step, the same as any desktop app.
Download link: https://cowagent.ai/download/
On Windows that normally means running an installer. On macOS it usually means dragging the app into the Applications folder or running a signed package.
Step two: getting past macOS Gatekeeper
Mac users should expect a warning on first launch. Gatekeeper, the built-in macOS check, looks for apps signed and notarised by a registered Apple developer. Open-source projects distributed outside the Mac App Store often trip it, because signing and notarisation need an Apple Developer account and extra setup that many community projects haven't done.
The message doesn't mean something is broken or unsafe in itself. It means macOS can't verify the developer through Apple's signing chain. To continue, right-click or control-click the icon, choose Open from the menu rather than double-clicking, and confirm. That lets this one app through while leaving the rest of the system's security settings alone. Anyone cautious can read the project's source before installing, since the whole agent is public.
Step three: connect a language model provider
Once the app is open, connect at least one model provider with an API key. The key is what supplies the intelligence: planning, reasoning and writing replies come from whichever model it points at, while CowAgent handles memory, tool use, task planning and the links to chat platforms around it.
Supported providers include Claude, GPT, Gemini and DeepSeek, plus roughly ten more. Each needs its own key from that provider's developer console or account dashboard. The routine is similar everywhere even if details differ: create an account, find the API or developer keys section, generate a key and store it somewhere safe, because most providers show the full key only once.
Inside CowAgent the key goes into the model configuration screen, usually under settings or the console. Conceptually an entry looks like the sample below, although the interface is graphical and there's no raw file to edit by hand:
provider: claude
api_key: sk-ant-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Since several providers are supported side by side, you can connect more than one model and pick which handles chat replies, which handles image understanding and which serves other purposes. That's handy for comparing model behaviour directly, or if you already hold credits with more than one provider and don't want them wasted.
Step four: connect a messaging platform
With a model attached, the assistant can already converse, but the real payoff comes from reaching it through a chat app and not a dedicated interface. Telegram, Discord and Slack all follow one pattern, like the model setup: generate an API token on that platform, then paste it into the matching channel configuration inside CowAgent.
- Telegram: create a bot through Telegram's official BotFather assistant, which issues a bot token after a short guided chat inside Telegram.
- Discord: create an application in the Discord developer portal, add a bot to it, copy the bot token and then invite the bot to a server using an invite link with the right permissions.
- Slack: create an app in the Slack API dashboard, enable the bot scopes and event subscriptions you need, install the app into a workspace and copy the resulting bot token.
Once the token is entered and the channel switched on, the agent becomes a member of that platform. Messages sent to it directly, or mentioning it in a group or server, travel to the language model together with whatever memory and context it has gathered, and the reply returns through the same channel. To the people chatting with it, there's no visible difference from talking to a human contact or an ordinary bot, apart from how it answers.
One running instance isn't limited to a single platform. A single agent can serve Telegram, Discord and Slack simultaneously, sharing one memory and one model, so there's nothing to duplicate for each platform.
What happens under the hood
When a message arrives through any channel, the same internal process runs. The channel integration that received it picks up the text, image or voice note. That input goes to the agent's core reasoning, which pulls in relevant memory from earlier conversations, decides whether tools are needed (searching the web, reading a file, running a scheduled task) and drafts a plan for responding. The connected model writes the actual reply based on that plan and context, and the answer is sent back out through the channel where the message began.
That loop is why the agent feels less like a stateless chatbot and more like an ongoing assistant. Raise a topic today and refer back to it next week, and it works like a human assistant who was there for the earlier talk, with no need to repeat every detail.
Adding skills from the Skill Hub
Past basic conversation, the agent becomes far more useful once skills are installed. A skill is a higher-level workflow, as opposed to a raw tool, that bundles the steps needed for something specific, such as using a particular outside service, automating a recurring chore or handling a specialised kind of request.
Skills can be browsed and installed from an open marketplace called the Skill Hub, with no code required. In the interface or through a short command, you search by keyword and install with one action:
/skill search calendar
/skill install calendar-assistant
The marketplace model means capabilities aren't fixed at install time. Skills published by the community, or created through ordinary conversation with the agent itself, can be added at any moment without reinstalling the app. Someone who set it up for casual chat can add a skill weeks later for managing a calendar, summarising documents or talking to a specific API, the way you'd install an app from a store.
Cost and openness
The desktop app, the agent framework and the Skill Hub are all described as free and open source. The only continuing cost is the language model provider you connect, because API access to models like Claude, GPT, Gemini or DeepSeek is usually billed by the provider according to usage and not bundled into the agent software.
That distinction helps when budgeting a personal or small-team setup. There's no subscription or licence fee for the framework, and the model usage, which is the only bill, can often be kept small or even free depending on the provider and the trial credit or free tier it offers right now. Open source also means the full codebase, including how memory is stored, how tools run and how messages are routed between channels and models, can be inspected by anyone who wants to verify what the software does before trusting it with real conversations, files or scheduled tasks.
A realistic first day
Put together, a first session runs like this. Download and install the desktop client, with a short detour through the Gatekeeper prompt on a Mac if needed. Enter an API key from your preferred model provider in the app, which enables real conversation. Generate a bot token for Telegram, Discord or Slack and connect it, which makes the agent reachable from a phone or desktop chat app that was open anyway. Send a first message to the bot to confirm everything is wired correctly. Then install a skill or two from the Skill Hub for what the assistant will mostly do, whether that's scheduling, research, file handling or something more niche.
None of this takes long, and none of it requires programming skills, because both the model connection and the channel connection come down to pasting a key or token into a configuration screen and not editing code.
What you end up with
Putting an AI assistant in the chat app you already use removes a surprising amount of friction compared with leaving it in a separate tab or dashboard. This setup costs nothing for the software, avoids lock-in on the underlying model and needs no deep technical work beyond downloading an app and pasting in a couple of keys.
Once linked to Telegram, Discord or Slack and given at least one model to reason with, you have a persistent assistant that remembers context, plans multi-step tasks and grows more capable as skills are added, all running quietly on hardware that's already on your desk.