Model or dataset
shaxiu/XianyuAutoAgent avatar
shaxiu/XianyuAutoAgent

XianyuAutoAgent's four prompt files, its cookie login, and its latest-tagged image

An intelligent customer-service bot system for Xianyu (Idle Fish): an AI solution providing 24/7 automated support on the Xianyu platform, with multi-expert collaborative decision-making, smart price negotiation and context-aware conversation.

9,675 stars1,693 forksPythonGPL-3.0

At a glance

What is it?
XianyuAutoAgent is a Python agent that keeps a Xianyu marketplace shop answering messages with an LLM, routing each message to a price, tech or default expert and haggling with a tiered discount. What it actually runs on is four prompt files, a cookie string copied out of a browser, and an OpenAI-compatible endpoint.
Who is it for?
This project fits a seller who already has a Xianyu web session, accepts that the bot speaks through four editable prompts, and wants Docker Compose to restart it forever. It does not fit anyone who needs market pricing, a retrieval knowledge base, sentiment analysis, or a browser view of live conversations, since the README lists all four as still planned.
Can I use it commercially?
Yes, with conditions. GPL-3.0 is a copyleft licence: if you distribute software that includes it, you must release that software's source code under the same licence. Running it internally without distributing it does not trigger that obligation.
Is it still maintained?
Yes. The repository last received commits 157 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 13, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • shaxiu/XianyuAutoAgent9,675 ★ · +541
Star history
Repository2026-09-102026-11-13
shaxiu/XianyuAutoAgent9.1k9.7k

541 Stars in the last 64 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Four prompt files decide every sentence the bot sends

Getting to a first run is four documented steps:

bash
1. 克隆仓库
git clone https://github.com/shaxiu/XianyuAutoAgent.git
cd XianyuAutoAgent

2. 安装依赖
pip install -r requirements.txt

3. 配置环境变量
创建一个 `.env` 文件,包含以下内容,也可直接重命名 `.env.example` :
#必配配置
API_KEY=apikey通过模型平台获取
COOKIES_STR=填写网页端获取的cookie
MODEL_BASE_URL=模型地址
MODEL_NAME=模型名称
#可选配置
TOGGLE_KEYWORDS=接管模式切换关键词,默认为句号(输入句号切换为人工接管,再次输入则切换AI接管)
SIMULATE_HUMAN_TYPING=True/False #模拟人工回复延迟

The behaviour of the whole agent then sits in the `prompts` directory, and there are exactly four files: `classify_prompt.txt` for intent classification, `price_prompt.txt` for the price expert, `tech_prompt.txt` for the tech expert, and `default_prompt.txt` for the default reply. Nothing else in the tree is meant to be edited for tone or policy. You create them by stripping `_example` from the template names, otherwise the program falls back to reading the four templates as they ship. The Dockerfile automates that rename, copying `classify_prompt_example.txt` to `classify_prompt.txt` and the same for price, tech and default, so the image ships with the template text, while docker-compose.yml mounts the host's `./prompts` directory over `/app/prompts`.

The cookie string copied from a browser console is the entire login

Authentication is a pasted value. `COOKIES_STR` is filled with cookies taken from the Xianyu web client, and the documented route is manual: open the F12 developer console in the browser, choose Network, click Fetch/XHR, click one request, and read the cookies. There is no account login, no password field, and no OAuth step in this project. Two consequences follow for whoever deploys it. First, the credential is a live session token copied out of a signed-in browser, so the same rules apply as for any session cookie: whoever holds the file holds the account session. Second, in the Docker path that file is mounted into the container from the host, so a cookie that exists only inside a container filesystem would be lost on every rebuild. The compose file makes this explicit by binding `./.env:/app/.env` alongside the data and prompts directories.

A single full stop toggles the shop between the bot and a person

Human takeover is one keyword. `TOGGLE_KEYWORDS` holds the takeover switching keyword and defaults to the Chinese full stop, with the shipped example setting it to `。`. Typing that character switches the conversation to manual takeover, typing it again switches back to AI takeover. This is the manual override for the whole system: a single punctuation mark that is also ordinary punctuation in chat. The consequence is that the switch is a keyword typed into the running conversation rather than a mode you set in a dashboard, so whoever is watching the shop has to notice the conversation state before a customer sees an unanswered message. `SIMULATE_HUMAN_TYPING` is the related polish switch, set to `False` in the example file, and it decides whether replies are staggered to imitate a person typing.

Intent classification routes each message to one of three experts

The dialogue engine has two layers and both are named in the feature table. Context awareness is implemented with conversation history storage, described as lightweight conversation memory management that feeds the complete dialogue history into the LLM as context. Expert routing is implemented with an LLM prompt plus rule based routing: prompt engineering does intent recognition, and the result dispatches dynamically to an expert agent, with support for switching between bargaining, technical and customer service scenarios. So the classify prompt is not decoration. It is the switchboard that decides whether a message goes to the price expert, the tech expert, or the default reply. What the routing does not have is a stated fallback rule for a message whose intent the classifier cannot place, and no confidence threshold is documented, so misclassification shows up as a wrong expert answering rather than as an error.

Tiered price drops are implemented and market comparison is not

The business feature matrix separates shipped work from planned work, and the bargaining column shows the gap. The 议价系统 row has a tiered price reduction strategy marked as implemented, and market price comparison marked as still in planning. The practical consequence is narrow and real: the bot can negotiate with its tiered price reduction strategy and `price_prompt.txt`, but it has no data telling it what the item sells for elsewhere. So a buyer who quotes a competing price gets an answer derived from the discount ladder alone, and the reply will be as good or as bad as the prompt you wrote. The same pattern holds in the core engine row, where LLM auto reply and context management are done while sentiment analysis enhancement is listed as planned, meaning there is no implemented read of a buyer's emotional state feeding the routing decision.

