Xianyu Auto Agent
A 24/7 AI customer-service bot for Xianyu sellers that answers buyers, negotiates prices and routes to specialist experts.
- Source repo
- shaxiu/XianyuAutoAgent
- Stars
- ★ 9.9k
- Last updated
- 5mo ago
- FARS reviewed
- Nov 30, 2026
- License
- GPL-3.0
- Primary language
- Python
- FA score
- 42/100 · Major gaps
At a glance
- How it runs
- Works with
- Portable with changes
- Cost
- Free software; you pay for model usage
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- An individual Xianyu seller who wants routine questions answered and initial price talk handled while asleep or at work
- Not a fit if
- Teams expecting an official Xianyu open API integration — this relies on web-session cookies
- Users who need a stable long-term maintained product; the authors may stop or delete it anytime
- Anyone unwilling to keep a Python 3.8+ script running on an always-on machine
- Maintenance
- Commits in the last 6 monthslast commit 2026-06-10+20.7 ★/day over 7 days
- Source review
- 42/100 · Major gaps 2 safety controls not found
What does this agent do, and when should you use it?
XianyuAutoAgent is a self-hosted Python 3.8+ bot that acts as an always-on customer-service agent for the Xianyu marketplace, launched with python main.py. It signs in with a web-session cookie, listens for buyer messages, and feeds the stored conversation history to an LLM as context. Each turn is first classified by an intent prompt, then routed to one of three specialist prompt branches: price negotiation, technical support, or a default reply. Negotiation implements a tiered discount strategy, technical answers can draw on web search, and basic logging is included. The model endpoint is configurable via MODEL_BASE_URL and MODEL_NAME (Qwen by default), so other compatible APIs can be swapped in at the cost of supplying your own key and cookie.
Running as a long-lived script, the agent connects to the Xianyu web session and keeps listening for incoming buyer messages while storing dialogue history in a lightweight session memory. On every turn it calls the classify_prompt.txt intent classifier to decide which expert should answer, then dispatches to price_prompt.txt (tiered bargaining), tech_prompt.txt (technical questions, optionally backed by web search) or default_prompt.txt (general customer-service replies). The generated answer is sent back into the Xianyu conversation and the interaction is written to basic logs. TOGGLE_KEYWORDS lets the seller switch between AI and human takeover with a keyword (a period by default), and SIMULATE_HUMAN_TYPING toggles a simulated typing delay.
- An individual Xianyu seller who wants routine questions answered and initial price talk handled while asleep or at work
- Sellers of used electronics who need technical questions answered by a dedicated technical-support prompt branch
- Sellers fielding many simultaneous price inquiries who want one consistent tiered discount policy instead of replying by hand
- Developers who want to point the bot at their own model endpoint instead of the default Qwen service
- Sellers who need to jump in manually mid-conversation and switch back to AI afterwards
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
pip install -r requirements.txt
- Environment variables
API_KEYMODEL_BASE_URL- Config files
.env.env.example
How do you install or deploy this agent?
Clone the repository and install dependencies, then prepare the environment file and prompt files.
git clone https://github.com/shaxiu/XianyuAutoAgent.git
cd XianyuAutoAgent
pip install -r requirements.txtCreate a .env file in the project root (or rename .env.example) with at least the model and cookie settings:
#必配配置
API_KEY=apikey通过模型平台获取
COOKIES_STR=填写网页端获取的cookie
MODEL_BASE_URL=模型地址
MODEL_NAME=模型名称
#可选配置
TOGGLE_KEYWORDS=接管模式切换关键词,默认为句号(输入句号切换为人工接管,再次输入则切换AI接管)
SIMULATE_HUMAN_TYPING=True/False #模拟人工回复延迟Obtain COOKIES_STR from the Xianyu web client: press F12, open the console, go to Network → Fetch/XHR, click a request and copy its cookies. Then create prompts/*_prompt.txt, or drop _example from the four template filenames to use the bundled defaults.
How do you use this agent?
With configuration in place, start the main program from the project directory:
python main.pyThe script then stays resident, watching Xianyu messages and replying automatically. Customize behavior by editing the four files under prompts: classify_prompt.txt (intent classification), price_prompt.txt (price expert), tech_prompt.txt (technical expert) and default_prompt.txt (default reply). Send the keyword configured in TOGGLE_KEYWORDS (a period by default) in a conversation to switch between AI and human takeover.
Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
FARS trust-control audit
- confirmation before acting — Turn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
- rollback or recovery path — Back up first, or work on a git branch or snapshot, so its changes can be undone.
What are this agent's strengths and limitations?
- Real intent classification and expert routing: classify_prompt.txt decides the intent before dispatching to three separate price, technical and default prompt branches
- Bargaining is a concrete tiered-discount strategy rather than free-form model chat
- Model access is abstracted behind MODEL_BASE_URL and MODEL_NAME, so the default Qwen model can be replaced with another compatible API
- Includes a human-takeover keyword switch (TOGGLE_KEYWORDS) and optional simulated typing delay (SIMULATE_HUMAN_TYPING)
- The four prompts are plain external text files, so tuning requires no code changes
- Depends on Xianyu web-session cookies, which expire and must be re-fetched manually; stability is tied to platform changes
- The authors state the project may be stopped or deleted at any time, with no maintenance guarantee
- Requires your own paid model API key; the default Qwen path needs a key from that platform
- Sentiment analysis, market price comparison, RAG knowledge base, DingTalk integration and a web admin UI are all listed as planned, not available
- No Docker or hosted deployment path is documented; you must supply an always-on machine and manage the process yourself
How does this agent compare with similar options?
The README credits the open-source project cv-cat/XianYuApis as a reference, but gives no functional comparison between the two.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Xianyu Auto Agent This agent | 42 · Major gaps | CLIFree + model costs | ★ 9.9k | 5mo ago | Python | — |
| EDDI Conversational AI Orchestration | 80 · Good | Self-hosted serviceFree + model costs | ★ 393 | 1d ago | Java | OpenAI API |
| DeepTeam - LLM Red Teaming Framework | 61 · Some gaps | Library / SDKFree + model costs | ★ 3.1k | 6d ago | Python | — |
| traceAI | 59 · Major gaps | Library / SDKFree | ★ 270 | 3d ago | Python | — |
How does FollowAgents rate this agent?
Why each dimension lost points
Trust is judged only from static evidence. The account-level Cookie is used to log in to Xianyu and send messages automatically, giving access close to the full account session; no least-privilege or conversation-scoping design is shown, so least_privilege is 1. AI replies and bargaining happen without pre-send confirmation, and the manual-takeover keyword is not a user-confirmation mechanism, so user_confirmation is 0. README says full conversation history is used as LLM context but does not fully explain what data is sent to the model, retained, or deleted, so data_flow_transparency is 1. Using .env for API_KEY and COOKIES_STR is basic hygiene, but no log redaction, encrypted storage, or sensitive-data lifecycle guidance is visible, so sensitive_data_handling is 1. requirements.txt pins versions, but there is no lockfile, hash, or dependency-audit evidence, so dependency_security is 1. The bot sends messages to real users and negotiates automatically; manual takeover exists, but external-effect controls are thin, so external_effects is 1. Sent messages cannot be undone, and no rollback mechanism is shown, so rollback is 0. README credits cv-cat/XianYuApis and lists author contacts, so source_attribution is 2.
Reliability evidence is limited. The README feature matrix is directionally consistent with main.py token refresh, heartbeat, and manual-takeover logic, but main.py is only a partial sample and several local modules are not included, so overall self-consistency cannot be confirmed; self_consistency is 1. Third-party requirements are pinned, but availability of local modules such as XianyuApis, XianyuAgent, and context_manager cannot be confirmed from the sample, so dependency_availability is 1. The code logs errors, catches exceptions, and retries token refresh, but user-facing failure explanations, error classification, and recovery guidance are thin, so failure_messages is 1.
README clearly targets Xianyu sellers needing 7x24 customer-service coverage and includes screenshots and a quick start, so audience_and_scenarios is 2. The feature matrix separates implemented and planned items, and the notes say the project may stop updating, so capability_boundaries is 2. Triggering relies on chat-message detection and a manual-takeover keyword, with no fine-grained trigger conditions, allowlists, or conversation-scope controls, so trigger_precision is 1. Installation covers Python 3.8+, .env, Cookie acquisition, and model configuration, which is adequate for ordinary setup, so environment_fit is 2.
README is well structured with features, quick start, custom prompts, contribution, and cautions, so information_architecture is 2. Installation notes are reasonably complete, so install_notes is 2. Environment variable and prompt filenames look stable, but there is no versioned interface or stability promise, so naming_stability is 1. Screenshots and an external beginner tutorial are provided, but there is no FAQ, so examples_and_faq is 1. known_limitations is only a brief learning-only and may-stop/may-delete notice, with no systematic account-risk, platform-limit, or failure-scenario list, so it is 1. LICENSE contains the full GPL-3.0 text, so license is 3. There is no version number or changelog, so versioning_changelog is 0. README gives contact email and says the team may stop maintenance, but publisher identity is unverified and no governance is shown, so maintenance_responsibility is 1.
The bot can generate and send customer-service replies, and README screenshots show customer service, bargaining, and technical-expert scenarios, so output_usability is 2. It has clear marginal value for the narrow Xianyu auto-attendance use case, so marginal_value is 2. However, every conversation uses an LLM, and there is no token-cost, quota, rate-limit, or spend-control guidance, so cost_benefit is 1.
README claims partially correspond to main.py fragments for token handling, message sending, and manual mode, but there are no tests, benchmarks, or reproducible run records, so claim_traceability is 1. README, requirements.txt, and code fragments corroborate some capabilities, but the sample is incomplete, so cross_source_corroboration is 1. The feature matrix uses checkmarks and planned markers to distinguish implemented from planned work, so fact_inference_separation is 2, though explicit inference boundaries remain limited.
- Not found in source: confirmation before actingTurn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
- Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
- The bot requires an account-level Xianyu Cookie that is close to a full account session, creating account-security and platform-risk exposure; do not run it in untrusted environments, and use a dedicated account with minimal access.
- AI replies and automatic bargaining directly reach real buyers with no default pre-send confirmation and no undo mechanism; review reply policies and keep a human-takeover path before deployment.
- Full conversation history is sent to the LLM as context, but the repository does not describe retention, deletion, or log-redaction controls; add data-governance measures before processing buyer privacy data.
- Dependencies are version-pinned, but no lockfile, hashes, or security audit are shown; run dependency vulnerability scanning and create a reproducible environment yourself.
- README states the project may stop updating or be deleted at any time, and the publisher is unverified; long-term use carries maintenance and compatibility risk.
FAQ
Does it cost anything?
How does it log in to Xianyu?
Can I use a different LLM?
How do I take over a conversation manually?
Is it maintained long-term?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.