Foolllll 1daa0e3367 fix(compress): improve context compression, improve kv-cache rate of context compression, handle compression model modalities (#8530)
* fix(context): restore turn cap, serialize content parts and tool calls for llm compress, fix AftCompact debug log

Three context-compaction regression fixes after #8226:

1. Restore max_context_length -> enforce_max_turns propagation so
   normal turn-based truncation works again.
2. Serialize ContentPart and ToolCall objects into plain dicts in
   _message_to_dict so llm_compress no longer fails with JSON
   serialization errors.
3. Print _provider_messages (compacted) instead of run_context.messages
   (unchanged) in AftCompact debug log; truncate long role lists to
   first4,...,last4 to avoid log spam.

Assertions in tests are also hardened to avoid coupling to exact prompt
wording.

* fix(tool_loop_agent_runner): simplify context handling by removing redundant provider messages

* fix(tool_loop_agent_runner): rename context manager variables for clarity

* fix: update context compression to use recent token ratio instead of fixed count

* fix: enhance LLMSummaryCompressor to sanitize contexts and improve message handling

* ruff format

---------

Co-authored-by: Soulter <905617992@qq.com>
2026-06-03 17:40:05 +08:00
2026-05-30 20:10:51 +08:00
2026-03-22 19:12:12 +08:00
2026-01-13 12:19:05 +08:00

astrbot-github-banner-v2-light-0405_副本

AstrBot is an open-source all-in-one Agent chatbot platform that integrates with mainstream instant messaging apps. It provides reliable and scalable conversational AI infrastructure for individuals, developers, and teams. Whether you're building a personal AI companion, intelligent customer service, automation assistant, or enterprise knowledge base, AstrBot enables you to quickly build production-ready AI applications within your IM platform workflows.

screenshot_1 5x_postspark_2026-02-27_22-37-45

Key Features

  1. 💯 Free & Open Source.
  2. AI LLM Conversations, Multimodal, Agent, MCP, Skills, Knowledge Base, Persona Settings, Auto Context Compression.
  3. 🤖 Supports integration with Dify, Alibaba Cloud Bailian, Coze, and other agent platforms.
  4. 🌐 Multi-Platform: QQ, WeChat Work, Feishu, DingTalk, WeChat Official Accounts, Telegram, Slack, and more.
  5. 📦 Plugin Extensions with 1000+ plugins available for one-click installation.
  6. 🛡️ Agent Sandbox for isolated, safe execution of code, shell calls, and session-level resource reuse.
  7. 💻 WebUI Support.
  8. 🌈 Web ChatUI Support with built-in agent sandbox and web search.
  9. 🌐 Internationalization (i18n) Support.

💙 Role-playing & Emotional Companionship Proactive Agent 🚀 General Agentic Capabilities 🧩 1000+ Community Plugins

99b587c5d35eea09d84f33e6cf6cfd4f

c449acd838c41d0915cc08a3824025b1

image

image

Quick Start

One-Click Deployment

For users who want to quickly experience AstrBot, are familiar with command-line usage, and can install a uv environment on their own, we recommend the uv one-click deployment method :

uv tool install astrbot --python 3.12
astrbot init # Only execute this command for the first time to initialize the environment
astrbot run

Requires uv to be installed. AstrBot requires Python 3.12 or later. The --python 3.12 option ensures that uv creates the tool environment with Python 3.12.

Note

For macOS users: due to macOS security checks, the first run of the astrbot command may take longer (about 10-20s).

Update astrbot:

uv tool upgrade astrbot --python 3.12

Warning

AstrBot deployed via uv does not support upgrading through the WebUI. To update, please run the command above from the command line.

Docker Deployment

For users familiar with containers and looking for a more stable, production-ready deployment method, we recommend deploying AstrBot with Docker / Docker Compose.

Please refer to the official documentation: Deploy AstrBot with Docker.

Deploy on RainYun

For users who want one-click deployment and do not want to manage servers themselves, we recommend RainYun's one-click cloud deployment service ☁️:

Deploy on RainYun

Desktop Application Deployment

For users who want to use AstrBot on desktop and mainly use ChatUI, we recommend AstrBot App.

Visit AstrBot-desktop to download and install; this method is designed for desktop usage and is not recommended for server scenarios.

Launcher Deployment

For desktop users who also want fast deployment and isolated multi-instance usage, we recommend AstrBot Launcher.

Visit AstrBot Launcher to download and install.

Deploy on Replit

Replit deployment is maintained by the community and is suitable for online demos and lightweight trials.

Run on Repl.it

AUR

AUR deployment targets Arch Linux users who prefer installing AstrBot through the system package workflow.

Run the command below to install astrbot-git, then start AstrBot in your local environment.

yay -S astrbot-git

More deployment methods

If you need panel-based management or deeper customization, see BT-Panel Deployment for BT Panel app-store setup, 1Panel Deployment for 1Panel app-market deployment, CasaOS Deployment for NAS/home-server visual deployment, and Manual Deployment for fully custom source-based installation with uv.

Supported Messaging Platforms

Connect AstrBot to your favorite chat platform.

Platform Maintainer
QQ Official
OneBot v11 protocol implementation Official
Telegram Official
Wecom & Wecom AI Bot Official
WeChat Official Accounts Official
Feishu (Lark) Official
DingTalk Official
Slack Official
Discord Official
LINE Official
Satori Official
KOOK Official
Misskey Official
Mattermost Official
WhatsApp (Coming Soon) Official
Matrix Community
Rocket.Chat Community
VoceChat Community

Supported Model Services

Service Type
OpenAI and Compatible Services LLM Services
Anthropic LLM Services
Google Gemini LLM Services
Moonshot AI LLM Services
Zhipu AI LLM Services
DeepSeek LLM Services
Ollama (Self-hosted) LLM Services
LM Studio (Self-hosted) LLM Services
AIHubMix LLM Services (API Gateway, supports all models)
CompShare LLM Services
302.AI LLM Services
TokenPony LLM Services
SiliconFlow LLM Services
PPIO Cloud LLM Services
ModelScope LLM Services
OneAPI LLM Services
Dify LLMOps Platforms
Alibaba Cloud Bailian Applications LLMOps Platforms
Coze LLMOps Platforms
OpenAI Whisper Speech-to-Text Services
SenseVoice Speech-to-Text Services
Xiaomi MiMo Omni Speech-to-Text Services
OpenAI TTS Text-to-Speech Services
Gemini TTS Text-to-Speech Services
GPT-Sovits-Inference Text-to-Speech Services
GPT-Sovits Text-to-Speech Services
FishAudio Text-to-Speech Services
Edge TTS Text-to-Speech Services
Alibaba Cloud Bailian TTS Text-to-Speech Services
Azure TTS Text-to-Speech Services
Minimax TTS Text-to-Speech Services
Xiaomi MiMo TTS Text-to-Speech Services
Volcano Engine TTS Text-to-Speech Services

❤️ Sponsors

sponsors

❤️ Contributing

Issues and Pull Requests are always welcome! Feel free to submit your changes to this project :)

