shaxiu/XianyuAutoAgent
Self-hosted Xianyu seller chat with LLM routing and stepwise bargaining
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Xianyu AutoAgent is a Python application specialized for Xianyu seller chat, with main.py as its entrypoint. The tree separates agent logic (XianyuAgent.py), platform integration (XianyuApis.py), and conversation context (context_manager.py). The runtime pins websockets==13.1 and requests==2.32.3 for networking, openai==1.65.5 for model access, python-dotenv==1.0.1 for configuration, and loguru==0.7.3 for logging.
The reply flow combines stored conversation history with LLM-based intent classification and routing rules, then selects a bargaining, technical-support, or default reply path. The four prompt roles in prompts/ are customization points for classification and generation. Here, “multi-expert” is best understood as specialized routing; the available interface does not establish a general-purpose agent or plugin platform.
Key Capabilities & Differentiators
The application combines context-aware automatic replies, stepwise price concessions, and web search for technical support. Sellers can toggle between automated handling and manual takeover with TOGGLE_KEYWORDS; SIMULATE_HUMAN_TYPING controls an optional reply delay. These controls make a supervised rollout possible without treating generated price responses as independently enforced business policy.
Qwen is the default model family. MODEL_BASE_URL and MODEL_NAME let operators change the endpoint and model, but a replacement should be tested against the OpenAI client and the classifier's expected behavior. Basic logging is implemented. Market-price comparison, RAG-backed knowledge, enhanced sentiment analysis, DingTalk integration, and web administration remain planned.
Trade-offs & Limitations
Compared with building on a general-purpose agent framework, this app supplies Xianyu-specific session integration and bargaining out of the box, at the cost of portability. The cookie-based integration depends on a valid session and continued platform compatibility. Compared with a support suite, the operational surface is much narrower: basic logs and manual takeover are available, but a web console is still planned and no direct commercial Xianyu substitute is verified.
Sending stored history to the model preserves continuity, but longer threads can increase token usage and expose more conversation data to an external provider. Routing and replies also inherit the endpoint's latency and availability. Test multi-turn bargaining and manual takeover before leaving it unattended, and check account automation rules and data handling separately from GPL-3.0 obligations on redistribution.
Hardware & Deployment Guide
The stated requirement is Python 3.8+. For a native installation, use an isolated environment, install requirements.txt, configure .env with API_KEY, COOKIES_STR, MODEL_BASE_URL, and MODEL_NAME, then launch python main.py. Prompt overrides can be supplied under prompts/; templates provide defaults. The agent host needs network access to Xianyu and the configured model endpoint. Self-hosting the application does not make it offline, nor does it require local GPU inference.
Compose runs shaxiu/xianyuautoagent:latest on a bridge network with restart: always and TZ=Asia/Shanghai. It mounts ./data, ./prompts, and ./.env at /app/data, /app/prompts, and /app/.env, respectively. No GitHub release is listed, so the latest tag is not a reproducible version pin. Record the tested image digest or source revision, protect the mounted credentials and chat data, and verify session recovery before unattended use.
openai==1.65.5 with configurable MODEL_BASE_URL and MODEL_NAME; Qwen is the default../data, ./prompts, and ./.env into /app with an always restart policy.Xianyu sellers piloting supervised replies for common inquiries and routine bargaining who can manage account sessions and test reply behavior.
You need offline operation, verified multi-channel support, mature administrative controls, or guaranteed pricing-policy enforcement.
Quick Start & Installation
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 #模拟人工回复延迟 注意:默认使用的模型是通义千问,如需使用其他API,请自行修改.env文件中的模型地址和模型名称; COOKIES_STR自行在闲鱼网页端获取cookies(网页端F12打开控制台,选择Network,点击Fetch/XHR,点击一个请求,查看cookies) 4. 创建提示词文件prompts/*_prompt.txt(也可以直接将模板名称中的_example去掉),否则默认读取四个提示词模板中的内容
Comparison vs. Top Agents & Frameworks Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| XianyuAutoAgent ★ | 9.9k | +149 | Python | GPL-3.0 | Self-hosted Xianyu seller chat with LLM routing and stepwise bargaining |
| bisheng | 12.5k | +71 | Python | Apache-2.0 | Self-hosted AI workspace for enterprise agents, knowledge, and app publishing |
| hermes-agent | 267.4k | +1.6k | Python | MIT | Self-hosted Python agent with persistent memory and automation across chat and C |
| dify | 162.2k | +388 | Python | — | Visual workflow and RAG workspace for building and serving LLM apps |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/shaxiu/XianyuAutoAgent.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about XianyuAutoAgent
Can I change how inquiries are routed without editing Python?
classify_prompt.txt to adjust intent classification and price_prompt.txt, tech_prompt.txt, or default_prompt.txt to tune the corresponding reply behavior. The configuration defines those roles; a general plugin or tool-registration interface is not established.Does the Docker host need a GPU, and how should I size it?
Can a business self-host it or distribute a modified image?
When is this preferable to a generic chatbot framework or a managed support desk?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy