Skip to main content

personagent: illustrated conversations

A character for your group chats that knows when to stay quiet, and learns from being corrected.

PyPI CI Python 3.10–3.14 License: MIT

English · 简体中文 · 繁體中文 · 日本語 · 한국어 · Español · Français · Deutsch · Português · Русский

personagent is a character for your group chats: pick one or write your own, and run it on any OpenAI-compatible model. It connects to QQ, WeChat, Telegram and Discord itself, and to KOOK, Feishu, DingTalk, Slack, WeCom, Mattermost and Misskey from the same page.

Start in a local browser chat: add one model key and say hello. When you want the character in a group, connect an app with a phone scan or one or two values.

The Connect apps screen of the local page, with every platform it can join

Connect apps, in the same local page as setup and the character chat. Screenshot from a throwaway setup with a local test model.

Start here

Install it from PyPI and open it:

python -m pip install personagent
personagent

With uv, uvx personagent runs it without a separate install step.

The browser opens on a local page with three views: Chat, Connect apps and Character & settings. Paste your model API key and click Verify & start chatting; one small request checks it. There are 10 model service presets plus any other OpenAI-compatible one, and name and personality presets for the character. The Persona box holds persona.txt; saving it restarts the agent and keeps what it learned. More features turns on web search, image understanding and speaking first. Running personagent again reuses a page that is already open. The menu at the top right shows the page in English, Chinese or eight more languages. The character answers in the language the chat uses; its built-in prompts and data are English and Chinese, so how well it does in another language depends on the model.

On Windows you can also download the source ZIP and double-click start.bat. Python 3.10–3.14. See the short getting-started guide; terminal commands and connectors are in the full guide.

Let your coding agent set it up

A coding agent that can run commands on your computer can install and set up personagent for you. Give it this:

Read https://raw.githubusercontent.com/wangkant/personagent/main/docs/setup-for-agents.md and set up personagent for me.

It asks for the character's language, name and personality, your model service and the chat apps you want, then installs personagent, creates the home folder and starts the local page. You paste your model key into that page yourself, so the key never passes through the agent. The instructions it follows are plain Markdown you can read too.

Why personagent

It knows when to stay quiet.
It answers when called. Otherwise a model judges whether a person would chime in: no dice roll.
A burst of messages gets one reply, not one each.
It learns from corrections that hold up.
What a correction teaches, like what the group calls the gym, carries into every later reply in that chat.
A change needs two agreeing reactions from the same chat, one of them strong.
A troll or a bystander cannot retrain it.
Every change is on record, and any of them can be rolled back.
It is easy to start, and lives where your group is.
Browser setup and chat in English, Chinese or eight more languages, with 11 model services and optional advanced settings.
It joins QQ, WeChat, Telegram and Discord by itself and a dozen more apps from the same page; its Activity view shows what it did.
  • Each chat has its own memory.
  • Editing the character keeps what it learned.
  • It is measured: personagent eval scores when it speaks, whether it stays in character, and whether corrections stick (results).

Put it in your group

Open Connect apps in the local page. It groups the apps like this:

On the page Apps What you need
Scan to connect QQ, personal WeChat Your phone. WeChat bots get one-to-one chats only
Paste one or two values Telegram, Discord, KOOK, Feishu/Lark, DingTalk, Slack, WeCom AI bot, Mattermost, Misskey Values from the app's console; the page says which
Advanced WeCom app, WeChat Official Account, QQ webhook, OneBot v11 (NapCat), Satori A public address, or other software on this computer

Credentials are checked before they are saved, and connected apps start again each time personagent starts. personagent connects QQ, WeChat, Telegram and Discord itself; the rest go through an AstrBot it downloads and runs in the background, with nothing else to open. On a server, personagent up starts the character and every connected app without a browser.

Already running AstrBot, Koishi or Matrix? For an AstrBot on this computer, personagent connect astrbot installs the plugin and the shared token. For one on another machine, upload astrbot_plugin_personagent.zip from the latest release under Install from File on its plugin page, then set its token and personagent's HTTPS address as the guides below describe. Koishi joins through the Satori connector, and Matrix, with WhatsApp and Signal behind mautrix bridges, through the Matrix connector.

Setup for each is in the user guide and the deployment guide; the Chinese step-by-step guide covers QQ from zero.

How it compares

