Skip to main content

REQL

REQL is a local repository context and working-memory layer for coding agents and developer tools. It compiles source files and supported documents into a property graph, then returns bounded context about code, tests, dependencies, findings and provenance.

Installed assistant instructions make REQL part of the agent's normal workflow. The project graph holds repository facts; Agent Workspace holds engineering intent, decisions and handoffs. Current source and tests remain authoritative.

REQL runs locally without mandatory model calls, accounts, hosted services or an external graph database. Bounded retrieval and saved work can reduce repeated discovery, but instructions and tool results also consume tokens; total savings depend on the host and workflow.

Quick Start

REQL requires Python 3.10 or newer. Install the CLI in an isolated environment with uv:

uv tool install reql
uv tool update-shell

Restart your shell after uv tool update-shell if reql is not on PATH. No virtual-environment activation is needed. Upgrade with uv tool upgrade reql. For optional watch/PDF support, install "reql[all]" instead.

Then install the assistant instructions:

reql install codex

With pip, create a virtual environment first. On Linux/macOS:

python3 -m venv .venv
.venv/bin/python -m pip install reql
.venv/bin/reql install codex

On Windows PowerShell:

py -m venv .venv
.venv/Scripts/python.exe -m pip install reql
.venv/Scripts/reql.exe install codex

Use that environment's reql executable for subsequent commands. System Python installations may reject direct pip installs; do not bypass their protections. See development setup for a checkout. Replace codex with another supported agent platform, or run interactive installation to detect one. Run project commands from the target repository root:

reql project status
reql project compile
reql query_context --query "payment service" --code

Compile when the graph is missing or needs refresh. If a watcher already owns refresh, leave it responsible; reql project compile --if-stopped checks that ownership before opening the graph. Registration alone does not establish a successful compilation.

Use reql locate "src/service.py" for a known path. Follow the inspection commands returned by context retrieval for missing source, and reuse complete verified excerpts. Test targets are suggestions; use the repository's test runner. See retrieval and source limits.

For assigned work, recover with reql project context --task WORK_ID. Use project overview when project direction is unknown. Multi-step or resumed work can use Agent Workspace to record decisions and verified outcomes; see Engineering coordination.

Generated agent guidance requires recording failed approaches with affected files and reading that history before edits in fresh or resumed sessions. Use agent record failure "<approach>" --why "<reason>" --file <path> to save a scoped failure and project context --file <path> to recover it across sessions. Failure capture remains an explicit agent action. The skill routes source queries, shared work, graph maintenance, project views, exports and MCP to focused references. Platform rules also route to command help.

The installer also adds the explicit-only reql-context-compact skill for hosts that can export and replace a JSON transcript. It removes only large, exact duplicate tool results. It cannot replace the live context window in Codex or another host without that capability. See assistant installs.

From a development checkout, uv run --no-sync python cli.py ... exposes the same CLI using the environment described in CONTRIBUTING. Start the optional MCP server with reql-mcp --read-only; see MCP setup.

Features

  • Incremental code and document compilation with hashes, source spans and provenance.
  • Bounded lexical and graph retrieval through a shared Python, CLI and MCP contract.
  • Static-analysis findings, structural code links, communities and hub analysis.
  • Revision-checked shared work, private session scratch and recoverable checkpoints.
  • Local block storage with transactions, locking, compaction and retention.
  • Markdown reports, JSON and HTML graph export, and project pipeline views.

Supported languages, formats and parser requirements are listed in Code analysis and Artifact ingestion.

Runtime Model

REQL is alpha software. Python owns orchestration, graph operations and storage; Tree-sitter provides native parsing. Language choice alone does not establish speed or memory efficiency. See Contributing for test and coverage commands.

project files -> scan and compile -> canonical graph -> bounded source context
agent outcomes -> shared work records -> task recovery and project overview

