MetriqualMETRIQUAL
All apps

TruthLens

Same question. Same model. One lane fact-checks itself.

A research assistant that answers every question twice: once raw, once through a proxy key with the hallucination blocker attached. Fabricated citations, fake statistics, and overconfident claims get caught by ReAct + Chain-of-Verification running inside the proxy. The app contains zero verification code.

SourceNext.js 14@metriqual/sdkTailwind CSS

Before you start

  • A free Metriqual account (metriqual.com)
  • An API key from any supported provider (OpenAI, Anthropic, Gemini, Mistral, or MiniMax)
  • Node.js 18+

Run it yourself

1

Create two proxy keys

In the dashboard, create two agents pointing at the same provider and model (gpt-4o-mini works well and keeps the demo cheap). One key will stay raw; the other gets the hallucination blocker. Copy both key strings; they look like mql-…

2

Attach a hallucination filter to the second key

Go to Dashboard → Anti-Halluc → New Filter. Pick medium sensitivity, check ReAct and CoVe, keep gpt-4o-mini as the verification model, and create. Then attach it to your second key, or do the whole thing in one CLI command:

CLI (one command)
npx mql-cli hallucination create \
  -n "truthlens-guard" -s react,cove \
  --key mql-YOUR-SECOND-KEY
3

Clone and configure

Clone the apps repo, install dependencies for TruthLens, and drop both keys into the env file:

Terminal
git clone https://github.com/Metriqual/mql-apps.git
cd mql-apps/apps/truthlens
npm install
cp .env.example .env.local
4

Add your keys

Open .env.local and paste the two keys. MQL_KEY_RAW is the unfiltered key, MQL_KEY_VERIFIED is the one with the filter attached.

.env.local
MQL_KEY_RAW=mql-your-raw-key
MQL_KEY_VERIFIED=mql-your-filtered-key
# optional: MQL_MODEL=gpt-4o-mini
5

Run it

Start the dev server, open localhost:3000, and click one of the sample questions; they are engineered to tempt the model into fabricating citations and statistics. Watch the right lane catch what the left lane invents.

Terminal
npm run dev
# → http://localhost:3000
6

Experiment without redeploying

This is the point of the demo: go back to the dashboard and change the filter: raise sensitivity to high, add Self-RAG or MARCH, swap the verification model to Claude. The very next request through the key picks up the new config. No code change, no deploy.

The receipts

What this actually saves you. No adjectives, just the trade.

Tech debt

Building this comparison without Metriqual means implementing claim extraction, verification-question generation, independent re-answering, discrepancy reconciliation, response rewriting, timeouts, and fail-open behavior: the contents of five research papers as production code you maintain. Here, the entire integration is one SDK call, and the difference between lanes is which key you use.

Cost

The verified lane adds roughly one extra gpt-4o-mini call per response with CoVe, fractions of a cent. You pay pennies per thousand requests for answers that do not invent citations, and a spend cap on the key puts a hard ceiling on it.

Stuck, or improved it?

Open an issue or pull request. Community apps get featured.

Metriqual/mql-apps