The projects people usually weigh it against, going by each one's documentation in October 2026:

  • AstrBot (AGPL-3.0) is a bot framework for 18+ platforms, with a WebUI and a large plugin market. It can reply unasked at random (10% of the time, off by default) and leaves learning to plugins.
  • MaiBot (GPL-3.0) is a character bot for QQ, through NapCat, with a WebUI and a one-click launcher. A planner model decides how often it talks, and it picks up expressions and slang from the chat.
  • ChatLuna's character plugin for Koishi (AGPL-3.0) joins in on rules: a fixed interval, how busy the chat is, or how long it has gone quiet.
  • ElizaOS (MIT) is an agent framework in TypeScript for Discord, Telegram, Slack and more, where a model decides whether to respond.

What personagent has built in, where the others leave it to plugins or don't describe it: it learns from how people react to its replies (corrections, rejections, retries they accepted); a change needs two agreeing reactions from the same chat, one of them strong; every change is logged and can be rolled back; and how it behaves is measured in a published eval (below).

Where they are ahead: desktop apps with every setting in a WebUI, big plugin ecosystems, and slang, sticker packs and image memory. If you already run AstrBot or Koishi, you don't have to choose: personagent can run behind either one as the character.

Measured

personagent eval drives the real agent through labelled chat moments. The latest run, on 2026-10-18, put the shipped character on two models through OpenRouter, tried every case three times, and had Claude Opus 5.5 judge blind. English / Chinese:

deepseek-v4.1-flash gpt-6-luna
Right about when to speak (60 moments) 83% / 80% 93% / 91%
Plays the character better than the same model given only its prompt (40 moments) 63% / 58% 75% / 53%
Uses what a correction taught in a later, differently worded message 76% / 56% 71% / 67%
  • It rarely ignores a message meant for it. Most misses are its name used for something else, such as a cinema or a puppy.
  • In Chinese, its edge over the plain prompt is within the noise.
  • Before corrections kept their lesson, which was fixed after the first run that day, only 2 of 58 later messages used it.
  • No troll's, bystander's or walked-away correction got through, in 84 tries.

The full results give the intervals, the misses by kind, the method, what the numbers don't show, and every report.

Documentation

Privacy

Everything personagent stores stays on your machine, in one home folder: .env with your keys, persona.txt, runtime/, and platforms/ with the managed AstrBot and the direct connections' credentials. The model provider you choose does see the conversations it answers, and once a day personagent asks pypi.org whether a newer version is out (UPDATE_CHECK_ENABLED=false stops that). Before you connect it to real people, tell them it is a bot and get their consent; the guide lists exactly what goes where.

Status

1.3.1 is on PyPI, released 2026-10-26. QQ is the most exercised platform, through AstrBot in 1.0 and directly since 1.1. The WeChat, Telegram and Discord connections check credentials against the real services before saving and are otherwise tested against stand-ins; the Satori and Matrix connectors are tested against stand-ins. CI runs the tests on Linux with Python 3.10–3.14 and on Windows with Python 3.12, plus jobs that install the package and drive the command and the local page.

License

MIT © 2026 Qiankang (Kant) Wang.

Acknowledgements

Metadata

Release files for personagent 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for personagent 1.3.1
File Size Uploaded Provenance Actions
personagent-1.3.1.tar.gz 745.8 kB With provenance Details for personagent-1.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for personagent 1.3.1
File Interpreter ABI Platform Actions
personagent-1.3.1-py3-none-any.whl Python 3 none any Details for personagent-1.3.1-py3-none-any.whl

Total release size: 1.6 MB

Release files / personagent-1.3.1.tar.gz

Download URL personagent-1.3.1.tar.gz
Size 745.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b33437f1a2cb3bb9b51e070884891b198f19fafb584d056ff45eef7f9b609cbe
BLAKE2b-256 checksum
How to use checksums
b76d3877ea606509e2409b11609e6ce744d72423b9ac7038db7a8f93766a1e5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / personagent-1.3.1-py3-none-any.whl

Download URL personagent-1.3.1-py3-none-any.whl
Size 818.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82c3b95eece8c78d3e45e31a34078250c77f68f5be472898bb155bdaa4c6a6d5
BLAKE2b-256 checksum
How to use checksums
4ecc861adcf7cc6dced71d2d43e0fa3b623e2491007eed6c78c2a51e5f7835e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for personagent 1.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for personagent-1.3.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page