Exclusive Content:

Haiper steps out of stealth mode, secures $13.8 million seed funding for video-generative AI

Haiper Emerges from Stealth Mode with $13.8 Million Seed...

Running Your ML Notebook on Databricks: A Step-by-Step Guide

A Step-by-Step Guide to Hosting Machine Learning Notebooks in...

“Revealing Weak Infosec Practices that Open the Door for Cyber Criminals in Your Organization” • The Register

Warning: Stolen ChatGPT Credentials a Hot Commodity on the...

Automated Reasoning: A Reference Implementation for a Rewriting Chatbot

Introducing an Open Source Chatbot: Leveraging Automated Reasoning for Enhanced Accuracy and Transparency

Improve Accuracy and Transparency with Automated Reasoning Checks

Chatbot Reference Implementation

How the Iterative Rewriting Loop Works

Initial Response and Validation

The Rewriting Loop: The Heart of the System

Getting Started with the Automated Reasoning Checks Rewriting Chatbot

Backend Implementation Details

About the Authors

Enhancing Chatbot Functionality with Automated Reasoning: An Open Source Sample Chatbot

Today, we are thrilled to announce the release of a new open-source sample chatbot designed to illustrate how to leverage Automated Reasoning checks. This innovative system iterates on generated content, asks clarifying questions, and rigorously proves the correctness of its answers.

Why Automated Reasoning?

In a landscape increasingly dominated by large language models (LLMs), maintaining accuracy and transparency is paramount. While LLMs can generate responses that seem plausible, they can sometimes produce factual inaccuracies—a phenomenon known as "hallucination." Here’s where Automated Reasoning checks come in. These checks validate user questions and LLM-generated answers by offering rewriting feedback that highlights ambiguities, broad assertions, and incorrect claims.

The chatbot, utilizing these checks, enhances accuracy by providing explicit answers to yes/no questions and improves transparency through mathematically verifiable proof of statement validity. As a result, our generative AI applications become auditable and compliant, even in highly regulated environments.

The Chatbot Reference Implementation

The sample chatbot is created using Flask, offering APIs to submit questions and check answer statuses. Moreover, its design allows developers to peek behind the curtain and understand how it arrives at its responses—thanks to detailed logs of every iteration and feedback from Automated Reasoning checks.

Frontend Configuration

A NodeJS front end links to an LLM sourced from Amazon Bedrock, allowing users to generate responses, choose an Automated Reasoning policy for validation, and set a maximum iteration limit. The interface displays a debug panel that includes a step-by-step overview of each content iteration and validation output.

Once Automated Reasoning checks deem a response valid, a verifiable explanation of the validity is presented.

Figure 2 – Automated Reasoning checks validity proof

How the Iterative Rewriting Loop Functions

The core of this chatbot is its iterative rewriting loop, which continuously refines answers based on Automated Reasoning feedback. Each time the chatbot processes a question and answer (Q&A), the checks return a list of findings. These findings analyze statements in the input Q&A, identifying premises and claims to validate and inform the rewriting process.

For instance, if the question is regarding Amazon S3 storage costs, the validation might return findings that confirm the costs for different regions—allowing the chatbot to clarify and reiterate the answer accurately.

The Backend Architecture

If you’re keen on adapting this implementation for production use, the primary components in the backend include:

  1. ThreadManager: This component manages conversation lifecycles, ensuring state consistency throughout the rewrite process. It uses a locking mechanism to prevent race conditions.

  2. ThreadProcessor: Employing a state machine pattern, it governs the rewriting loop, transitioning between phases like generating the initial response, validating it, and handling results.

  3. ValidationService: Integrating with Amazon Bedrock Guardrails, it validates LLM responses by submitting them to the ApplyGuardrail API and parses structured findings.

  4. LLMResponseParser: This interprets LLM intentions during the rewriting process, helping to extract structured information while handling markdown formatting and limiting questions.

  5. AuditLogger: It maintains a dedicated log of events, preserving all necessary context as the chatbot processes user inquiries.

Getting Started

Ready to dive in? Follow these steps to set up your own Automated Reasoning checks rewriting chatbot:

  1. Create Your Automated Reasoning Policy:

    • Navigate to Amazon Bedrock in your AWS Management Console.
    • Open the Automated Reasoning page and create a sample policy.
  2. Download and Run the Reference Implementation:

    • Clone the Amazon Bedrock Samples repository.
    • Follow the README instructions to install dependencies and start the application.
    • Access it via your browser at http://localhost:8080.

Conclusion

Embedding Automated Reasoning checks in chatbot implementations allows for a new standard of accuracy and transparency in AI communication. With the complexities of today’s regulatory landscapes, building trustworthy AI applications is not just beneficial—it’s essential.

You’re now equipped with the knowledge to implement and customize this innovative chatbot.

About the Authors

Stefano Buliani
Stefano is a Product Manager in the Automated Reasoning team at AWS. With over a decade at AWS, he has been pivotal in developing serverless technologies and open-source projects that have empowered many customers to deploy successful applications.

Dive into the code, explore the capabilities, and let’s reshape the future of chatbot technology together!

Latest

Rocket Close Revolutionizes Mortgage Document Processing Using Amazon Bedrock and Amazon Textract

Transforming Mortgage Document Processing with Generative AI: A Case...

Why Simplicity Fuels ChatGPT Ads While Creativity Takes a Backseat – 04/03/2026

Verve Group Unveils Conversational Intent Advertising via Large Language...

KUKA’s Bold Step into Intent-Based Robotics

Revolutionizing Robotics: KUKA's Vision for Intent-Based Automation at NCAS’26 The...

Market Insights: AI in Telehealth and Telemedicine – Size, Share, and Growth Projections for 2034

Global AI in Telehealth & Telemedicine Market Overview Market Size...

Don't miss

Haiper steps out of stealth mode, secures $13.8 million seed funding for video-generative AI

Haiper Emerges from Stealth Mode with $13.8 Million Seed...

Running Your ML Notebook on Databricks: A Step-by-Step Guide

A Step-by-Step Guide to Hosting Machine Learning Notebooks in...

VOXI UK Launches First AI Chatbot to Support Customers

VOXI Launches AI Chatbot to Revolutionize Customer Services in...

Investing in digital infrastructure key to realizing generative AI’s potential for driving economic growth | articles

Challenges Hindering the Widescale Deployment of Generative AI: Legal,...

Manage Domain Access for Your AI Agents

Ensuring Secure Internet Access for AI Agents with Amazon Bedrock AgentCore and AWS Network Firewall Introduction AI agents that can browse the web open powerful possibilities—from...

Simulating Realistic Users for Evaluating Multi-Turn AI Agents in Strands Evals

Enhancing Conversational AI Evaluation: The Shift to Multi-Turn Interaction Why Multi-Turn Evaluation is Fundamentally Harder What Makes a Good Simulated User How ActorSimulator Works Getting Started with ActorSimulator Integration...

Streamlining Competitive Price Intelligence Using Amazon Nova Act

Automating Competitive Price Intelligence: Transforming Ecommerce with Amazon Nova Act The Hidden Costs of Manual Competitive Price Intelligence Automating with Amazon Nova Act Common Building Blocks of...