RAGLens is a full-stack Retrieval-Augmented Generation (RAG) evaluation and observability platform.
It is designed around three service responsibilities:
rag-api answers questions.
eval-api decides whether those answers are good.
dashboard explains what happened.
apps/
rag-api/ Fastify + TypeScript service for ingestion, retrieval, answers, and traces
eval-api/ FastAPI + Python service for datasets, scoring, comparisons, and CI gates
dashboard/ Next.js dashboard for document, trace, and eval inspection
infra/
migrations/ PostgreSQL and pgvector schema bootstrap
seed/ Controlled seed documents and eval datasets
packages/
shared/ Shared contracts that are safe to reuse across TypeScript workspaces
docs/ Source-of-truth project documentation in Markdown
docs-site/ Astro static documentation site that renders docs from docs/
The current implementation provides:
rag-apihealth endpoint atGET /api/v1/healtheval-apihealth endpoint atGET /api/v1/healthrag-apiMarkdown document ingestion, retrieval, query, and trace endpointsrag-apiadvanced retrieval modes (vector,keyword,hybrid,hybrid_reranked) with query rewriting, context packing, and configurable reranker adapter controlsrag-apiprovider runtime adapters for deterministic/OpenAI/OpenRouter/Anthropic/Ollama query answeringrag-apiprovider token usage + optional pricing configuration for estimated cost telemetryrag-apirequest correlation and structured provider-failure envelopes withx-request-id- Postgres-backed document storage with
rag.documentsandrag.document_chunks - Postgres-backed eval persistence for datasets, eval runs, case results, comparisons, and CI gate runs
eval-apirequest correlation and structured error envelopes withx-request-id- eval runner retries, timeout mapping, cost/max-case guardrails, and partial failure persistence
- seed corpus and golden eval fixture under
infra/seed - dashboard document list/detail screens for corpus inspection
- dashboard devtools page at
/devtoolsfor manualrag-apiandeval-apirequest inspection - PostgreSQL + pgvector via Docker Compose
- CI checks for Node, Python, docs, Docker Compose config, and Docker Compose image builds
RAGLens is planned to support both cloud and local model runtimes through provider-neutral interfaces and named model profiles.
The current implementation is not yet at local LLM execution. Local runtime support is planned to enter during the embeddings, retrieval, answer generation, trace, and eval phases rather than as a late rewrite.
Key docs:
docs/local-llm-runtime-plan.md: detailed local LLM, embedding, reranker, and model profile implementation plandocs/local-runtime-roadmap-placement.md: where local runtime work sits in the roadmapdocs/provider-neutral-runtime-adr.md: ADR for provider-neutral chat, embedding, reranker, judge, and model profile supportdocs/roadmap.md: full phased delivery roadmap
Initial planned local profile:
local-balanced
chat provider: ollama
chat model: qwen3:8b
embedding provider: ollama
embedding model: nomic-embed-text
reranker provider: none
retrieval mode: vector
Copy the example environment file:
cp .env.example .envInstall Node dependencies:
npm installInstall the Python eval API locally when working outside Docker:
cd apps/eval-api
python -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'Start the local infrastructure and services:
docker compose up --buildService URLs:
Dashboard: http://localhost:3000
rag-api: http://localhost:8000/api/v1/health
eval-api: http://localhost:8001/api/v1/health
Postgres: localhost:5432
Load the controlled seed corpus into rag-api:
npm --workspace apps/rag-api run seed:documentsThen inspect indexed documents in the dashboard:
http://localhost:3000/documents
You can also upload ad-hoc Markdown/text files from the dashboard UI:
http://localhost:3000/documents/upload
See docs/seed-ingestion.md for the full workflow and troubleshooting notes.
docker compose up --buildnpm --workspace apps/rag-api run seed:documents- Open http://localhost:3000/datasets
- Create a dataset
- Add test cases
- Open http://localhost:3000/eval-runs/new
- Create an eval run
- Open eval run detail
- Execute run
- Inspect case results
/devtools remains available for low-level API inspection, but normal eval execution should now run through dashboard datasets and eval run pages.
The dashboard now uses a persistent application shell:
- Left sidebar grouped by product area: Overview, Corpus, Evaluation, Operations
- Sticky topbar with route-aware breadcrumb, title, and page actions
- Content area for page-specific cards, forms, and detail panels
Recommended navigation flow:
- Open Overview (
/) for service and workflow context - Inspect corpus in Documents (
/documents) and Retrieval (/retrieval) - Build datasets in Datasets (
/datasets) - Create and execute eval runs from Eval Runs (
/eval-runs,/eval-runs/new) - Inspect run case results and comparisons (
/comparisons/*) - Use Devtools (
/devtools) only for direct API debugging
npm run typecheck
npm run lint
npm run test
npm run buildDocs commands:
npm run docs:dev
npm run docs:check
npm run docs:build
npm run docs:preview- Add or update Markdown files in
docs/. - Ensure each file has frontmatter fields:
title,description,order,section,status. - Re-run
npm run docs:buildto validate and generate static output.
Astro build output is generated at docs-site/dist/.