A small tool for a big codebase

Find the files that answer your code question.

Ask in plain language. Get a ranked list of relevant files, with a clear trail of how each result was scored. Runs locally by default; live scoring is optional.

Python 3.11+MIT licensedOffline by default

local search · reflex-code-search● ready
$ reflex-search

"Where are session telemetry fields defined and calculated?"

Top matcheslocal · top 3
0.73reflex_search/models.pyACCEPT
0.47reflex_search/searcher.pyACCEPT
0.46docs/architecture.mdACCEPT

Example run against this repository · threshold 0.30

01Local firstNo API key to start
02InspectableScores and audit trail
03Small surfaceCLI and Python API
04MeasuredReproducible benchmarks

The search loop

Simple steps. Visible decisions.

REFLEX turns a natural-language question into candidate files, then shows the path each candidate took through the search loop.

01 / DISCOVER

Collect repository files

Walk the codebase, respect nested `.gitignore` rules, and skip common generated or binary files.

02 / SCORE

Rank likely matches

Use local term, phrase, definition, and docstring signals to estimate which files answer the question.

03 / GATE

Make the call explicit

Accept, reject, or mark a result uncertain using a configurable confidence gate.

04 / INSPECT

Follow the audit trail

See candidate decisions and session telemetry. Optionally escalate uncertain results to Jev.

Made to stay understandable

A focused building block, not a giant platform.

Use it from the terminal or plug the search loop into a Python workflow.

LOCAL / 01

Works without a service

Local scoring is the default, so searches work without network access, account setup, or an API key.

CONTROL / 02

Optional live scoring

Use Jev for live scoring or as a fallback for uncertain candidates when you choose to configure it.

INTEGRATE / 03

CLI and library API

Search from the command line, consume JSON output, or provide a custom scorer through a small protocol.

A measured snapshot

Every labeled match found in the top five.

Current local benchmark results at top-k 5 and threshold 0.3.

reflex-code-search100%recall@5 · 28 queries
tracecore-reflex100%recall@5 · 16 queries
Click 8.5.0100%recall@5 · 8 queries

Recall means labeled relevant files appeared in the first five results; it does not mean every result is relevant. Read all metrics, including precision and reciprocal rank, and the query set.

Try it locally

Start with one question.

Install the package, point it at a repository, and ask what you want to find. The local path needs no API credentials.

Read the full guide  ↗
TERMINAL / LOCAL SEARCH
# Install from the repository
pip install -e .

# Search the current codebase
reflex-search "Where are API errors handled?" .

# Explore all options
reflex-search --help

Curious how the search loop works? Start with the code.

View the project on GitHub  ↗