An LLM That Haggles for You on Xianyu
Built to let Xianyu sellers automate buyer chat, price negotiation, and tech support through an LLM that never sleeps.

What it does
XianyuAutoAgent is a 24/7 chatbot for the Xianyu second-hand marketplace. It reads buyer messages via an unofficial browser-cookie session, feeds the full conversation history into an LLM, and auto-replies through domain-specific prompt templates. A lightweight router classifies intent and dispatches queries to price, technical, or default “experts” so the bot can switch from haggling to troubleshooting without human intervention.
The interesting bit
The project is mostly a well-organized prompt-orchestration layer glued to a scraped web session. Its stepped discount strategy and the period-key toggle for instant human takeover show the authors understand the social rhythm of second-hand trading: automate the noise, but know exactly when to get out of the way.
Key highlights
- Prompt-based expert routing:
classify_prompt.txtdispatches messages to price, technical, or default agents. - Full conversation history injected directly into the LLM context for “context-aware” replies; no vector database or RAG layer yet.
- Stepped price-reduction logic for automated bargaining during negotiation.
- Simulated human typing delay and a keyword toggle (default is a period) to hand control back to a human seller.
- Unofficial integration relying on manually extracted cookies from the Xianyu web client.
Caveats
- The cookie-based hook is unofficial and brittle; the authors warn the repository may be deleted at any time.
- Features like sentiment analysis, market price comparison, RAG knowledge bases, and a web admin UI are listed as planned but not yet shipped.
- Changing the default Tongyi Qianwen model to another provider requires manual edits to environment variables.
Verdict
Useful if you run a high-volume Xianyu shop and want to experiment with LLM-driven negotiation. Avoid if you need an officially supported platform API or a plug-and-play general e-commerce agent.
Frequently asked
- What is shaxiu/XianyuAutoAgent?
- Built to let Xianyu sellers automate buyer chat, price negotiation, and tech support through an LLM that never sleeps.
- Is XianyuAutoAgent open source?
- Yes — shaxiu/XianyuAutoAgent is open source, released under the GPL-3.0 license.
- What language is XianyuAutoAgent written in?
- shaxiu/XianyuAutoAgent is primarily written in Python.
- How popular is XianyuAutoAgent?
- shaxiu/XianyuAutoAgent has 8.4k stars on GitHub and is currently cooling off.
- Where can I find XianyuAutoAgent?
- shaxiu/XianyuAutoAgent is on GitHub at https://github.com/shaxiu/XianyuAutoAgent.