Build Your Own AI QA Assistant — Automate Test Understanding with LangChain & OpenAI

Published: (December 15, 2025 at 11:45 AM EST)
3 min read
Source: Dev.to

Source: Dev.to

Why This?

As QA engineers we often deal with test cases in JSON or Jira/Xray, BDD specs in .feature files, Markdown requirements, logs in .txt and .html, Allure reports, and PDFs—scattered across tools and folders. Searching across all these files is slow, repetitive, and error‑prone.

Solution: An AI‑powered bot that understands all your test artifacts and answers natural‑language questions, acting like a real assistant.

What This Bot Does

  • Ask questions such as:
    • “What are the test steps in TC‑002?”
    • “Summarize login test cases.”
    • “What does the PDF say about edge cases?”
  • Supported file types:
    • .json – structured test cases
    • .feature – BDD scenarios
    • .md, .txt, .html – requirements, logs, reports
    • .pdf, .docx – spec documents
  • How it works:
    1. Breaks content into searchable chunks.
    2. Creates semantic embeddings.
    3. Stores them in a FAISS vector DB.
    4. Uses OpenAI to generate natural‑language responses.

Tech Stack

  • LangChain – orchestrates data loading, chunking, and retrieval.
  • OpenAI – generates QA‑friendly answers.
  • FAISS – fast semantic vector search.
  • Python – the implementation language.

How to Use It

1. Clone the repository

git clone https://github.com/aiqualitylab/AI-QA-Assistant-Bot.git
cd AI-QA-Assistant-Bot

2. Install dependencies

pip install -r requirements.txt

3. Set your OpenAI API key

Create a .env file in the project root:

OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

You can obtain an API key from the OpenAI platform.

4. Run the assistant

python bot.py

On the first run the documents are indexed; subsequent runs reuse the saved index. You’ll see:

🤖 QA Assistant Ready! Ask anything (type 'exit' to quit')

Now you can start asking questions and receive instant AI‑powered answers.

Example Use Cases

  • “What’s in TC‑003?”
  • “Summarize all test cases about checkout.”
  • “What do the logs say about payment errors?”
  • “Give me test steps for login with invalid credentials.”

Behind the Scenes

  • Document loaders from langchain_community.loaders handle multiple formats.
  • Recursive chunking splits large texts into overlapping pieces.
  • OpenAIEmbeddings converts chunks into vectors.
  • FAISS indexes and searches them semantically.
  • RetrievalQA runs your question against the best‑matching documents.

Why It Matters

QA engineers no longer need to:

  • Ctrl + F through hundreds of lines.
  • Switch between Jira, Confluence, Allure, Git, etc.
  • Manually correlate logs and test cases.

The assistant lets you work smarter, not harder.

Demo Available

Try it locally with your own test artifacts. Clone the repo 👉 https://github.com/aiqualitylab/AI-QA-Assistant-Bot

QA Assistant Bot Overview

An AI‑powered assistant for QA engineers that uses OpenAI + LangChain to answer questions from test cases, feature files, logs, specs, and more—entirely via natural language.

Purpose

  • Ask natural questions like “What are the steps in TC‑001?” or “List test cases for login.”
  • Quickly understand test specs and logs.
  • Search across multiple formats (JSON, Markdown, PDF, etc.).
  • Automate documentation understanding and reduce manual effort.

Supported File Types

Place files inside the data/ folder. The bot can read and index:

  • .json – test cases
  • .feature – BDD specs
  • .md – requirements
  • .txt – logs
  • .html – reports
  • .pdf – test documents
  • .docx – Word specs

Installation

1. Clone the repo

git clone https://github.com/aiqualitylab/AI-QA-Assistant-Bot.git
cd qa-bot

2. Set up Python environment

Ensure Python 3.10+ is installed, then install requirements:

pip install -r requirements.txt

3. Create .env

Add your OpenAI key as described earlier.

Back to Blog

Related posts

Read more »