Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

Version 1 Current »

This is the overall structure of how the service should be created
Technical Architecture Explanation

Screenshot 2024-02-02 at 8.22.46 PM.png

"Orderbuy.ai" is designed as a scalable, modular system that enables voice ordering capabilities for merchants, integrating seamlessly with various Point of Sale (POS) systems like Toast POS, Clover POS, and Square POS, DeliverLogic, Chowly, Checkmate, Olo. At its core, the architecture facilitates easy adoption by third-party platforms and their merchants, supporting multiple integration methods similar to Stripe Connect's model.

Core Components:

  • API Gateway: Serves as the primary entry point for all incoming requests, ensuring secure access, routing to appropriate services, and API rate limiting. It supports OAuth2 for secure API access by third-party platforms.

  • Voice Processing Service: Utilizes advanced AI for speech-to-text conversion, interfacing with external services like Twilio for voice input. This component is critical for converting customer voice orders into a structured format that can be processed by the system.

  • Order Management Service: Manages order creation, validation, and status updates. It interfaces with POS systems for real-time order tracking and inventory management.

  • Payment Processing Service: Handles secure transactions, integrating with payment gateways like Stripe. It also facilitates merchant account management and transaction reconciliation.

  • Platform Integration Service: The linchpin for third-party platform integration, offering APIs, SDKs, and support for Direct API Access, Embedded Solutions, and Marketplace Apps. This service ensures that third-party platforms can offer "orderbuy.ai" functionalities to their merchants in a flexible and customizable manner.

  • Merchant and Menu Management Services: Allow merchants to manage their profiles, subscription plans, and menus. These services ensure that the merchant's offerings are accurately represented and up-to-date in the voice ordering system.

  • Notification Service: Sends real-time alerts and updates to merchants and customers, enhancing the ordering experience.

  • Integration Documentation and Developer Portal: Provides essential resources, including API documentation, integration guides, and technical support forums, facilitating third-party developers during the integration process.

Integration Methods:

  1. Direct API Access: For platforms that want deep integration with custom workflows.

  2. Embedded Solutions: Offers a plug-and-play approach with widgets or UI components that can be directly embedded into the platform's interface.

  3. Marketplace Apps: Enables platforms to add "orderbuy.ai" as an app within their marketplace, simplifying the adoption process for merchants.

  4. Custom Integration Support: Tailored assistance for unique integration needs, ensuring that any platform can seamlessly integrate "orderbuy.ai" services.

Development Considerations:

  • Scalability and Modularity: Each component is designed as a microservice, allowing for independent scaling and deployment. This approach facilitates rapid iteration and deployment cycles.

  • Security and Compliance: Implementing best practices in security, including data encryption in transit and at rest, and compliance with relevant standards (e.g., PCI DSS for payment processing).

Developer Experience (DX): A focus on creating a positive developer experience through comprehensive documentation, easy-to-use APIs, and active developer support channels.



Developing Middleware Bot: A Guide for Developers

This is what was provided to developers that were helping develop the middleware Bot

Your objective with this initial phase of the system is to develop and test a middleware conversational Voice/Phone ordering bot for a restaurant environment. The key goals and functionalities for this phase are as follows:

The system should work like this companies but better: https://foreva.ai/

Overall Description (Microservice Middleware)

Our devs will tie our system in

  1. Conversational Interaction: The system should be capable of conducting a natural, fluid conversation with customers. This involves understanding and responding to various customer queries and requests in a way that mimics human interaction.

  2. Data Capture and Storage: The bot must accurately capture and store key information provided by the customer during the conversation. This includes the customer's name, order details (like takeout or delivery, specific dishes ordered, any special instructions), and payment information. (this can be small and temporary, you can even store it in a google spreadsheet)

  3. Understanding Complex Menu Options: A significant challenge for the system is to navigate through complex menu options. I plan to provide the bot with 3 to 4 menus that include a variety of items with numerous options, side options, and specific requirements (such as minimum and maximum quantities for certain items). The system should be able to handle these complexities effectively.

  4. API Integration: The system should be integrated with our API that contains all the necessary information about the menus. This integration is crucial for the bot to access real-time data about menu items, options, and other relevant details.

  5. Handling Required Fields and Optional Choices: The bot should be able to identify and prompt for required fields (such as delivery address for a delivery order) and understand optional choices (like add-ons for a dish). It needs to ensure that all necessary information for an order is collected, while also offering and managing optional selections as per the customer’s preference.

  6. Testing with Challenging Scenarios: You intend to test the system with challenging scenarios to ensure its robustness. This involves providing menus with complex structures and requirements to see how well the bot can navigate and fulfill these orders.

  7. Make the bot modular and agnostic: We should not be dependent on twilio, we should be able to use another service like http://bandwidth.com or another phone service, we should also be able to use the system within an app by opening up a microphone.

  8. Order Optimization with LLAMA Principles:

  • The bot uses a conversational approach to minimize back-and-forth, anticipating customer needs and preferences based on their selections and the LLAMA model's guidelines for efficient interaction.

  • It suggests combinations or popular choices when appropriate to streamline the decision-making process, such as mentioning favorite combos or highlighting new options.

