Skip to content

sr-networks/servicebot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Customer Service Agent v0.1

πŸ€– An intelligent customer service chatbot with MCP (Model Context Protocol) integration for accessing business data and providing automated support.

License: MIT React TypeScript MCP

πŸš€ Overview

This customer service bot provides automated support for businesses by intelligently accessing company datasets through the Model Context Protocol (MCP). It can answer customer inquiries about services, orders, products, and more by querying structured business data in real-time.

Key Capabilities

  • Data-Driven Responses: Access customer records, service history, inventory, and business information
  • Multi-LLM Support: Works with both local (Ollama) and cloud-based (OpenRouter) language models
  • Tool-Calling Architecture: Automatic data retrieval without manual intervention
  • Real-Time Monitoring: Complete visibility into data queries and system operations
  • Clean Interface: Filtered chat experience with technical details in separate monitoring panel

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   React UI      β”‚    β”‚   LLM Provider  β”‚    β”‚  Business Data  β”‚
β”‚                 β”‚    β”‚                 β”‚    β”‚                 β”‚
β”‚ β€’ Chat Interface│◄──►│ β€’ Ollama        │◄──►│ β€’ Customer DB   β”‚
β”‚ β€’ Provider Setupβ”‚    β”‚ β€’ OpenRouter    β”‚    β”‚ β€’ Service Logs  β”‚
β”‚ β€’ MCP Monitoringβ”‚    β”‚ β€’ Tool Calling  β”‚    β”‚ β€’ Product Info  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β–²                       β–²                       β–²
         β”‚                       β”‚                       β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   MCP Proxy     β”‚
                    β”‚                 β”‚
                    β”‚ β€’ Protocol Hub  β”‚
                    β”‚ β€’ Data Bridge   β”‚
                    β”‚ β€’ Tool Registry β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

⚑ Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn
  • (Optional) Ollama for local models
  • (Optional) OpenRouter API key for cloud models

Installation

  1. Clone the repository
git clone <repository-url>
cd customer-service-bot
  1. Install dependencies
# Frontend
cd app && npm install

# MCP Server
cd ../server && npm install

# MCP Tools
cd ../mcp-servers/repair-files && npm install
  1. Configure your data source
# Set your business data directory (use absolute path on your system)
export REPAIR_FILES_ROOT="$(pwd)/data"

πŸš€ Running the Application

Start All Services (Recommended)

# From project root
./scripts/start-all.sh

Manual Service Management

  1. Start MCP Proxy Server
cd server
REPAIR_FILES_ROOT="$(pwd)/../data" npm start
  1. Start Frontend
cd app
npm run dev
  1. Access the application

🎯 Features

Core Functionality

  • βœ… Intelligent Query Processing: Multi-iteration reasoning for complex customer requests
  • βœ… Real-Time Data Access: Live querying of business databases and files
  • βœ… Multi-Provider Support: Choice between local and cloud-based language models
  • βœ… Enhanced Monitoring: Detailed logging of all data operations
  • βœ… Clean Chat Interface: Customer-focused view with technical details hidden

Advanced Features

  • βœ… Tool Call Visualization: See exactly what data is being accessed
  • βœ… Parameter Tracking: Monitor search queries and file access patterns
  • βœ… Error Handling: Graceful degradation with helpful error messages
  • βœ… Iteration Control: Automatic continuation until customer question is fully answered

πŸ› οΈ Configuration

LLM Providers

Option 1: Ollama (Local)

# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

# Pull a model
ollama pull qwen3:8b

# Model will be available at localhost:11434

Option 2: OpenRouter (Cloud)

  1. Get API key from OpenRouter
  2. In the application, select "OpenRouter" provider
  3. Enter your API key
  4. Choose a model (e.g., anthropic/claude-3.5-sonnet)

Data Sources

The bot can be configured to access various business data sources:

// Example data structure
data/
β”œβ”€β”€ customers.json          // Customer records
β”œβ”€β”€ services.csv           // Service history
β”œβ”€β”€ products/             // Product information
β”œβ”€β”€ orders/              // Order tracking
└── knowledge-base/      // FAQ and policies

πŸ“Š Usage Examples

Customer Service Scenarios

Order Status Inquiry

Customer: "What's the status of my order #12345?"
Bot: [Accesses order database] β†’ "Your order #12345 was shipped yesterday and will arrive tomorrow via UPS."

Product Information

Customer: "Do you have brake pads for a 2018 Honda Civic?"
Bot: [Searches inventory] β†’ "Yes, we have OEM brake pads in stock for your 2018 Civic. Part #BP-HC18, $89.99."

Service History

Customer: "When was my last oil change?"
Bot: [Queries service records] β†’ "Your last oil change was on March 15th, 2024. Based on your driving, the next one is due around June 15th."

πŸ”§ Development

Project Structure

customer-service-bot/
β”œβ”€β”€ app/                    # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/     # UI components
β”‚   β”‚   β”œβ”€β”€ lib/           # Core logic
β”‚   β”‚   └── styles/        # CSS styles
β”œβ”€β”€ server/                # MCP proxy server
β”œβ”€β”€ mcp-servers/          # MCP tool implementations
β”œβ”€β”€ data/                 # Sample business data
└── docs/                 # Documentation

Development Commands

# Run tests
npm test

# Type checking
npm run type-check

# Linting
npm run lint

# Build for production
npm run build

Adding New Data Sources

  1. Create MCP tool for your data source
  2. Register tool in MCP server
  3. Update system prompt with tool descriptions
  4. Test with sample queries

πŸš€ Deployment

Production Build

# Build frontend
cd app && npm run build

# Build server
cd ../server && npm run build

# Deploy to your hosting platform

Environment Variables

REPAIR_FILES_ROOT="./data"  # Relative to project root
OPENROUTER_API_KEY="your-api-key"
MCP_SERVER_PORT=8787
FRONTEND_PORT=5173

🀝 Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

πŸ™ Acknowledgments


Version: 1.0.0 | Last Updated: December 2024

About

An LLM agent based customer service bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors