Skip to main content

Rylox

Rylox is a fast, local repository context engine for Python codebases.

It analyzes your repository, builds a structured semantic index, and retrieves relationship-aware, token-budgeted context that can be pasted into any large language model.

Unlike keyword search or sending entire files to an LLM, Rylox understands the structure of your codebase — functions, methods, classes, and how they reference each other — and selects only the code relevant to your question. Indexing and retrieval run entirely on your machine: no API keys, no cloud services, no vendor lock-in. The only network access Rylox ever makes is a one-time download of its local embedding model on first use; after that, everything is fully offline.

rylox index
rylox context "How does authentication work?" --max-tokens 20000

The output is a structured Markdown document — query, entry points, execution flow, included files, and the actual relevant code — sized to fit within the token budget you set, ready to paste into ChatGPT, Claude, Gemini, Codex, or any other LLM.


Why Rylox?

Large repositories quickly exceed an LLM's context window. Keyword search often retrieves unrelated files; pasting whole files wastes tokens on irrelevant code; cloud-based embedding services require API keys, cost money per query, and send your code off your machine.

Rylox instead parses your repository's actual structure, combines dense (embedding-based) and sparse (keyword-based) retrieval, follows one hop of real call/reference relationships from the best matches, and assembles the result deterministically within a token budget — all locally.


Features

  • Tree-sitter powered Python parsing
  • Semantic chunking at the function, method, and class level, including decorators and async def
  • Incremental indexing using SHA-256 content hashing — only changed files are re-parsed and re-embedded on subsequent runs
  • Hybrid retrieval: dense (local sentence-transformer embeddings + FAISS) and sparse (BM25) search, combined via Reciprocal Rank Fusion
  • One-hop relationship expansion (callers, callees, constructor/decorator usage) from the top-ranked matches
  • Deterministic, token-budgeted context assembly — a chunk that doesn't fit the budget is skipped whole, never truncated mid-body
  • Structured Markdown output with a fixed section layout
  • Persistent on-disk cache for both the parsed index and computed embeddings
  • .gitignore-aware and configurable ignore patterns, with a configurable per-file size ceiling
  • rylox doctor for diagnosing your local environment and repository cache state
  • Offline after first run — the only network call is the initial, one-time embedding model download
  • Cross-platform (Linux, macOS, Windows)

Example

Index a repository:

rylox index

Generate context for an LLM:

rylox context "How does authentication work?" --max-tokens 20000

Rylox writes a Markdown file containing the most relevant parts of the repository for that question, within the requested token budget.


Current status

Rylox is functional end to end — index, context, clean, and doctor all work as real commands, not stubs. That said, this is an early release (v0.0.2, pre-1.0), and retrieval quality is actively being improved: running Rylox against real open-source repositories has already surfaced and fixed real bugs in how relationships between code are detected (see KNOWN_LIMITATIONS.md for specifics and current known gaps). If you hit a case where retrieval picks the wrong code or misses something obviously relevant, that's useful signal — please open an issue.


Philosophy

Offline first. Repository indexing and retrieval never require a network connection after the one-time initial model download.

Vendor independent. The generated context is plain Markdown — it works with any language model, not a specific provider.

Deterministic retrieval. Given the same index and query, output ordering is reproducible — driven by repository structure and fusion scoring, not opaque or randomized ranking.


Installation

Install the latest release from PyPI:

pip install rylox

Upgrade existing installation:

pip install --upgrade rylox

Contributing or running the test suite:

pip install -e ".[dev]"
pytest

Supported language

  • Python (3.9–3.12)

Additional language support is a future goal via Tree-sitter's grammar ecosystem, not yet implemented.


License

Rylox is licensed under the Apache License 2.0. See LICENSE for details.

Metadata

Release files for rylox 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rylox 0.0.2
File Size Uploaded Provenance Actions
rylox-0.0.2.tar.gz 64.0 kB Without provenance Details for rylox-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rylox 0.0.2
File Interpreter ABI Platform Actions
rylox-0.0.2-py3-none-any.whl Python 3 none any Details for rylox-0.0.2-py3-none-any.whl

Total release size: 100.4 kB

Release files / rylox-0.0.2.tar.gz

Download URL rylox-0.0.2.tar.gz
Size 64.0 kB
Tags Source
SHA-256 checksum
How to use checksums
68454271012b4293707e691fb2d13af5ee8ee1b0ea800c838a7464c04ce5b175
BLAKE2b-256 checksum
How to use checksums
2ca080825f9c5864e0a2ba6882df33c18b8450be241da3da2ba561d737defdab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / rylox-0.0.2-py3-none-any.whl

Download URL rylox-0.0.2-py3-none-any.whl
Size 36.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4723324aabfa6bd94c8ac0a0f08dbc15e2a41f2684c7d916b7905e06a9c46ab1
BLAKE2b-256 checksum
How to use checksums
0a02cba7d669b4a69ceaa9a52f27f6df11f2c38a0603e4725b8f793e5f2ecf0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Security for rylox 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page