SuperAPIAI Directory

retrieval-lens

github.com · AI coding

Flight recorder for RAG retrieval: logs chunks, scores, sources and rankings to audit, replay and diff retrieval runs.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

retrieval-lens is an MCP server for auditing RAG retrieval, recording the text chunks the model saw before generating any answer. It is described as a black-box flight recorder for RAG retrieval inside MCP agents.

Purpose: When a RAG agent gives a wrong answer, you need to determine whether it was a retrieval failure or a generation failure. Existing observability tools usually only show LLM calls, not which text chunks the model saw before answering, what their scores were, or how retrieval changed between yesterday and today. retrieval-lens is designed to solve this problem, recording every retrieval run and hiding nothing.

Main capabilities:

  • Record every retrieval step: retrieved text chunks, scores, sources, and rankings.
  • Support post-hoc auditing, replay, and comparison of retrieval runs.
  • Provide MCP tools: retrieval_observe, retrieval_query, retrieval_diff, retrieval_stats (according to roadmap F01-F04).
  • Local-first: uses SQLite, zero signup, data never leaves the local machine.
  • MCP-native: one-line configuration, works in any MCP client.
  • Retrieval-only: focuses on the layer where most RAG failures actually occur.

Usage:

  • Run retrieval-lens directly with npx.
  • Add retrieval-lens to Claude Code with a single command.
  • Call retrieval_observe after every retrieval step in the RAG pipeline.
  • Adapter examples are provided: examples/langchain-adapter.ts and examples/llamaindex-adapter.ts.
  • See docs/demo-diff.png for real output from Claude Code.

Use cases: Suitable for developers using MCP agents and RAG pipelines who need to audit, debug, and compare retrieval results, especially when locating the problem after a RAG agent gives a wrong answer.

Limitations: Currently in active development, using a harness-first build approach. Other specific limitations are not yet provided.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools