Mercadinho Mercantes Multi-Agent AI Assistant

Mercadinho Mercantes Multi-Agent AI Assistant

A sophisticated MCP server that provides intelligent customer service for a Brazilian retail chain through multiple specialized AI agents that handle product inquiries, sales assistance, customer management, and store operations.

Category
Visit Server

README

Mercadinho Mercantes - Multi-Agent AI Assistant

Python Streamlit MCP OpenAI

A sophisticated multi-agent AI system for Mercadinho Mercantes, a Brazilian retail chain. This system provides intelligent customer service through multiple specialized AI agents that can handle product inquiries, sales assistance, customer management, and store operations.

🏪 About Mercadinho Mercantes

Mercadinho Mercantes is a proud Brazilian retail company with multiple locations across São Paulo and Rio de Janeiro. Our AI assistant system enhances customer experience by providing personalized product recommendations, promotional information, and seamless appointment scheduling.

✨ Features

🤖 Multi-Agent Architecture

  • Reception Agent: Welcomes customers and directs them to appropriate services
  • Sales Agent: Handles product inquiries, recommendations, and sales assistance
  • Customer Maintenance Agent: Manages existing customer accounts and special discounts

🛍️ Core Functionality

  • Product Catalog: Browse available products with pricing and inventory
  • Store Information: Find store locations and contact details
  • Promotional System: Access store-specific promotions and discounts
  • Customer Management: Track customer profiles and loyalty benefits
  • Appointment Scheduling: Book store visits and product reservations
  • Special Discounts: Exclusive offers for registered customers

🛠️ Technical Features

  • MCP Integration: Model Context Protocol for tool calling
  • Streamlit UI: Modern, responsive web interface
  • Real-time Chat: Interactive conversation with AI agents
  • Tool Visualization: Transparent view of AI tool usage
  • Session Management: Persistent conversation history

🚀 Quick Start

Prerequisites

  • Python 3.8 or higher
  • OpenAI API key
  • Git

Installation

  1. Clone the repository

    git clone <repository-url>
    cd mcp_mercadinho
    
  2. Install dependencies

    pip install -r requirements.txt
    
  3. Set up environment variables

    export OPENAI_API_KEY="your_openai_api_key_here"
    

    Or create a .env file:

    echo "OPENAI_API_KEY=your_openai_api_key_here" > .env
    

Running the Application

  1. Start the MCP server (in one terminal):

    mcp run server.py --transport sse
    
  2. Launch the Streamlit client (in another terminal):

    streamlit run chat_multi_agent_client.py
    
  3. Open your browser and navigate to the URL shown in the Streamlit output (typically http://localhost:8501)

🏗️ Architecture

System Components

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   Streamlit UI  │◄──►│  Multi-Agent     │◄──►│   MCP Server    │
│   (Frontend)    │    │  System          │    │   (Backend)     │
└─────────────────┘    └──────────────────┘    └─────────────────┘
                              │
                              ▼
                       ┌──────────────────┐
                       │  OpenAI GPT-4    │
                       │  (LLM Backend)   │
                       └──────────────────┘

Agent Roles

Reception Agent (RecepcaoAssistente)

  • Purpose: Initial customer contact and routing
  • Responsibilities:
    • Welcome customers to Mercadinho Mercantes
    • Present company information and website
    • Route customers to appropriate specialized agents
    • Handle general inquiries

Sales Agent (VendasAssistente)

  • Purpose: Product sales and recommendations
  • Responsibilities:
    • Show available products and inventory
    • Provide product recommendations
    • Handle promotional offers
    • Schedule store visits
    • Process sales inquiries

Customer Maintenance Agent (ManutencaoSocioAssistente)

  • Purpose: Existing customer support and loyalty management
  • Responsibilities:
    • Verify customer membership status
    • Apply special discounts for members
    • Handle product reservations
    • Manage customer accounts

Available Tools (MCP Functions)

Tool Description Parameters
get_produtos_disponiveis() Retrieve available products None
get_lojas() Get store locations and information None
get_promocao_por_loja(id_loja) Get promotions for specific store id_loja: int
get_info_cliente(nome) Get customer information nome: str
reservar_pedido_com_desconto() Reserve order with discount id_loja, id_cliente, data_hora
agenda_visita_para_compra() Schedule store visit id_loja, data_hora

📊 Data Structure

Products

  • Categories: Hortifruit, Electronics
  • Information: ID, name, category, price, quantity
  • Examples: Bananas, Apples, PlayStation 5, LED TV

Stores

  • Locations: São Paulo (Parelheiros, Mooca), Guarujá, Santo André, Rio de Janeiro (Ipanema, Nova Iguaçu)
  • Information: ID, name, city, state

Customers

  • Types: Regular customers, Members (with special discounts)
  • Information: ID, name, associated store, discount eligibility

🎯 Usage Examples

Product Inquiry

User: "What products do you have available?"
Agent: [Shows product catalog with prices and availability]

Store Visit Scheduling

User: "I want to visit a store to see the PlayStation 5"
Agent: [Finds nearest store, checks promotions, schedules visit]

Customer Discount Check

User: "My name is John Lennon, do I have any special discounts?"
Agent: [Verifies membership, applies special pricing]

🔧 Configuration

Environment Variables

  • OPENAI_API_KEY: Your OpenAI API key for GPT-4 access

Model Settings

  • Model: GPT-4-1106-preview
  • Temperature: 0 (deterministic responses)
  • Tool Choice: Auto
  • Parallel Tool Calls: Disabled

🛡️ Security Considerations

  • API keys should be stored securely in environment variables
  • Never commit API keys to version control
  • Use .env files for local development
  • Consider implementing rate limiting for production use

🤝 Contributing

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

📝 License

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

🆘 Support

For support and questions:

🔮 Future Enhancements

  • [ ] Integration with real inventory systems
  • [ ] Payment processing capabilities
  • [ ] Multi-language support (Portuguese/English)
  • [ ] Mobile app development
  • [ ] Advanced analytics and reporting
  • [ ] Integration with CRM systems

Built with ❤️ for Mercadinho Mercantes

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured