Model HQ

RAG Bot

Fast and flexible document analysis using Retrieval-Augmented Generation

The RAG Bot offers a fast and flexible way to analyze and extract insights from enterprise documents like executive employment agreements, MSAs, and NDAs. Using a Retrieval-Augmented Generation (RAG) architecture, this bot supports multiple modes of interaction including chatbot, agent, batch processing, and API integration; making it ideal for business users, analysts, and developers alike. With no setup code required, users can quickly ask natural language questions, run multi-step agent workflows, and scale analysis across large volumes of documents, all from a single no-code platform.

Video Tutorial Available

This walkthrough is also demonstrated step-by-step on our YouTube video:

"Private AI for Document Analysis in AI PC"

Use Case

Analyze and extract key information from executive employment agreements (a stand-in for many enterprise documents like MSAs, NDAs, research papers, etc.) using Model HQ's Chat, Agent, and API modes.

Prerequisites

  • Model HQ installed locally
  • A set of executive employment agreement PDFs (located at:C:\users\[username]\llmware_data\sample_files\agreements\[list of 12 executive employment agreements]
    doc path
  • An AI PC or local server
  • (Optional) Python development environment for API integration

Step-by-Step Recipe

1

Start with Local Chatbot Mode (Fast Start)

Purpose: Quickly chat with a document using an out-of-the-box RAG bot.

Steps:

  • 1Launch Model HQ locally
  • 2Open the Fast Start, select Medium Chatbot
  • 3
    Attach an Executive Employment Agreement document
    (e.g., 15-page PDF found at: C:\users\[username]\llmware_data\sample_files\agreements\)
  • 4Model HQ auto-ingests, parses, and chunks the document (~1s)
  • 5
    Ask natural language questions like:
    • "What's the effective date of the agreement?"
    • "How many vacation days is the executive entitled to?"
    • "What is the executive's annual base salary?"

Model HQ will return:

  • Detailed answers
  • Source page references
  • Option to save/download chat transcripts
Executive Employment Agreement
2

Run Agent-Based Analysis (Single Document)

Purpose: Automate multi-step document review using a reusable agent.

Steps:

  • 1Switch to Agent Mode from Home
  • 2Select the built-in Contract Analyzer Agent
  • 3
    Upload a document from the agreements folder found in:C:\users\[username]\llmware_data\sample_files\agreements\[list of 12 executive employment agreements]
  • 4Agent will run 3 predefined questions (effective date, annual rate of base salary, number of vacation days)
Contract Analyzer

Output includes:

  • Full inference log
  • Files in .json, .docx, and .txt formats

Bonus

Customize the questions, add/delete steps, or expand as needed. Read more about this here.

3

Scale with Batch Agent Mode (Multiple Documents)

Purpose: Analyze dozens or hundreds of agreements in one go.

Steps:

  • 1Go to Agent → Load Existing, select ContractAnalyzer
  • 2Choose Batch Run in the UI
  • 3
    Upload multiple documents (e.g., first 5 from the sample agreements folder for this example)C:\users\[username]\llmware_data\sample_files\agreements\
  • 4Agent will iterate through each document and apply consistent questions

Final Output:

  • • Consolidated table of answers
  • • Downloadable spreadsheet or report
  • • Supports aggregation, comparison, and audit workflows
4

Enable Backend API Mode (For Developers)

Purpose: Integrate Model HQ into custom applications via API.

Steps:

  1. 1
    Launch Model HQ as a local backend server:
    • Option 1: Localhost
    • Option 2: Mini API server for LAN access
  2. 2Access the API using the Model HQ Python client

Two Integration Modes:

a. Agent Run via API

from modelhq_client import ModelHQ

client = ModelHQ()
result = client.run_agent(
    file="mycontract.pdf", 
    agent="contract_analyzer"
)

b. Batch Folder Run via API

questions = [
    "How much is the base salary?", 
    "What is the termination clause?"
]
client.batch_analyze(
    folder="agreements_folder", 
    questions=questions
)

Output Includes:

  • Answers per document per question
  • Extracted text (optional) for storage or audits

Output Options

Word Report

.docx

Excel Spreadsheet

.xlsx

API JSON

JSON payload

Raw Text

Extracted text

Inference History

Full processing log

Example Use Cases

HR Team

Reviewing executive compensation

Legal Team

Comparing MSA clauses

Compliance

Tracking employment clauses

Developers

Building internal search tools

Summary of Interaction Modes

Chatbot (UI)

User Type: Non-technical
Input: Single document
Output: Chat + answers + source references

Agent (UI)

User Type: Analysts, HR
Input: Single document
Output: Structured report

Batch Agent

User Type: Ops/Compliance
Input: Folder of documents
Output: Consolidated output, bulk analysis

API

User Type: Developers
Input: Files, questions
Output: JSON/text for apps, dashboards, workflows

Need Help?

If you encounter any issues while updating your model configuration, feel free to contact our support team at support@aibloks.com