Skip to content

EncouRAGe - Local RAG Evaluation Cheatsheet

EncouRAGe - Local RAG Evaluation Cheatsheet

EncouRAGe is an open-source framework for evaluating retrieval-augmented generation (RAG) pipelines with an emphasis on running locally, fast, and reliably. Where many RAG evaluators call out to hosted judge models, EncouRAGe is designed to compute retrieval and generation metrics on your own hardware, keeping evaluation data private and results reproducible. It fits the 2026 pattern where RAG quality is treated as a measurable engineering property rather than a vibe.

Evaluation frameworks evolve quickly. Treat the commands below as the shape of the workflow and confirm exact flags against the current docs.

Installation

MethodCommand
pippip install encourage
From sourcegit clone the repo, then pip install -e .
Local judge modelspull models via your local runtime (e.g. Ollama/vLLM)
Verifypython -c "import encourage; print('ok')"

Why Local Evaluation

BenefitWhy it matters
PrivacyYour documents/queries never leave your machine
ReproducibilitySame model + seed → same scores
CostNo per-eval API billing
SpeedBatch locally without rate limits

What Gets Measured

RAG evaluation splits into the two halves of the pipeline.

HalfMetrics
RetrievalContext precision, context recall, hit rate, MRR/NDCG
GenerationFaithfulness (grounding), answer relevance, correctness
End-to-endWhether the final answer is right and supported

Core Workflow

# Conceptual flow: assemble a dataset, run your RAG, score it
import encourage

dataset = encourage.load_dataset("eval_questions.jsonl")  # question, ground_truth, contexts

results = encourage.evaluate(
    dataset=dataset,
    metrics=["faithfulness", "answer_relevance",
             "context_precision", "context_recall"],
    judge_model="local/llama-3.1-8b-instruct",   # runs locally
)

print(results.summary())     # per-metric scores
results.to_json("eval.json")
StepPurpose
DatasetQuestions + (optional) ground truth + retrieved contexts
MetricsWhich retrieval/generation dimensions to score
Judge modelThe local LLM used for LLM-as-judge metrics
ResultsAggregate + per-example scores, exportable

Building an Eval Dataset

FieldMeaning
questionThe user query
contextsChunks your retriever returned
answerYour pipeline’s generated answer
ground_truthReference answer (for correctness/recall)

Harvest real questions from production traces to make the eval representative.

Interpreting Results

SymptomLikely cause
Low context recallRetriever misses relevant chunks (chunking/embedding)
Low context precisionToo much irrelevant context retrieved (add reranking)
Low faithfulnessModel hallucinates beyond the context
Low answer relevanceAnswer drifts from the question (prompt/query issue)

Fitting It Into CI

# Gate a RAG change on evaluation scores
python run_eval.py --dataset eval.jsonl --min-faithfulness 0.85 \
  --min-context-recall 0.8 || exit 1

Run the same eval set on every retrieval/prompt/model change so regressions are caught before they ship.

EncouRAGe vs Other RAG Evaluators

AspectEncouRAGeRAGASTruLensDeepEval
EmphasisLocal, fast, reproducibleReference-free RAG metricsMonitoring + OTel tracingUnit-test mindset, CI
JudgeLocal modelsConfigurableConfigurableConfigurable
Best forPrivate, on-prem evalQuick RAG scoringProduction monitoringPytest-style CI gates

Pairs conceptually with RAGAS, TruLens, and DeepEval — pick by whether you need local privacy, quick metrics, monitoring, or CI gating.

Resources