BOT Flow

Unknown/New Customer

  1. Introduction and Name Capture:

    • Bot Prompt: "Hello and thank you for calling [restaurant name]. May I have your name for the order?"

    • Capture: Customer's name.

  2. Order Type (Takeout or Delivery):

    • Bot Prompt: "Great, [customer's name]. Will this be for takeout or delivery?"

    • Capture: Choice between takeout or delivery.

  3. Delivery Address (If Delivery Selected):

    • Bot Prompt (only if delivery is chosen): "Could you please provide your delivery address?"

    • Capture: Delivery address.

  4. Order Timing (ASAP or Scheduled):

    • Bot Prompt: "Would you like your order as soon as possible or at a specific time?"

    • Capture: Choice of ASAP or a specific date and time.

  5. Menu to use (future development): Once all the above is captured, the bot should know what menu ID to use in api, because the breakfast menu will be different than the dinner menu for the specific vendor.

  6. Taking the Order:

    • Bot Prompt: "What would you like to order today?"

    • Capture: Each item ordered by the customer.

  7. Options and Add-ons (For Each Item):

    • Bot Prompt (for items with options): "Would you like to add any extras or options to this?"

    • Capture: Any added options or extras.

  8. Inquiry for Additional Items:

    • Bot Prompt: "Would you like to add anything else to your order?"

    • Capture: Additional items or confirmation that the order is complete.

  9. Recap of Order:

    • Bot Prompt: "Let me repeat your order for confirmation..."

    • Recap: The complete order as understood by the bot.

  10. Total Cost Announcement:

    • Bot Prompt: "Your total, including tax, comes to [total amount]."

    • Inform: Total amount of the order.

  11. Payment Information:

    • Bot Prompt: "Please provide your credit card number, CVV, and zip code for payment."

    • Capture: Credit card details.

  12. Email for Order Tracking:

    • Bot Prompt: "Would you like to receive email confirmation for your order tracking?"

    • If yes: "Please provide your email address."

    • Capture: Email address (if the customer wants email confirmation).

  13. Completion and Thanks:

Bot Prompt: "Thank you, [customer's name], for your order. You will receive a confirmation [via email/shortly]. Have a great day!"

                              Repeat Customer (future development)

  1. Repeat Customer Recognition and Greeting: Bot Prompt: "Welcome back to [restaurant name], [customer's name]! It's great to have you again. Would you like to place a new order or reorder your last meal?"

  2. Order Type Confirmation (if not reordering): Bot Prompt: "Would you like this to be for takeout or delivery today?"

  3. Delivery Confirmation (If Delivery is Selected and Reordering): Bot Prompt: "Shall we deliver to your usual address: [customer's delivery address]?"

  4. Order Timing: Bot Prompt: "Do you want your order as soon as possible, or would you prefer it at a specific time?"

  5. Taking the New Order (if not reordering): Bot Prompt: "What can I get for you today?"

