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
Callcapture() after each RAG interaction. It is designed to be non-blocking.
Express middleware
res.json() and captures responses automatically when
req.ragContext is available.
LangChain callback
ExtendBaseCallbackHandler and call quorum.capture() in handleChainEnd.
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
endpoint | string | required | Quorum backend URL |
apiKey | string | none | Optional API key |
defaultStrategy | string | auto | auto, single, hybrid, or council |
batchSize | number | 10 | Flush when the buffer reaches this size |
flushInterval | number | 5000 | Auto-flush interval in milliseconds |
onError | function | console.warn | Error callback |
correlationId | string | auto-generated | Propagated as X-Correlation-ID |
Data flow
Core methods
new Quorum(config)
Creates a new SDK instance.
.capture(payload)
Buffers a RAG interaction. Returns void.