Web search is wired into tech support while the RAG knowledge base is not

The technical support row pairs one implemented capability with one planned one: web search integration is done, and RAG knowledge base enhancement is still in planning. That combination changes what the tech expert can promise. With web search it can look something up while answering, but it has no store-owned corpus to quote from, no product manual loaded, and no vector index over your own listings. So the answers it gives on technical questions come from a live search plus the model's own knowledge plus `tech_prompt.txt`, and there is no configured path for you to make it answer only from your own documentation. The README does point at a Feishu based walkthrough document for newcomers, which is where the step by step version of this setup lives, but that guide is a separate document outside the repository and nothing in the tree keeps the two in sync.

Basic logging is the whole operations story, with no web console

The operations and monitoring row is the shortest one in the matrix. What exists is basic logging. What is planned is DingTalk integration and a web management interface. Read together with the screenshots the README shows, one of which is captioned as the backend log, the current state is a text log and nothing more. The consequence for an operator is that there is no browser view of which conversations are live, no place to read what the bot said yesterday, and no way to change a prompt from a page. Everything that would make this supervisable lives in the planned column. The only interface named as existing is the takeover keyword typed into a live chat, so supervision means watching the shop the way you would watch any other inbox.

A :latest image with restart: always, and no releases to hold on to

The repository ships no GitHub releases, and the default branch was last pushed on 2026-06-10. What it does ship is a Docker path that trades version pinning for availability. `docker-compose.yml` defines one service named `XianyuAutoAgent` running `image: shaxiu/xianyuautoagent:latest` with `restart: always`, on a bridge network called `xianyu-network`, with `TZ=Asia/Shanghai` in the environment. A `:latest` tag with `restart: always` means the container comes back on its own but the code underneath it is whatever the registry served that day, so a restart after an upstream change can bring behaviour you never reviewed. The Dockerfile is a two stage build on `python:3.10-alpine` that keeps a virtualenv from the builder stage, creates `data` and `prompts`, copies the four modules and `utils/`, and starts the same way the local path does:

bash
python main.py

The dependency set behind that is five pinned packages: `openai==1.65.5`, `websockets==13.1`, `loguru==0.7.3`, `python-dotenv==1.0.1` and `requests==2.32.3`. The `openai` pin is the reason any OpenAI-compatible base URL works, which is how the shipped default reaches `https://dashscope.aliyuncs.com/compatible-mode/v1` with `MODEL_NAME=qwen-max`. The project's own notice is the part to weigh: the team may stop updating or delete the project at any time.

Editorial conclusion

This project fits a seller who already has a Xianyu web session, accepts that the bot speaks through four editable prompts, and wants Docker Compose to restart it forever. It does not fit anyone who needs market pricing, a retrieval knowledge base, sentiment analysis, or a browser view of live conversations, since the README lists all four as still planned. Before deploying, read the own notice in the README: the team may stop updating or delete the project at any time, there are no GitHub releases, and the last push was 2026-06-10, so the image tag you run is not a version you can hold.

Frequently asked questions

What does XianyuAutoAgent actually do for a Xianyu shop?

It provides AI duty coverage for the Xianyu platform with 24 hour automated replies, multi-expert collaborative decisions, smart bargaining and context-aware conversation. Implemented pieces are LLM auto reply, context management, a tiered price reduction strategy, web search integration and basic logging.

How do I install XianyuAutoAgent from source?

You need Python 3.8 or newer. Clone with `git clone https://github.com/shaxiu/XianyuAutoAgent.git`, run `cd XianyuAutoAgent` and `pip install -r requirements.txt`, then create a `.env` file or rename `.env.example`, create the `prompts/*_prompt.txt` files by stripping `_example` from the template names, and start the agent with `python main.py`. A Docker path also exists using the image `shaxiu/xianyuautoagent:latest` through `docker-compose.yml`.

Which environment variables does XianyuAutoAgent require?

Four are required: `API_KEY`, `COOKIES_STR`, `MODEL_BASE_URL` and `MODEL_NAME`. Two are optional: `TOGGLE_KEYWORDS` and `SIMULATE_HUMAN_TYPING`. The shipped `.env.example` points at `https://dashscope.aliyuncs.com/compatible-mode/v1` with `MODEL_NAME=qwen-max`, and the API key is described as coming from the Bailian model platform.

How do I take a XianyuAutoAgent conversation over manually?

Set `TOGGLE_KEYWORDS`, which defaults to the Chinese full stop and is set to `。` in the example file. Typing that character switches the conversation to manual takeover, and typing it again switches back to AI takeover. There is no web management interface yet, since that is listed as planned.

Does XianyuAutoAgent compare prices with the rest of the market?

No. The bargaining module has a tiered price reduction strategy marked as implemented, while market price comparison is marked as planned. Retrieval over your own documentation is in the same state, with RAG knowledge base enhancement listed as planned next to the implemented web search integration.

Official sources

  1. Issues
  2. License: GPL-3.0
  3. README
  4. shaxiu/XianyuAutoAgent on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/shaxiu-xianyuautoagent.svg)](https://hysenlabs.com/projects/shaxiu-xianyuautoagent)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/shaxiu-xianyuautoagent.svg)](https://hysenlabs.com/projects/shaxiu-xianyuautoagent)

Was this useful?