A self-hosted AI agent team is a group of AI bots that you run on hardware you control, such as a laptop, a home server or a VPS, instead of in someone else's cloud. The bots share chats, hand work to each other and can keep going on a schedule while you are away. You hold the data, the logins and the settings.
kwant is an open-source (AGPL-3.0) version of that idea. It ships as one Rust binary called kwnt. This page explains what running a team like that involves, using kwant as the worked example, so you can judge whether it suits you.
What self-hosting gets you, and what it does not
What you get:
- Your data in one place. kwant's web app and its database are built into the binary, and your data lives in one folder (
~/.kwntby default). - Your own accounts. You add the logins you already use (Claude, Codex or Grok CLIs), provider API keys or your own server, and you can add several accounts per engine.
- Source you can read. The code is public on GitHub under the AGPL-3.0, and commercial licenses are available.
- No telemetry. kwant sends nothing to its developers.
What it does not change: a bot that runs on a Claude, Codex or Grok login or an API key still sends its prompts to that provider, because that is where the model runs. To keep a conversation on your own machine, run a model through local Ollama or your own OpenAI-compatible server. kwant can route a message that asks to stay private to Ollama when Ollama is ready. See models and routing.
What you need to run one
Here is what kwant asks for, from its install docs:
- A machine that stays on. A laptop works. If you want routines to run overnight, a small VPS is the better home. Routines run on your own machine or server, so they run while that machine is on.
- Rust and Node.js to build it, then
make buildand./target/release/kwnt serve. The binary embeds the web app, so the machine that runs it needs no Node.js. On a Mac you can download the app instead. - Docker only if you want VM mode or the bots' shared browser. A Docker Compose route also exists.
- At least one AI account or key, or a local Ollama with a model pulled.
- Room for the router. On first start, kwant sets up its Laya router, a small Python service that picks which bot answers, and downloads its routing model (about 420 MB).
kwnt servemanages it. Until Laya is ready, bots are picked by keyword. - On a server, an HTTPS reverse proxy, so you can reach the web app safely and install it on a phone or in its own window.
How a team runs day to day
- Bots and teams. A bot is a persona with its own voice, model and folder. You group bots into teams with a lead and a shared channel. See bots and teams.
- Handoffs. When a reply @mentions a teammate, that teammate answers right after in the same chat. A message can lead to up to four handoffs, so bots can't keep each other going forever.
- Routines. A routine sends a prompt to a bot on a schedule (once, daily, weekly, monthly, every few minutes or a cron rule) and posts the answer in a chat. You can also ask a bot to set one up. See routines.
- Several accounts. When one account runs out of usage, kwant can move the turn to the next account in your priority order, up to three attempts, and the chat says so. See multiple Claude, Codex and Grok accounts.
- Spaces. Keep work, a side project and home in separate spaces, each with its own bots, routines, tools and accounts. See spaces.
- Tools. Connect Model Context Protocol servers and choose which bots may use each one. See MCP tools.
- From a phone. The web app works on a phone, so you can read a summary or answer an approval away from your desk.
Keeping it safe
Running agents yourself means you decide what they may do. kwant's defaults are built around that:
- Approval cards. When a bot wants to run a command, edit a file outside its folder or call a tool, you see a card with the exact command or arguments. You choose Allow once, Always allow or Deny. Only you can answer a card.
- Three modes. Each space has an approval mode: ask before running commands, ask only when risky (the default for new spaces) or don't ask. A bot can override its space. See approvals.
- Payments always ask. Anything that looks like a payment shows a card in every mode.
- Secrets are off limits. A call that names kwant's own secret files (the vault, its key, the API token) is refused and recorded.
- Per-bot tool access. A bot only sees the MCP servers assigned to it, and secret values always come back masked.
- Earned freedom. Flight School sets a tier per bot and kind of work: Observe, Sandbox or Act.
- Safe imports. Imported bots start with no tools, imported skills wait for your approval and imported routines start paused.
Know the limit. kwant's own docs say the "ask only when risky" mode guards against accidents and isn't a sandbox: scripts in a bot's folder, make and npm run run without a card and can do anything the bot's user can do. Use the stricter ask mode for bots or folders you don't trust.
On a server, kwnt serve prints a one-time sign-in link that works once, for 15 minutes. On your own computer, requests from the same machine need no token.
Questions to ask about any self-hosted agent app
Use this list when you compare tools, kwant included.
- Where does the data live, and can you copy or back up one folder?
- Which model accounts does it support, and what happens when one runs out of usage?
- What can a bot do before you are asked, and can you see exactly what it will do first?
- Does anything leave your machine apart from the model calls? Is there telemetry?
- Can you undo what a bot changed?
- What is the license, and can you read the code?
- What does it need running next to it (build tools, Docker, a Python service), and how much disk does that take?
- What happens to scheduled work when your machine is off?
Who it fits, and who should pick something else
kwant fits if you are comfortable building from source or running a binary on a VPS, want several bots with different roles that hand work to each other, and want approvals before risky steps. It is a poorer fit if you want no machine to look after: you run it yourself, the Mac app isn't notarized by Apple yet (macOS asks you to open it once under System Settings), and routines only run while your machine is on.
Coming from Grok Bot? See the Grok Bot alternative page for how the import works.
Get started
Build kwnt, add one login or key, and ask your team a question.
- Install kwnt on a laptop, a VPS or with Docker
- Quickstart
- See all features
- Source and releases on GitHub
FAQ
What is a self-hosted AI agent team?
It is a group of AI bots that you run on your own laptop, home server or VPS rather than in a vendor's cloud. The bots share chats, hand work to each other and can run on a schedule. kwant is an open-source (AGPL-3.0) example: one binary, kwnt, with the web app and database built in.
Does self-hosting mean my data never leaves my machine?
No. kwant keeps its chats, settings and data in a folder on your machine and sends no telemetry to its developers. But a bot on a Claude, Codex or Grok login or an API key still sends its prompts to that provider. To keep a model on your own hardware, use local Ollama or your own OpenAI-compatible server.
What do I need to run kwant?
A computer or VPS that stays on, Rust and Node.js to build it, and at least one AI login, API key or a local Ollama model. Once built, the kwnt binary needs no Node.js. Docker is only needed for VM mode and the bots' shared browser. kwant also sets up a small Python service called Laya to pick which bot answers.
Can the bots run while I am away?
Yes. Routines run a prompt on a schedule, such as daily, weekly or a cron rule, and post the answer in a chat. They run on your own machine, so they run while that machine is on. A small VPS keeps them going around the clock.
How do I stop a bot doing something I did not want?
kwant shows an approval card with the exact command or arguments before risky steps. You can allow once, always allow or deny. Payments always ask. The default "ask only when risky" mode guards against accidents but is not a sandbox, so use the stricter ask mode for bots or folders you do not trust.
Is kwant free?
The software is free under the AGPL-3.0, and commercial licenses are available. You pay for whatever model accounts or API keys you connect. A local Ollama model needs no account or key.