How to Contribute

You can contribute by reviewing issues or helping with pull request reviews. Any issues or PRs are welcome to encourage community participation. Of course, these are just suggestions—you can contribute in any way you like. For adding new features, please discuss through an Issue first.

Development Environment

AstrBot uses ruff for code formatting and linting.

git clone https://github.com/AstrBotDevs/AstrBot
pip install pre-commit
pre-commit install

🌍 Community

QQ Groups

  • Group 12: 916228568 (New)

  • Group 9: 1076659624 (Full)

  • Group 10: 1078079676 (Full)

  • Group 11: 704659519 (Full)

  • Group 1: 322154837 (Full)

  • Group 3: 630166526 (Full)

  • Group 4: 1077826412 (Full)

  • Group 5: 822130018 (Full)

  • Group 6: 753075035 (Full)

  • Group 7: 743746109 (Full)

  • Group 8: 1030353265 (Full)

  • Developer Group(Chit-chat): 975206796

  • Developer Group(Formal): 1039761811

Discord Server

Discord_community

❤️ Special Thanks

Special thanks to all Contributors and plugin developers for their contributions to AstrBot ❤️

Additionally, the birth of this project would not have been possible without the help of the following open-source projects:

Star History

Tip

If this project has helped you in your life or work, or if you're interested in its future development, please give the project a Star. It's the driving force behind maintaining this open-source project <3

Star History Chart

Companionship and capability should never be at odds. What we aim to create is a robot that can understand emotions, provide genuine companionship, and reliably accomplish tasks.

私は、高性能ですから!

Description
No description provided
Readme AGPL-3.0 143 MiB
Languages
Python 61.2%
Vue 19.5%
JavaScript 13.6%
TypeScript 4.8%
HTML 0.3%
Other 0.6%