Close Menu
    Main Menu
    • Home
    • News
    • Tech
    • Robotics
    • ML & Research
    • AI
    • Digital Transformation
    • AI Ethics & Regulation
    • Thought Leadership in AI

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Wiz Uncovers Vital Entry Bypass Flaw in AI-Powered Vibe Coding Platform Base44

    July 30, 2025

    AI vs. AI: Prophet Safety raises $30M to interchange human analysts with autonomous defenders

    July 30, 2025

    A Deep Dive into Picture Embeddings and Vector Search with BigQuery on Google Cloud

    July 30, 2025
    Facebook X (Twitter) Instagram
    UK Tech InsiderUK Tech Insider
    Facebook X (Twitter) Instagram
    UK Tech InsiderUK Tech Insider
    Home»Machine Learning & Research»Automate buyer help with Amazon Bedrock, LangGraph, and Mistral fashions
    Machine Learning & Research

    Automate buyer help with Amazon Bedrock, LangGraph, and Mistral fashions

    Oliver ChambersBy Oliver ChambersJune 11, 2025No Comments17 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr Email Reddit
    Automate buyer help with Amazon Bedrock, LangGraph, and Mistral fashions
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link


    AI brokers are remodeling the panorama of buyer help by bridging the hole between giant language fashions (LLMs) and real-world purposes. These clever, autonomous programs are poised to revolutionize customer support throughout industries, ushering in a brand new period of human-AI collaboration and problem-solving. By harnessing the facility of LLMs and integrating them with specialised instruments and APIs, brokers can deal with advanced, multistep buyer help duties that have been beforehand past the attain of conventional AI programs.As we glance to the longer term, AI brokers will play a vital function within the following areas:

    • Enhancing decision-making – Offering deeper, context-aware insights to enhance buyer help outcomes
    • Automating workflows – Streamlining customer support processes, from preliminary contact to decision, throughout numerous channels
    • Human-AI interactions – Enabling extra pure and intuitive interactions between prospects and AI programs
    • Innovation and information integration – Producing new options by combining various information sources and specialised information to deal with buyer queries extra successfully
    • Moral AI practices – Serving to present extra clear and explainable AI programs to deal with buyer considerations and construct belief

    Constructing and deploying AI agent programs for buyer help is a step towards unlocking the complete potential of generative AI on this area. As these programs evolve, they may remodel customer support, broaden prospects, and open new doorways for AI in enhancing buyer experiences.

    On this put up, we exhibit use Amazon Bedrock and LangGraph to construct a customized buyer help expertise for an ecommerce retailer. By integrating the Mistral Massive 2 and Pixtral Massive fashions, we information you thru automating key buyer help workflows corresponding to ticket categorization, order particulars extraction, injury evaluation, and producing contextual responses. These ideas are relevant throughout numerous industries, however we use the ecommerce area as our main instance to showcase the end-to-end implementation and finest practices. This put up supplies a complete technical walkthrough that will help you improve your customer support capabilities and discover the newest developments in LLMs and multimodal AI.

    LangGraph is a robust framework constructed on high of LangChain that allows the creation of cyclical, stateful graphs for advanced AI agent workflows. It makes use of a directed graph construction the place nodes symbolize particular person processing steps (like calling an LLM or utilizing a instrument), edges outline transitions between steps, and state is maintained and handed between nodes throughout execution. This structure is especially invaluable for buyer help automation involving workflows. LangGraph’s benefits embrace built-in visualization, logging (traces), human-in-the-loop capabilities, and the flexibility to arrange advanced workflows in a extra maintainable manner than conventional Python code.This put up supplies particulars on do the next:

    • Use Amazon Bedrock and LangGraph to construct clever, context-aware buyer help workflows
    • Combine information in a helpdesk instrument, like JIRA, within the LangChain workflow
    • Use LLMs and imaginative and prescient language fashions (VLMs) within the workflow to carry out context-specific duties
    • Extract info from photographs to assist in decision-making
    • Examine photographs to evaluate product injury claims
    • Generate responses for the client help tickets

    Answer overview

    This resolution includes the purchasers initiating help requests via e mail, that are mechanically transformed into new help tickets in Atlassian Jira Service Administration. The shopper help automation resolution then takes over, figuring out the intent behind every question, categorizing the tickets, and assigning them to a bot person for additional processing. The answer makes use of LangGraph to orchestrate a workflow involving AI brokers to extracts key identifiers corresponding to transaction IDs and order numbers from the help ticket. It analyzes the question and makes use of these identifiers to name related instruments, extracting extra info from the database to generate a complete and context-aware response. After the response is ready, it’s up to date in Jira for human help brokers to assessment earlier than sending the response again to the client. This course of is illustrated within the following determine. This resolution is able to extracting info not solely from the ticket physique and title but additionally from hooked up photographs like screenshots and exterior databases.

    The answer makes use of two basis fashions (FMs) from Amazon Bedrock, every chosen primarily based on its particular capabilities and the complexity of the duties concerned. For example, the Pixtral mannequin is used for vision-related duties like picture comparability and ID extraction, whereas the Mistral Massive 2 mannequin handles a wide range of duties like ticket categorization, response era, and power calling. Moreover, the answer contains fraud detection and prevention capabilities. It may possibly determine fraudulent product returns by evaluating the inventory product picture with the returned product picture to confirm in the event that they match and assess whether or not the returned product is genuinely broken. This integration of superior AI fashions with automation instruments enhances the effectivity and reliability of the client help course of, facilitating well timed resolutions and safety in opposition to fraudulent actions. LangGraph supplies a framework for orchestrating the data move between brokers, that includes built-in state administration and checkpointing to facilitate seamless course of continuity. This performance permits the inclusion of preliminary ticket summaries and descriptions within the State object, with extra info appended in subsequent steps of the workflows. By sustaining this evolving context, LangGraph permits LLMs to generate context-aware responses. See the next code:

    # class to carry state info
    
    class JiraAppState(MessagesState):
        key: str
        abstract: str
        description: str
        attachments: listing
        class: str
        response: str
        transaction_id: str
        order_no: str
        utilization: listing

    The framework integrates effortlessly with Amazon Bedrock and LLMs, supporting task-specific diversification through the use of cost-effective fashions for less complicated duties whereas decreasing the dangers of exceeding mannequin quotas. Moreover, LangGraph affords conditional routing for dynamic workflow changes primarily based on intermediate outcomes, and its modular design facilitates the addition or elimination of brokers to increase system capabilities.

    Accountable AI

    It’s essential for buyer help automation purposes to validate inputs and ensure LLM outputs are safe and accountable. Amazon Bedrock Guardrails can considerably improve buyer help automation purposes by offering configurable safeguards that monitor and filter each person inputs and AI-generated responses, ensuring interactions stay secure, related, and aligned with organizational insurance policies. Through the use of options corresponding to content material filters, which detect and block dangerous classes like hate speech, insults, sexual content material, and violence, in addition to denied matters to assist stop discussions on delicate or restricted topics (for instance, authorized or medical recommendation), buyer help purposes can keep away from producing or amplifying inappropriate or defiant info. Moreover, guardrails may also help redact personally identifiable info (PII) from dialog transcripts, defending person privateness and fostering belief. These measures not solely scale back the chance of reputational hurt and regulatory violations but additionally create a extra optimistic and safe expertise for purchasers, permitting help groups to give attention to resolving points effectively whereas sustaining excessive requirements of security and accountability.

    The next diagram illustrates this structure.

    Guardrails

    Observability

    Together with Accountable AI, observability is important for buyer help purposes to offer deep, real-time visibility into mannequin efficiency, utilization patterns, and operational well being, enabling groups to proactively detect and resolve points. With complete observability, you’ll be able to monitor key metrics corresponding to latency and token consumption, and observe and analyze enter prompts and outputs for high quality and compliance. This stage of perception helps determine and mitigate dangers like hallucinations, immediate injections, poisonous language, and PII leakage, serving to ensure that buyer interactions stay secure, dependable, and aligned with regulatory necessities.

    Conditions

    On this put up, we use Atlassian Jira Service Administration for instance. You need to use the identical basic strategy to combine with different service administration instruments that present APIs for programmatic entry. The configuration required in Jira contains:

    • A Jira service administration undertaking with API token to allow programmatic entry
    • The next customized fields:
      • Title: Class, Kind: Choose Listing (a number of selections)
      • Title: Response, Kind: Textual content Subject (multi-line)
    • A bot person to assign tickets

    The next code exhibits a pattern Jira configuration:

    JIRA_API_TOKEN = ""
    JIRA_USERNAME = ""
    JIRA_INSTANCE_URL = "https://.atlassian.web/"
    JIRA_PROJECT_NAME = ""
    JIRA_PROJECT_KEY = ""
    JIRA_BOT_USER_ID = ''

    Along with Jira, the next providers and Python packages are required:

    • A legitimate AWS account.
    • An AWS Id and Entry Administration (IAM) function within the account that has ample permissions to create the required sources.
    • Entry to the next fashions hosted on Amazon Bedrock:
      • Mistral Massive 2 (mannequin ID: mistral.mistral-large-2407-v1:0).
      • Pixtral Massive (mannequin ID: us.mistral.pixtral-large-2502-v1:0). The Pixtral Massive mannequin is offered in Amazon Bedrock underneath cross-Area inference profiles.
    • A LangGraph utility up and operating regionally. For directions, see Quickstart: Launch Native LangGraph Server.

    For this put up, we use the us-west-2 AWS Area. For particulars on obtainable Areas, see Amazon Bedrock endpoints and quotas.

    The supply code of this resolution is offered within the GitHub repository. That is an instance code; it’s best to conduct your personal due diligence and cling to the precept of least privilege.

    Implementation with LangGraph

    On the core of buyer help automation is a set of specialised instruments and capabilities designed to gather, analyze, and combine information from service administration programs and a SQLite database. These instruments function the muse of our system, empowering it to ship context-aware responses. On this part, we delve into the important parts that energy our system.

    BedrockClient class

    The BedrockClient class is applied within the cs_bedrock.py file. It supplies a wrapper for interacting with Amazon Bedrock providers, particularly for managing language fashions and content material security guardrails in buyer help purposes. It simplifies the method of initializing language fashions with applicable configurations and managing content material security guardrails. This class is utilized by LangChain and LangGraph to invoke LLMs on Amazon Bedrock.

    This class additionally supplies strategies to create guardrails for accountable AI implementation. The next Amazon Bedrock Guardrails coverage filters sexual, violence, hate, insults, misconducts, and immediate assaults, and helps stop fashions from producing inventory and funding recommendation, profanity, hate, violent and sexual content material. Moreover, it helps stop exposing vulnerabilities in fashions by assuaging immediate assaults.

    # guardrails coverage
    
    contentPolicyConfig={
        'filtersConfig': [
            {
                'type': 'SEXUAL',
                'inputStrength': 'MEDIUM',
                'outputStrength': 'MEDIUM'
            },
            {
                'type': 'VIOLENCE',
                'inputStrength': 'MEDIUM',
                'outputStrength': 'MEDIUM'
            },
            {
                'type': 'HATE',
                'inputStrength': 'MEDIUM',
                'outputStrength': 'MEDIUM'
            },
            {
                'type': 'INSULTS',
                'inputStrength': 'MEDIUM',
                'outputStrength': 'MEDIUM'
            },
            {
                'type': 'MISCONDUCT',
                'inputStrength': 'MEDIUM',
                'outputStrength': 'MEDIUM'
            },
            {
                'type': 'PROMPT_ATTACK',
                'inputStrength': 'LOW',
                'outputStrength': 'NONE'
            }
        ]
    },
    wordPolicyConfig={
        'wordsConfig': [
            {'text': 'stock and investment advice'}
        ],
        'managedWordListsConfig': [
            {'type': 'PROFANITY'}
        ]
    },
    contextualGroundingPolicyConfig={
        'filtersConfig': [
            {
                'type': 'GROUNDING',
                'threshold': 0.65
            },
            {
                'type': 'RELEVANCE',
                'threshold': 0.75
            }
        ]
    }

    Database class

    The Database class is outlined within the cs_db.py file. This class is designed to facilitate interactions with a SQLite database. It’s chargeable for creating an area SQLite database and importing artificial information associated to prospects, orders, refunds, and transactions. By doing so, it makes positive that the required information is available for numerous operations. Moreover, the category contains handy wrapper capabilities that simplify the method of querying the database.

    JiraSM class

    The JiraSM class is applied within the cs_jira_sm.py file. It serves as an interface for interacting with Jira Service Administration. It establishes a connection to Jira through the use of the API token, person identify, and occasion URL, all of that are configured within the .env file. This setup supplies safe and versatile entry to the Jira occasion. The category is designed to deal with numerous ticket operations, together with studying tickets and assigning them to a preconfigured bot person. Moreover, it helps downloading attachments from tickets and updating customized fields as wanted.

    CustomerSupport class

    The CustomerSupport class is applied within the cs_cust_support_flow.py file. This class encapsulates the client help processing logic through the use of LangGraph and Amazon Bedrock. Utilizing LangGraph nodes and instruments, this class orchestrates the client help workflow. The workflow initially determines the class of the ticket by analyzing its content material and classifying it as associated to transactions, deliveries, refunds, or different points. It updates the help ticket with the class detected. Following this, the workflow extracts pertinent info corresponding to transaction IDs or order numbers, which could contain analyzing each textual content and pictures, and queries the database for related particulars. The following step is response era, which is context-aware and adheres to content material security tips whereas sustaining knowledgeable tone. Lastly, the workflow integrates with Jira, assigning classes, updating responses, and managing attachments as wanted.

    The LangGraph orchestration is applied within the build_graph operate, as illustrated within the following code. This operate additionally generates a visible illustration of the workflow utilizing a Mermaid graph for higher readability and understanding. This setup helps an environment friendly and structured strategy to dealing with buyer help duties.

    def build_graph(self):
        """
        This operate prepares LangGraph nodes, edges, conditional edges, compiles the graph and shows it 
        """
    
        # create StateGraph object
        graph_builder = StateGraph(JiraAppState)
    
        # add nodes to the graph
        graph_builder.add_node("Decide Ticket Class", self.determine_ticket_category_tool)
        graph_builder.add_node("Assign Ticket Class in JIRA", self.assign_ticket_category_in_jira_tool)
        graph_builder.add_node("Extract Transaction ID", self.extract_transaction_id_tool)
        graph_builder.add_node("Extract Order Quantity", self.extract_order_number_tool)
        graph_builder.add_node("Discover Transaction Particulars", self.find_transaction_details_tool)
        
        graph_builder.add_node("Discover Order Particulars", self.find_order_details_tool)
        graph_builder.add_node("Generate Response", self.generate_response_tool)
        graph_builder.add_node("Replace Response in JIRA", self.update_response_in_jira_tool)
    
        graph_builder.add_node("instruments", ToolNode([StructuredTool.from_function(self.assess_damaged_delivery), StructuredTool.from_function(self.find_refund_status)]))
        
        # add edges to attach nodes
        graph_builder.add_edge(START, "Decide Ticket Class")
        graph_builder.add_edge("Decide Ticket Class", "Assign Ticket Class in JIRA")
        graph_builder.add_conditional_edges("Assign Ticket Class in JIRA", self.decide_ticket_flow_condition)
        graph_builder.add_edge("Extract Order Quantity", "Discover Order Particulars")
        
        graph_builder.add_edge("Extract Transaction ID", "Discover Transaction Particulars")
        graph_builder.add_conditional_edges("Discover Order Particulars", self.order_query_decision, ["Generate Response", "tools"])
        graph_builder.add_edge("instruments", "Generate Response")
        graph_builder.add_edge("Discover Transaction Particulars", "Generate Response")
        
        graph_builder.add_edge("Generate Response", "Replace Response in JIRA")
        graph_builder.add_edge("Replace Response in JIRA", END)
    
        # compile the graph
        checkpoint = MemorySaver()
        app = graph_builder.compile(checkpointer=checkpoint)
        self.graph_app = app
        self.util.log_data(information="Workflow compiled efficiently", ticket_id='NA')
    
        # Visualize the graph
        show(Picture(app.get_graph().draw_mermaid_png(draw_method=MermaidDrawMethod.API)))
    
        return app

    LangGraph generates the next Mermaid diagram to visually symbolize the workflow.

    Mermaid diagram

    Utility class

    The Utility class, applied within the cs_util.py file, supplies important capabilities to help the client help automation. It encompasses utilities for logging, file dealing with, utilization metric monitoring, and picture processing operations. The category is designed as a central hub for numerous helper strategies, streamlining frequent duties throughout the appliance. By consolidating these operations, it promotes code reusability and maintainability inside the system. Its performance makes positive that the automation framework stays environment friendly and arranged.

    A key function of this class is its complete logging capabilities. It supplies strategies to log informational messages, errors, and vital occasions straight into the cs_logs.log file. Moreover, it tracks Amazon Bedrock LLM token utilization and latency metrics, facilitating detailed efficiency monitoring. The category additionally logs the execution move of application-generated prompts and LLM generated responses, aiding in troubleshooting and debugging. These log information will be seamlessly built-in with customary log pusher brokers, permitting for automated switch to most popular log monitoring programs. This integration makes positive that system exercise is completely monitored and rapidly accessible for evaluation.

    Run the agentic workflow

    Now that the client help workflow is outlined, it may be executed for numerous ticket sorts. The next capabilities use the offered ticket key to fetch the corresponding Jira ticket and obtain obtainable attachments. Moreover, they initialize the State object with particulars such because the ticket key, abstract, description, attachment file path, and a system immediate for the LLM. This State object is used all through the workflow execution.

    def generate_response_for_ticket(ticket_id: str):
        
        llm, vision_llm, llm_with_guardrails = bedrock_client.init_llms(ticket_id=ticket_id)
        cust_support = CustomerSupport(llm=llm, vision_llm=vision_llm, llm_with_guardrails=llm_with_guardrails)
        app   = cust_support.build_graph()
        
        state = cust_support.get_jira_ticket(key=ticket_id)
        state = app.invoke(state, thread)
        
        util.log_usage(state['usage'], ticket_id=ticket_id)
        util.log_execution_flow(state["messages"], ticket_id=ticket_id)
        

    The next code snippet invokes the workflow for the Jira ticket with key AS-6:

    # initialize lessons and create bedrock guardrails
    bedrock_client = BedrockClient()
    util = Utility()
    guardrail_id = bedrock_client.create_guardrail()
    
    # course of a JIRA ticket
    generate_response_for_ticket(ticket_id='AS-6')

    The next screenshot exhibits the Jira ticket earlier than processing. Discover that the Response and Class fields are empty, and the ticket is unassigned.

    Support Ticket - Initial

    The next screenshot exhibits the Jira ticket after processing. The Class area is up to date as Refunds and the Response area is up to date by the AI-generated content material.

    Support Ticket - updated

    This logs LLM utilization info as follows:

    Mannequin                              Enter Tokens  Output Tokens Latency 
    mistral.mistral-large-2407-v1:0      385               2         653  
    mistral.mistral-large-2407-v1:0      452              27         884      
    mistral.mistral-large-2407-v1:0     1039              36        1197   
    us.mistral.pixtral-large-2502-v1:0  4632             425        5952   
    mistral.mistral-large-2407-v1:0     1770             144        4556  

    Clear up

    Delete any IAM roles and insurance policies created particularly for this put up. Delete the native copy of this put up’s code.

    Should you not want entry to an Amazon Bedrock FM, you’ll be able to take away entry from it. For directions, see Add or take away entry to Amazon Bedrock basis fashions.

    Delete the momentary information and guardrails used on this put up with the next code:

    shutil.rmtree(util.get_temp_path())
    bedrock_client.delete_guardrail()

    Conclusion

    On this put up, we developed an AI-driven buyer help resolution utilizing Amazon Bedrock, LangGraph, and Mistral fashions. This superior agent-based workflow effectively handles various buyer queries by integrating a number of information sources and extracting related info from tickets or screenshots. It additionally evaluates injury claims to mitigate fraudulent returns. The answer is designed with flexibility, permitting the addition of latest circumstances and information sources as companies have to evolve. With this multi-agent strategy, you’ll be able to construct strong, scalable, and clever programs that redefine the capabilities of generative AI in buyer help.

    Wish to discover additional? Try the next GitHub repo. There, you’ll be able to observe the code in motion and experiment with the answer your self. The repository contains step-by-step directions for organising and operating the multi-agent system, together with code for interacting with information sources and brokers, routing information, and visualizing workflows.


    Concerning the authors

    Deepesh DhapolaDeepesh Dhapola is a Senior Options Architect at AWS India, specializing in serving to monetary providers and fintech purchasers optimize and scale their purposes on the AWS Cloud. With a powerful give attention to trending AI applied sciences, together with generative AI, AI brokers, and the Mannequin Context Protocol (MCP), Deepesh makes use of his experience in machine studying to design progressive, scalable, and safe options. Passionate concerning the transformative potential of AI, he actively explores cutting-edge developments to drive effectivity and innovation for AWS prospects. Exterior of labor, Deepesh enjoys spending high quality time along with his household and experimenting with various culinary creations.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Oliver Chambers
    • Website

    Related Posts

    A Deep Dive into Picture Embeddings and Vector Search with BigQuery on Google Cloud

    July 30, 2025

    MMAU: A Holistic Benchmark of Agent Capabilities Throughout Numerous Domains

    July 29, 2025

    Construct a drug discovery analysis assistant utilizing Strands Brokers and Amazon Bedrock

    July 29, 2025
    Top Posts

    Wiz Uncovers Vital Entry Bypass Flaw in AI-Powered Vibe Coding Platform Base44

    July 30, 2025

    Evaluating the Finest AI Video Mills for Social Media

    April 18, 2025

    Utilizing AI To Repair The Innovation Drawback: The Three Step Resolution

    April 18, 2025

    Midjourney V7: Quicker, smarter, extra reasonable

    April 18, 2025
    Don't Miss

    Wiz Uncovers Vital Entry Bypass Flaw in AI-Powered Vibe Coding Platform Base44

    By Declan MurphyJuly 30, 2025

    Cybersecurity researchers have disclosed a now-patched essential safety flaw in a well-liked vibe coding platform…

    AI vs. AI: Prophet Safety raises $30M to interchange human analysts with autonomous defenders

    July 30, 2025

    A Deep Dive into Picture Embeddings and Vector Search with BigQuery on Google Cloud

    July 30, 2025

    Robotic arm with gentle grippers helps individuals with disabilities make pizza and extra

    July 30, 2025
    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    UK Tech Insider
    Facebook X (Twitter) Instagram
    • About Us
    • Contact Us
    • Privacy Policy
    • Terms Of Service
    • Our Authors
    © 2025 UK Tech Insider. All rights reserved by UK Tech Insider.

    Type above and press Enter to search. Press Esc to cancel.