Skip to content

About

VectorLink-QA is a local RAG engine using SQL Server, LangChain, and Gemma-4. It automates QA analysis by transforming complex docs into Gherkin test cases. Built to eliminates hallucinations and ensures 100% traceability from requirements to automation code—securing data while boosting productivity.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

💡 AI_RAG_Ollama_VectorLink

🚀 AI_RAG_Ollama_VectorLink is a professional-grade, privacy-first Retrieval-Augmented Generation (RAG) pipeline. It transforms unstructured legal and technical documents into actionable Quality Assurance artifacts, including Gherkin User Stories and Playwright automation scripts.

Built with a Senior QA Lead mindset, this project demonstrates how to bridge the gap between complex documentation and automated testing using a local, secure AI stack.

📌 Project Overview Traditional LLMs are limited by their training data. VectorLink solves this by:

  1. Retrieving relevant clauses from local enterprise documentation.

  2. Augmenting the LLM prompt with grounded facts.

  3. Generating accurate test requirements and executable automation code.

🔄 The RAG Flow — Step by Step YOUR DOCUMENTS │ ▼ ┌─────────────┐ │ 1. LOAD │ ← Load PDFs, text files, web pages, etc. └─────────────┘ │ ▼ ┌─────────────┐ │ 2. SPLIT │ ← Break documents into smaller chunks └─────────────┘ │ ▼ ┌─────────────┐ │ 3. EMBED │ ← Convert chunks to vector numbers (embeddings) └─────────────┘ │ ▼ ┌─────────────┐ │ 4. STORE │ ← Save vectors in a Vector Database (ChromaDB) └─────────────┘

     ← ABOVE HAPPENS ONCE (Indexing Phase) →
     ─────────────────────────────────────────
     ← BELOW HAPPENS ON EVERY QUERY (Retrieval + Generation) →

USER QUESTION │ ▼ ┌─────────────┐ │ 5. EMBED │ ← Convert question to a vector │ QUERY │ └─────────────┘ │ ▼ ┌─────────────┐ │ 6. SEARCH │ ← Find most similar chunks from the vector DB └─────────────┘ │ ▼ ┌─────────────┐ │ 7. PROMPT │ ← Build a prompt: context (chunks) + question └─────────────┘ │ ▼ ┌─────────────┐ │ 8. ANSWER │ ← LLM reads the context and generates an answer

🛠️ Libraries We'll Use Library Purpose langchain The glue — chains everything together langchain-community Community integrations (Ollama, ChromaDB, loaders) langchain-ollama Official Ollama integration for LangChain chromadb Local vector database — stores and searches embeddings ollama Runs LLMs locally on your machine — no API key needed!

🦙 Why Ollama? Ollama lets you run powerful open-source models 100% locally — no cloud, no billing, no data leaving your machine.

We'll use two models:

llama3.1:latest — for text generation (the "brain") nomic-embed-text — for embeddings (converting text to vectors) 💡 Make sure Ollama is running: ollama serve Pull the models: ollama pull llama3.1 and ollama pull nomic-embed-text

🛠️ The Tech Stack Component Tool Purpose Orchestration LangChain (Python) The glue connecting the PDF, Database, and LLM. Local LLM Ollama (Gemma) Executes logic and code generation 100% locally. Embeddings nomic-embed-text Converts text into 1536-dimension numerical vectors. Vector Store Microsoft SQL Server Enterprise-grade storage for text chunks and vectors. Automation Playwright (Node.js) The final output: executable end-to-end tests.

📂 Directory Structure Plaintext /AI_RAG_Ollama_VectorLink │ ├── /data # Source PDFs (e.g., AT&T Consumer Services Agreement.pdf) ├── /requirements # Output Gherkin User Stories (.md) ├── /scripts # Modular Python Pipeline │ ├── loader_chunker.py # Files 1 & 2: PDF Parsing & Text Splitting │ ├── embedding_manager.py # Files 3 & 4: Vector Generation & SQL Storage │ └── rag_engine.py # Files 5, 6 & 7: Retrieval & Test Generation ├── /tests # Generated Playwright scripts (.spec.js) ├── docker-compose.yml # Local SQL Server 2025 instance └── requirements.txt # Project dependencies

🔄 The Pipeline Flow Phase 1: Ingestion (The Indexing Phase) LOAD: PyMuPDF reads the AT&T legal addendum.

SPLIT: RecursiveCharacterTextSplitter breaks text into 800-token chunks with overlap.

EMBED: Ollama converts chunks into vectors.

STORE: pyodbc saves chunks and vectors into a VECTOR enabled SQL Server table.

⚙️ Setup & Installation

  1. Prerequisites Ollama installed and running.

Docker for SQL Server.

Python 3.10+.

  1. Prepare Models Bash ollama pull gemma ollama pull nomic-embed-text

  2. Install Dependencies Bash pip install langchain langchain-ollama pyodbc pymupdf playwright

  3. Initialize Database Bash docker-compose up -d

🚀 Usage Run the modular scripts in sequence to build your knowledge base and generate tests:

Ingest Data:

Bash python scripts/loader_chunker.py Generate Automation:

Bash python scripts/rag_engine.py

💡 Why VectorLink? Security: No data ever leaves your machine. Perfect for sensitive legal/corporate documents.

Traceability: Every generated test case is linked directly to a specific section of the source PDF.

Efficiency: Automates the most time-consuming part of QA—reading documentation and writing manual test cases.

Developed by Dhiraj Gupta - Senior QA Automation Engineer

About

VectorLink-QA is a local RAG engine using SQL Server, LangChain, and Gemma-4. It automates QA analysis by transforming complex docs into Gherkin test cases. Built to eliminates hallucinations and ensures 100% traceability from requirements to automation code—securing data while boosting productivity.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages