Skip to main content

JavaScript SDK

The JavaScript SDK is a lightweight, zero-dependency client for capturing RAG interactions and sending them to Quorum for evaluation.

Quick start

Integration patterns

Direct capture

Call capture() after each RAG interaction. It is designed to be non-blocking.

Express middleware

This pattern wraps res.json() and captures responses automatically when req.ragContext is available.

LangChain callback

Extend BaseCallbackHandler and call quorum.capture() in handleChainEnd.

Configuration

Data flow

Core methods

new Quorum(config)

Creates a new SDK instance.

.capture(payload)

Buffers a RAG interaction. Returns void.

.flush()

Sends buffered captures to the backend and returns a Promise.

.close()

Flushes remaining captures and stops the interval timer.