Unrag
Batteries
Experimental Feature

Debug Panel

Real-time debugging TUI for RAG operations.

The Debug Panel provides a terminal-based interface for real-time visibility into your RAG pipeline—watching operations as they happen, running interactive queries, inspecting stored documents, and diagnosing configuration issues.

The debug battery adds two components to your Unrag installation:

A WebSocket debug server that runs alongside your application when UNRAG_DEBUG=true is set. The server broadcasts debug events and accepts interactive commands without affecting your application's normal operation.

A terminal UI (TUI) that you launch with bunx unrag debug. The TUI connects to the debug server and provides eight specialized panels for different debugging tasks.

Installing the debug battery

bunx unrag@latest add battery debug

This installs the debug module into your project and adds the necessary dependencies.

Quick setup

  1. Set UNRAG_DEBUG=true in your environment
  2. Register your engine in your app:
import { registerUnragDebug } from "@unrag/debug";

const engine = createUnragEngine();
registerUnragDebug({ engine, storeInspector: engine.storeInspector });
  1. Start your app, then connect the TUI:
bunx unrag debug

Full documentation

The Debug Panel has comprehensive documentation covering all aspects of the tool:

Panel Documentation

On this page

RAG handbook banner image

Free comprehensive guide

Complete RAG Handbook

Learn RAG from first principles to production operations. Tackle decisions, tradeoffs and failure modes in production RAG operations

The RAG handbook covers retrieval augmented generation from foundational principles through production deployment, including quality-latency-cost tradeoffs and operational considerations. Click to access the complete handbook.