project compile, update_project and watch mode share the incremental compiler. File hashes, compiler options and successfully compiled content govern cache reuse. An incomplete scan cannot establish deletions or publish a new revision. See Incremental compilation for stage ordering, failures and recovery.

Storage defaults to ./.reql/memory.reql. Projects configure behavior through reql.conf; see Configuration for precedence and defaults. Storage accepts the current validated format. storage clear builds a fresh graph and discards history after a successful replacement; see Storage maintenance.

Interactive Launcher

From a development checkout:

uv run --no-sync python launcher.py
uv run --no-sync python launcher.py --storage .reql/memory.reql

The launcher guides storage selection, compilation, queries, analysis, reports, exports and MCP configuration. Use the CLI for scripting and the complete command surface. See CLI entry points.

Documentation

Guide Contents
Architecture Components, ownership and dependency boundaries
CLI Commands, arguments, installation and source-context output
Configuration Defaults, reql.conf, overrides and scan rules
Engineering coordination Work records, sessions, batches and handoffs
Incremental compilation Stages, cache, deletion and recovery
Storage Format, transactions, locking and maintenance
Artifact ingestion Document parsers, fragments and relations
Code analysis Languages, Tree-sitter and static findings
REQL language Query syntax and examples
Schema Node, edge and provenance fields
Graph analysis Communities, hubs and bridge signals
Repository explanation Derived capabilities and semantic workflows
Reporting Reports and HTML/Mermaid export
MCP server Transports, tools and client configuration
Extending Adapter and extractor contracts

Architecture

The public API delegates to application services, deterministic engines and the GraphStore storage port. Repository facts, shared engineering work and private scratch have separate owners. See the architecture guide.

Public API

The canonical import is from reql import MemoryGraph. The same package exposes BlockGraphStore for direct storage access and typed query-context models:

For API use, add reql to your application's Python environment (for example, uv add reql). A CLI tool installation has its own isolated environment.

from reql import MemoryGraph, QueryContextRequest, QueryMode, RetrievalBudget

graph = MemoryGraph.open(".reql/memory.reql")
try:
    graph.compile_project(".")
    request = QueryContextRequest(
        text="payment service",
        mode=QueryMode.INFORMATIVE,
        scopes=frozenset({"code"}),
        budget=RetrievalBudget(top_k=20, max_depth=3, max_items=20),
    )
    result = graph.query_context_result(request)
    print(result.to_dict())
finally:
    graph.close()

The MemoryGraph facade exposes compilation, retrieval, inspection, REQL queries, reporting and analysis. Python compilation overrides use CompilationOptions from memory.artifacts; see typed configuration. Context requests return schema-version-2 envelopes with source revision, freshness, confidence and a nested payload; see retrieval contracts.

License

MIT. See LICENSE.

Contributing

See CONTRIBUTING.md for setup, tests and pull request expectations. Generated stores and caches stay local.

Metadata

Release files for reql 0.2.0

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

Source distribution (sdist)

Source distribution for reql 0.2.0
File Size Uploaded Provenance Actions
reql-0.2.0.tar.gz 446.2 kB Without provenance Details for reql-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 904.5 kB

Release files / reql-0.2.0.tar.gz

Download URL reql-0.2.0.tar.gz
Size 446.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3a8850bf4d17a755aafd20a91467f6064d045712d66b9b5f2bb4748ca39b66e5
BLAKE2b-256 checksum
How to use checksums
738b459667718be8cf6c7650bafca2eefea39b69e3614a7cabefaeeab65e1ab4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / reql-0.2.0-py3-none-any.whl

Download URL reql-0.2.0-py3-none-any.whl
Size 458.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8593e59c762303bfbecb089ba716ecc12dd390b88ce2b80809b50f1644aa0bc2
BLAKE2b-256 checksum
How to use checksums
391f67be15fe2704b33324cfefaf55b286ff33f1d070297587f89da968f785d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Security for reql 0.2.0

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.

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