To ensure that a phone ordering bot understands all the required fields, options, and sub-options from a restaurant menu JSON file, while also recognizing which options are not required, you can follow these guidelines:

  1. Identify Required Fields: Clearly define which fields are mandatory for each menu item. For instance, in the provided JSON, min_required within an option specifies the minimum number of sub-options that must be selected. The bot must be programmed to understand that a certain number of selections are necessary for these options.

  2. Parse Optional Fields: Some options may not have a min_required field, indicating that they are optional. The bot should allow users to skip these options or provide a way to specify their choices if they wish.

  3. Handle Sub-options: Each option can have multiple sub-options. The bot should present these to the user and enforce any minimum requirements, if specified, while also allowing for optional choices.

  4. Understand Price Modifications: Notice that some sub-options might add extra cost (price, cost_floor, and cost_default fields). The bot should account for these variations in price when users select these options and provide a running total.

  5. Dynamic Interaction: Design the bot interaction flow to dynamically adapt to the user's selections, asking for choices within the required options first and then moving to optional ones, while keeping track of their decisions.

  6. Validation and Confirmation: Implement validation logic to ensure that all required selections are made before proceeding. Offer a summary of selections for user confirmation, including any additional costs.

  7. Flexible Parsing: Ensure your bot's parsing logic is robust and flexible enough to handle various menu structures, as they can significantly differ between restaurants.

Example of Menu ordering (step 6 above):

MENU TESTING:
Use MID 20 : JSON: https://drive.google.com/file/d/1-ka3hmJ6non5y0Kf-H-BmGdSvcp68Oaz/view?usp=sharing

Use MIID 518 = Large Bol
Json file = https://drive.google.com/file/d/14rgWFVqRsMA3-roAanSaXegDigURImpY/view?usp=sharing

*BOT STARTS WITH MID 20

Bot: Let's start with the order! What would you like?

Customer: "Can you tell me what specific bols are available on the menu?"

Bot: "Sure! On our menu, we have options like the Large Bol, Regular Bol, and Kids Bol under 'Build Your Own Bol!'. Additionally, there are Chef Inspired Bols like Baja Lemon Chicken, Teriyaki Chicken & Rice, Classic Lemon Chicken, Thai Shrimp & Noodles, Vegan Miso Tofu, and Havana Pulled Pork."

Customer: "What's the difference between the Large Bol and the Regular Bol?"

Bot: "The Large Bol is a larger portion size, allowing for more bases, veggie, and protein selections, ideal for those with a bigger appetite or wanting extra for later. The Regular Bol is a standard size, perfect for a satisfying meal without the extras. Both offer customizable options to mix and match your favorite ingredients."

Customer: "I see, I'll go with the Large Bol then. I'm really hungry!"

*BOT now knows MIID 518

Bot: "Absolutely! For the Large Bol, you can choose your bases and veggies, proteins, and add toppings. 

Customer: "I know what I want. Give me Jasmine Rice, Forbidden Black Rice, and Cilantro Noodles."

Bot: "You've chosen 3 bases/veggies. You need at least one more base or veggie."

Customer: "Add Baby Spinach to that."

Bot: "Perfect! Now, let's select your proteins. You need at least 2."

Customer: "What are my protein options?"

Bot: "We have Lemon Chicken, Teriyaki Chicken, BBQ Chicken, Mojo Pulled Pork, Miso Glazed Tofu, Avocado, and Spicy Thai Shrimp, which has an additional cost."

Customer: "Add Lemon Chicken and Miso Glazed Tofu."

Bot: "Great choices! How about toppings? You need at least 1."

Customer: "Just Parmesan Cheese for the topping."

Bot: "Would you like any premium add-ons or sauces? They're optional."

Customer: "What sauces do you have?"

Bot: "We offer Cilantro Pesto Sauce, Spicy Thai Sauce, Sriracha Sauce, Creamy Garlic & Herb Sauce, or No Sauce."

Customer: "I'll take the Sriracha Sauce, and add Fresh Sliced Avocado as a premium add-on."

Bot: "Got it! Your Large Bol will include Jasmine Rice, Forbidden Black Rice, Cilantro Noodles, Baby Spinach, Lemon Chicken, Miso Glazed Tofu, Parmesan Cheese, Sriracha Sauce, and Fresh Sliced Avocado. The total is [calculated price]. Is your order complete?"

Customer: "Yes, that's everything."

Resources for understanding integration

Here is a video to watch explaining the API and such: https://drive.google.com/file/d/1oTm3GHhFj-XwHHqaZ4Hua0SuRr_KkHo7/view?usp=sharing

Please use: Use MID 20
Use MIID 518 = Large Bol
Json file = https://drive.google.com/file/d/14rgWFVqRsMA3-roAanSaXegDigURImpY/view?usp=sharing


  • No labels