Skip to content

Development environment setup#1

Open
rockrxf78 wants to merge 2 commits into
masterfrom
cursor/development-environment-setup-880d
Open

Development environment setup#1
rockrxf78 wants to merge 2 commits into
masterfrom
cursor/development-environment-setup-880d

Conversation

@rockrxf78

Copy link
Copy Markdown
Owner

This PR introduces a new astrbot_plugin_smart_customer_service plugin. It solves the problem of needing an intelligent, AI-first customer service agent for sales inquiries, with a robust human fallback mechanism for complex cases. It leverages AstrBot's LLM capabilities to provide automated responses based on a defined "Sales Skill" and allows for seamless escalation to human agents.

Modifications / 改动点

  • New Plugin: Created astrbot_plugin_smart_customer_service/ with a modular architecture.

  • Core Managers: Implemented SessionManager (4-state machine), ConversationContextManager, CustomerProfileManager (SQLite), ProductManager (JSON), EscalationManager (queue), and TimeoutManager.

  • LLM Tools: Developed 5 LLM tools: query_product, check_order, escalate_to_human, update_customer_profile, create_lead.

  • AstrBot Integration: Integrated with AstrBot's event pipeline (@filter.on_llm_request(), @filter.on_llm_response(), @filter.event_message_type()) and added 9 command handlers.

  • Sales Skill: Defined a SKILL.md template for the LLM, outlining sales strategy, escalation rules, and behavioral guidelines.

  • Configuration & Docs: Added _conf_schema.json for Dashboard configuration, README.md, HelpTextBuilder, and a detailed research report.

  • Tests: Added 31 unit tests for the new plugin.

  • Documentation: Updated AGENTS.md with Cursor Cloud specific setup instructions.

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果


Plugin verification: loaded in dashboard, config panel working, all commands responding correctly.

Plugin installed and enabled in dashboard

Plugin configuration panel with all settings

/cs_help command returning full command list

/transfer_human command with queue position response

Testing Summary:

  • uv run ruff check astrbot_plugin_smart_customer_service/ — all checks passed
  • uv run ruff format astrbot_plugin_smart_customer_service/ — all files formatted
  • uv run pytest tests/test_smart_customer_service.py -v — 31 tests passed
  • uv run pytest -q tests/ — 696 total tests passed (665 original + 31 new), no regressions
  • ✅ Plugin loaded successfully in backend and appeared in Dashboard.
  • ✅ Manual testing of /cs_help, /transfer_human, /end_service commands confirmed correct functionality and session management.

Checklist / 检查清单

  • 😊 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。/ If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
  • 👀 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。/ My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
  • 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 requirements.txtpyproject.toml 文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
  • 😮 我的更改没有引入恶意代码。/ My changes do not introduce malicious code.

Open in Web Open in Cursor 

cursoragent and others added 2 commits March 9, 2026 00:14
Co-authored-by: rockrxf78 <rockrxf78@users.noreply.github.com>
…egration

- 4-state session machine (idle/ai_serving/waiting_human/human_connected/closed)
- ConversationContextManager with LRU eviction and LLM context injection
- CustomerProfileManager with SQLite persistence and lead tracking
- ProductManager with JSON-based product catalog and search
- EscalationManager with queue management for human agent handoff
- 5 LLM Tools: query_product, check_order, escalate_to_human, update_customer_profile, create_lead
- Sales Skill template (SKILL.md) for AI behavior guidance
- MessageRouter for session-state-based message routing
- TimeoutManager for conversation and queue timeouts
- Dashboard-friendly configuration schema
- 31 unit tests covering all managers

Co-authored-by: rockrxf78 <rockrxf78@users.noreply.github.com>
@cursor

cursor Bot commented Mar 14, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants