REQL – A graph-native code index engine for agents. Scans Python, TypeScript, Go, Rust, Java, and 30+ languages to build a property graph with deterministic retrieval, no mandatory LLM calls, and bounded context for AI coding assistants.
Python
12
17 commits
updated Sep 22, 2026
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 answers bounded queries over code, symbols, tests, documents, dependencies, findings, and provenance.
In the intended coding-agent integration, the user does not treat REQL as a separate manual workflow. After the assistant instructions or skill are installed for Codex, Claude, Gemini, Cursor, or another agent environment, the agent uses REQL while it works: it compiles or refreshes the repository graph, retrieves compact source-backed context, records task-local notes and decisions, and reconstructs operational history and plans after context loss. Repository facts remain exclusively in the canonical project graph.
Token and reasoning budget: REQL helps coding agents spend fewer tokens on repository discovery and more tokens on the actual change. Bounded retrieval returns the files, symbols, relationships, and source spans that matter for the current task, while Agent Workspace preserves the task map, decisions, risks, and finish messages needed to reason through complex or large implementations across context windows.
The important part is that REQL gives the agent deterministic repository memory before and during edits:
project compile scans the project, fingerprints artifacts, parses supported
code and documents, and writes graph nodes, edges, cache records, compilation
runs, and deltas;query_context, query_explore, query_graph,
and query_memories find lexical seed nodes, expand a bounded graph
neighborhood, rank the result, and return compact source-backed context;query_context calls share one typed request/result
service, so scopes, budgets, confidence, and revision metadata have identical
semantics at every provider boundary;reql agent maintains per-agent working memory for plans, findings,
decisions, tasks, risks, and finish messages without changing the
canonical project graph;REQL is deterministic by default. Compilation, storage, query, retrieval, analysis, reports, and MCP access work locally without mandatory LLM calls, accounts, hosted services, or an external graph database. Optional semantic adapters can exist at integration boundaries, but the core memory system remains usable on its own.
REQL requires Python 3.10 or newer. Install the package with pip:
python -m pip install reql
For local development from a checkout, install it in editable mode:
python -m pip install -e .
Install assistant instructions for the coding-agent environment:
reql install codex
Replace codex with another supported agent platform, or let interactive
install auto-detect one. The installed instructions make REQL part of the
agent's normal repository workflow. The generated SKILL.md is a concise
coding workflow: REQL bounds discovery, while the checked-out source and tests
remain authoritative. Bootstrap, query,
update, reporting, document, and Agent Workspace details stay in routed
references/ files loaded only when their situation occurs.
The commands below are the operations the agent integration uses to bootstrap
context, retrieve focused evidence, and keep working memory:
reql project compile
reql project explain --focus "payment workflow"
reql project pipeline
reql project pipeline --code
reql query_context --query "payment service"
reql query_memories --query "payment service" --limit 8 --json
reql query_explore --query "payment service serialization" --view owners --view code
reql query_explore --query "profile template" --structural-duplicates-only
For coding-agent tasks, the normal query_context --code output shows at most
eight paths: five to eight source files when available, reduced as needed to
reserve room for up to three associated tests. Each source row includes its
owner symbols and best bounded line range. Detailed graph metadata and planning
fields remain available from query_context --json for programmatic consumers;
structured results include contract schema_version, a deterministic
graph_revision, and typed confidence metadata.
When the highest ranked score is below 0.25, query_context short-circuits
with Confidence: insufficient and explicitly allows one targeted rg
fallback using the user's exact symbol, path, or error terms.
Agent Workspace commands store the agent's session-scoped working state while it implements, reviews, or documents a repository:
reql agent init --name "Focused implementation pass"
reql agent dashboard
reql agent note "Read src/memory/cli.py and found the argparse command surface"
reql agent note --public "Parser API now returns a document result"
reql agent note --agent agent:reviewer "Check the updated parser return type"
reql agent task add "Implement the reset behavior"
reql agent task list
reql agent task done TASK_ID "Reset behavior implemented and tests pass"
reql agent finish "Implementation notes ready for master review"
reql agent list
reql agent terminate agent:stale-worker
reql agent search "parser return type"
reql agent init creates or resumes the selected private dashboard and marks
the agent active. Explicit reql agent --agent AGENT_ID ... or
REQL_AGENT_ID=AGENT_ID takes precedence over a stable activity or thread id.
Use reql agent dashboard for the public dashboard and the selected private
dashboard; use reql agent --agent "agent:AGENT_ID" dashboard to view another
agent's private dashboard when permitted.
The public dashboard contains the agent roster, coordination-safe active-task
summaries, shared context, and drill information. A private dashboard contains
the complete task list, private notes, and directed external notes. Public
notes, task-completion messages, and finish messages are all timestamped shared
context. Private history remains intact after finish or terminate.
reql agent finish "<outcome>" closes the current session, marks the agent
finished, and publishes its supplied message as shared context. reql agent terminate AGENT_ID performs the same lifecycle cleanup for a stale agent,
while preserving all task, note, and dashboard history.
reql agent list returns active agents by default; add --all for finished
and terminated agents. reql agent search QUERY searches public context and
permitted private dashboard history, returning timestamp, agent id, and enough
context to explain each match.
Use agent note TEXT for a private self-note, agent note --agent AGENT_ID TEXT to send a private note to another agent, and agent note --public TEXT
to publish shared context. Tasks remain private to their owner; only a task's
completion message becomes public.
reql agent reset discards the selected agent's dashboard history. It never
reads or modifies the canonical project graph.
Context results use schema version 2. Alongside the query-specific
graph_revision, they report the committed source_revision and freshness
state (current, refreshing, stale, or unknown).
From a source checkout, python cli.py ... exposes the same command surface
without requiring an editable install:
python cli.py project compile
python cli.py query_context --query "payment service"
Use the Python API directly:
from reql import MemoryGraph
graph = MemoryGraph.open(".reql/memory.reql")
try:
graph.compile_project(".")
context = graph.query_context("payment service")
print(context)
finally:
graph.close()
Start MCP when an integration needs a tool server:
reql-mcp --read-only
Project/cache commands and reql storage clear default storage to
./.reql/memory.reql; other commands default to
./.reql/memory.reql. storage clear rebuilds that store from the current
project tree and discards historical or archived graph state. Use --json for
automation. See docs/CLI.md
for the complete command reference, query modes, install behavior, MCP startup,
config lookup, reports, exports, and maintenance workflows.
Use reql config set OPTION VALUE to add or update a validated setting in the
local ./reql.conf, for example reql config set retention.agent_sessions 30.
Automatic project maintenance uses retention.commits from reql.conf
(default 20). A REQL commit is a successful compilation that changes the
project manifest and creates a ProjectRevision; clean compile invocations do
not advance retention. When the limit is exceeded, REQL removes history,
archived records, and project-owned usage entries older than the oldest retained
commit while preserving the active graph. Agent coordination records retain
the latest retention.agent_sessions completed sessions (default 20), and
finish preserves the completed agent's private dashboard history.
query_context, query_explore, query_graph, and query_memories
outputs for coding-agent workflows, including owner symbols, bounded source
ranges, and associated test targets.reql agent dashboard state for sessions, private tasks, private
and external notes, public notes, completion messages, and finish messages.
It contains no copied project, file, symbol, or canonical graph records.graph.html, interactive project
pipeline HTML and Mermaid export, guided launcher, installable CLI, typed
Python API, and optional dependency-free MCP server.REQL works as a local repository index backed by a property graph:
project compile scans the project with default ignores plus configured
include/exclude rules;project explain projects technical code facts into business capabilities,
architectural layers, multi-evidence semantic workflows with explicit
implemented_by participants, and focus-specific change guidance without
persisting another graph or requiring an LLM;project pipeline follows every detected entrypoint through project-local
flow relations, collapses symbols into shared architectural components, and
writes an interactive pipeline.html or Mermaid pipeline.mmd;project compile and watch mode reuse the same incremental compiler and
write CompilationRun, GraphDelta, and cache records for changed or
deleted artifacts.The core path is deterministic and local. Optional semantic adapters can exist at integration boundaries, but project compilation, storage, retrieval, reports, analysis, and MCP tools do not require model calls.
The project root launcher.py starts a guided terminal menu when run without
arguments. It uses ./.reql/memory.reql in the current working directory by default and lets you choose actions
interactively without writing command-line arguments:
python launcher.py
You can pass a storage path directly:
python launcher.py --storage .reql/memory.reql
The menu guides these workflows:
.reql/, open them, inspect them, or
delete managed .reql files after an explicit name confirmation;graph.html;reql-mcp.For command-line automation, use python cli.py ... or reql:
reql project compile
reql query_memories --query "payment service" --limit 5 --json
reql query "FIND nodes WHERE type = 'Function' LIMIT 10"
The README gives the project overview and common workflows. The focused
documentation lives under docs/:
reql.conf, defaults, overrides, scan rules,
cache settings, document ingest, analysis toggles, and loader behavior.FIND,
MATCH, PATH, SEARCH, RETRIEVE, EXPLAIN, filters, and examples.REQL has a project compile pipeline. compile builds a technical graph for
programming agents from scanning, AST/static analysis, document parsing, and
deterministic document-to-code linking. It does not extract memories from chat
or non-code prose.
Retrieval:
query
-> tokenization
-> lexical seed-node search
-> bounded graph expansion
-> graph-aware ranking
-> subgraph or context block
Maintenance:
activation and usage signals
-> salience update
-> sidecar retrieval usage updates
-> provenance preservation
Compile-time project scan:
project directory
-> recursive scanner
-> default ignore rules and config include/exclude filtering
-> file classification and SHA-256 fingerprints
-> Project + Directory + File + SourceArtifact nodes
-> CONTAINS edges
Project compile uses the same fingerprinting path and built-in default ignores.
Put additional compile exclusions in the configured scan.exclude list.
Incremental compilation:
SourceArtifact fingerprints
-> ArtifactCacheEntry comparison
-> dirty and deleted artifact set
-> deterministic compile graph updates
-> CompilationRun
-> GraphDelta
Artifact document parsing:
SourceArtifact bytes
-> document parser
-> DocumentFragment records
-> SourceFragment nodes
-> provenance and document relations
Code analysis:
code artifact
-> AST/static parser when supported
-> Module / Package / Class / Interface / Function / Method / useful Variable nodes
-> Import / Dependency / Endpoint / Schema / Config / Test nodes
-> CONTAINS / DEFINES / METHOD / IMPORTS / CALLS / REFERENCES / INHERITS edges
-> DEPENDS_ON / IMPORTS_FROM / RE_EXPORTS / READS / WRITES / RETURNS edges
-> RAISES / DECORATED_BY / HANDLES_ROUTE / HAS_FINDING edges
-> StaticAnalysisFinding cleanup candidates for unused code
Graph analysis:
graph nodes and edges
-> deterministic community detection
-> specificity-aware hub scoring
-> cross-community bridge edges
-> Community nodes, BRIDGES_COMMUNITY edges, and hub properties
src/api/
|-- memory_graph.py # Public facade
|-- __init__.py # Public Python API exports
src/agents/
|-- install.py # Agent skill/instruction installers
|-- __init__.py # Agent installer exports
src/mcp/
|-- tools.py # Dependency-free MCP tool handlers
`-- server.py # stdio and HTTP JSON-RPC MCP transports
src/memory/
|-- domain/ # Pure models, constants, ids, time, exceptions
|-- storage/ # Storage/extractor protocols and public exports
| `-- adapters/ # Concrete adapters, including BlockGraphStore
|-- extraction/ # Deterministic query/source extraction and optional adapters
|-- artifacts/ # Project scanning, file classification, fingerprints
|-- engines/ # Activation and salience scoring
| |-- activation.py # Spreading activation
| `-- salience.py # Salience scoring
|-- services/ # Application orchestration
| |-- retrieval/ # Search, expansion, context projections, renderers
| |-- incremental_compilation.py
| `-- project_watch.py
|-- query/ # REQL lexer, parser, AST, and evaluator
|-- analysis/ # Communities, centrality, specificity, hubs, bridges
|-- reporting/ # Markdown reports
|-- config/ # internal defaults, project models, and loader
`-- cli.py # Command-line interface
The main entry point is MemoryGraph. The canonical public import is
from reql import MemoryGraph.
from reql import MemoryGraph
graph = MemoryGraph.open(".reql/memory.reql")
Main operations:
retrieve(query)compose_context(query)query_context(query)query_context_result(QueryContextRequest(...))query_context_payload(query)query_explore(query)query_graph(query)query_memories(query)query_memories_payload(query)locate(path)inspect_node(node_id)export_json()query(statement)compile_project(path)update_project(path)watch_project(path)project_status(path)project_history(path)project_revision(revision_id)project_report(path, output_dir=...)project_pipeline(path)cache_status(path)clear_cache(path)list_deltas()show_delta(delta_id)detect_communities(project_id=...)analyze_hubs(project_id=..., limit=...)The typed query-context API is available from the canonical package:
from reql import MemoryGraph, QueryContextRequest, QueryMode, RetrievalBudget
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)
payload = result.to_dict()
Implement memory.storage.graph_store.GraphStore and pass it to the facade:
from reql import MemoryGraph
store = MyGraphStore(...)
graph = MemoryGraph(store)
The bundled block backend is portable local persistence, not an architectural constraint.
Implement SemanticExtractor:
class MyExtractor:
def extract(self, text: str):
...
graph = MemoryGraph.open(".reql/memory.reql", extractor=MyExtractor())
The extractor is used for query seed discovery. Project document ingest is
handled by the local deterministic compiler path. The default
MemoryGraph.open() extractor is dependency-free and deterministic.
Compile mode structurally parses text document fragments and links explicit documentation mentions back to compiled code symbols where possible.
Types are strings. To keep them coherent:
domain/constants.py;MIT. See LICENSE.
See CONTRIBUTING.md for development setup, contribution guidelines, and pull
request expectations.
17 commits
Python
100.0%
REQL – A graph-native code index engine for agents. Scans Python, TypeScript, Go, Rust, Java, and 30+ languages to build a property graph with deterministic retrieval, no mandatory LLM calls, and bounded context for AI coding assistants.
Python
12
17 commits
updated Sep 22, 2026
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 answers bounded queries over code, symbols, tests, documents, dependencies, findings, and provenance.
In the intended coding-agent integration, the user does not treat REQL as a separate manual workflow. After the assistant instructions or skill are installed for Codex, Claude, Gemini, Cursor, or another agent environment, the agent uses REQL while it works: it compiles or refreshes the repository graph, retrieves compact source-backed context, records task-local notes and decisions, and reconstructs operational history and plans after context loss. Repository facts remain exclusively in the canonical project graph.
Token and reasoning budget: REQL helps coding agents spend fewer tokens on repository discovery and more tokens on the actual change. Bounded retrieval returns the files, symbols, relationships, and source spans that matter for the current task, while Agent Workspace preserves the task map, decisions, risks, and finish messages needed to reason through complex or large implementations across context windows.
The important part is that REQL gives the agent deterministic repository memory before and during edits:
project compile scans the project, fingerprints artifacts, parses supported
code and documents, and writes graph nodes, edges, cache records, compilation
runs, and deltas;query_context, query_explore, query_graph,
and query_memories find lexical seed nodes, expand a bounded graph
neighborhood, rank the result, and return compact source-backed context;query_context calls share one typed request/result
service, so scopes, budgets, confidence, and revision metadata have identical
semantics at every provider boundary;reql agent maintains per-agent working memory for plans, findings,
decisions, tasks, risks, and finish messages without changing the
canonical project graph;REQL is deterministic by default. Compilation, storage, query, retrieval, analysis, reports, and MCP access work locally without mandatory LLM calls, accounts, hosted services, or an external graph database. Optional semantic adapters can exist at integration boundaries, but the core memory system remains usable on its own.
REQL requires Python 3.10 or newer. Install the package with pip:
python -m pip install reql
For local development from a checkout, install it in editable mode:
python -m pip install -e .
Install assistant instructions for the coding-agent environment:
reql install codex
Replace codex with another supported agent platform, or let interactive
install auto-detect one. The installed instructions make REQL part of the
agent's normal repository workflow. The generated SKILL.md is a concise
coding workflow: REQL bounds discovery, while the checked-out source and tests
remain authoritative. Bootstrap, query,
update, reporting, document, and Agent Workspace details stay in routed
references/ files loaded only when their situation occurs.
The commands below are the operations the agent integration uses to bootstrap
context, retrieve focused evidence, and keep working memory:
reql project compile
reql project explain --focus "payment workflow"
reql project pipeline
reql project pipeline --code
reql query_context --query "payment service"
reql query_memories --query "payment service" --limit 8 --json
reql query_explore --query "payment service serialization" --view owners --view code
reql query_explore --query "profile template" --structural-duplicates-only
For coding-agent tasks, the normal query_context --code output shows at most
eight paths: five to eight source files when available, reduced as needed to
reserve room for up to three associated tests. Each source row includes its
owner symbols and best bounded line range. Detailed graph metadata and planning
fields remain available from query_context --json for programmatic consumers;
structured results include contract schema_version, a deterministic
graph_revision, and typed confidence metadata.
When the highest ranked score is below 0.25, query_context short-circuits
with Confidence: insufficient and explicitly allows one targeted rg
fallback using the user's exact symbol, path, or error terms.
Agent Workspace commands store the agent's session-scoped working state while it implements, reviews, or documents a repository:
reql agent init --name "Focused implementation pass"
reql agent dashboard
reql agent note "Read src/memory/cli.py and found the argparse command surface"
reql agent note --public "Parser API now returns a document result"
reql agent note --agent agent:reviewer "Check the updated parser return type"
reql agent task add "Implement the reset behavior"
reql agent task list
reql agent task done TASK_ID "Reset behavior implemented and tests pass"
reql agent finish "Implementation notes ready for master review"
reql agent list
reql agent terminate agent:stale-worker
reql agent search "parser return type"
reql agent init creates or resumes the selected private dashboard and marks
the agent active. Explicit reql agent --agent AGENT_ID ... or
REQL_AGENT_ID=AGENT_ID takes precedence over a stable activity or thread id.
Use reql agent dashboard for the public dashboard and the selected private
dashboard; use reql agent --agent "agent:AGENT_ID" dashboard to view another
agent's private dashboard when permitted.
The public dashboard contains the agent roster, coordination-safe active-task
summaries, shared context, and drill information. A private dashboard contains
the complete task list, private notes, and directed external notes. Public
notes, task-completion messages, and finish messages are all timestamped shared
context. Private history remains intact after finish or terminate.
reql agent finish "<outcome>" closes the current session, marks the agent
finished, and publishes its supplied message as shared context. reql agent terminate AGENT_ID performs the same lifecycle cleanup for a stale agent,
while preserving all task, note, and dashboard history.
reql agent list returns active agents by default; add --all for finished
and terminated agents. reql agent search QUERY searches public context and
permitted private dashboard history, returning timestamp, agent id, and enough
context to explain each match.
Use agent note TEXT for a private self-note, agent note --agent AGENT_ID TEXT to send a private note to another agent, and agent note --public TEXT
to publish shared context. Tasks remain private to their owner; only a task's
completion message becomes public.
reql agent reset discards the selected agent's dashboard history. It never
reads or modifies the canonical project graph.
Context results use schema version 2. Alongside the query-specific
graph_revision, they report the committed source_revision and freshness
state (current, refreshing, stale, or unknown).
From a source checkout, python cli.py ... exposes the same command surface
without requiring an editable install:
python cli.py project compile
python cli.py query_context --query "payment service"
Use the Python API directly:
from reql import MemoryGraph
graph = MemoryGraph.open(".reql/memory.reql")
try:
graph.compile_project(".")
context = graph.query_context("payment service")
print(context)
finally:
graph.close()
Start MCP when an integration needs a tool server:
reql-mcp --read-only
Project/cache commands and reql storage clear default storage to
./.reql/memory.reql; other commands default to
./.reql/memory.reql. storage clear rebuilds that store from the current
project tree and discards historical or archived graph state. Use --json for
automation. See docs/CLI.md
for the complete command reference, query modes, install behavior, MCP startup,
config lookup, reports, exports, and maintenance workflows.
Use reql config set OPTION VALUE to add or update a validated setting in the
local ./reql.conf, for example reql config set retention.agent_sessions 30.
Automatic project maintenance uses retention.commits from reql.conf
(default 20). A REQL commit is a successful compilation that changes the
project manifest and creates a ProjectRevision; clean compile invocations do
not advance retention. When the limit is exceeded, REQL removes history,
archived records, and project-owned usage entries older than the oldest retained
commit while preserving the active graph. Agent coordination records retain
the latest retention.agent_sessions completed sessions (default 20), and
finish preserves the completed agent's private dashboard history.
query_context, query_explore, query_graph, and query_memories
outputs for coding-agent workflows, including owner symbols, bounded source
ranges, and associated test targets.reql agent dashboard state for sessions, private tasks, private
and external notes, public notes, completion messages, and finish messages.
It contains no copied project, file, symbol, or canonical graph records.graph.html, interactive project
pipeline HTML and Mermaid export, guided launcher, installable CLI, typed
Python API, and optional dependency-free MCP server.REQL works as a local repository index backed by a property graph:
project compile scans the project with default ignores plus configured
include/exclude rules;project explain projects technical code facts into business capabilities,
architectural layers, multi-evidence semantic workflows with explicit
implemented_by participants, and focus-specific change guidance without
persisting another graph or requiring an LLM;project pipeline follows every detected entrypoint through project-local
flow relations, collapses symbols into shared architectural components, and
writes an interactive pipeline.html or Mermaid pipeline.mmd;project compile and watch mode reuse the same incremental compiler and
write CompilationRun, GraphDelta, and cache records for changed or
deleted artifacts.The core path is deterministic and local. Optional semantic adapters can exist at integration boundaries, but project compilation, storage, retrieval, reports, analysis, and MCP tools do not require model calls.
The project root launcher.py starts a guided terminal menu when run without
arguments. It uses ./.reql/memory.reql in the current working directory by default and lets you choose actions
interactively without writing command-line arguments:
python launcher.py
You can pass a storage path directly:
python launcher.py --storage .reql/memory.reql
The menu guides these workflows:
.reql/, open them, inspect them, or
delete managed .reql files after an explicit name confirmation;graph.html;reql-mcp.For command-line automation, use python cli.py ... or reql:
reql project compile
reql query_memories --query "payment service" --limit 5 --json
reql query "FIND nodes WHERE type = 'Function' LIMIT 10"
The README gives the project overview and common workflows. The focused
documentation lives under docs/:
reql.conf, defaults, overrides, scan rules,
cache settings, document ingest, analysis toggles, and loader behavior.FIND,
MATCH, PATH, SEARCH, RETRIEVE, EXPLAIN, filters, and examples.REQL has a project compile pipeline. compile builds a technical graph for
programming agents from scanning, AST/static analysis, document parsing, and
deterministic document-to-code linking. It does not extract memories from chat
or non-code prose.
Retrieval:
query
-> tokenization
-> lexical seed-node search
-> bounded graph expansion
-> graph-aware ranking
-> subgraph or context block
Maintenance:
activation and usage signals
-> salience update
-> sidecar retrieval usage updates
-> provenance preservation
Compile-time project scan:
project directory
-> recursive scanner
-> default ignore rules and config include/exclude filtering
-> file classification and SHA-256 fingerprints
-> Project + Directory + File + SourceArtifact nodes
-> CONTAINS edges
Project compile uses the same fingerprinting path and built-in default ignores.
Put additional compile exclusions in the configured scan.exclude list.
Incremental compilation:
SourceArtifact fingerprints
-> ArtifactCacheEntry comparison
-> dirty and deleted artifact set
-> deterministic compile graph updates
-> CompilationRun
-> GraphDelta
Artifact document parsing:
SourceArtifact bytes
-> document parser
-> DocumentFragment records
-> SourceFragment nodes
-> provenance and document relations
Code analysis:
code artifact
-> AST/static parser when supported
-> Module / Package / Class / Interface / Function / Method / useful Variable nodes
-> Import / Dependency / Endpoint / Schema / Config / Test nodes
-> CONTAINS / DEFINES / METHOD / IMPORTS / CALLS / REFERENCES / INHERITS edges
-> DEPENDS_ON / IMPORTS_FROM / RE_EXPORTS / READS / WRITES / RETURNS edges
-> RAISES / DECORATED_BY / HANDLES_ROUTE / HAS_FINDING edges
-> StaticAnalysisFinding cleanup candidates for unused code
Graph analysis:
graph nodes and edges
-> deterministic community detection
-> specificity-aware hub scoring
-> cross-community bridge edges
-> Community nodes, BRIDGES_COMMUNITY edges, and hub properties
src/api/
|-- memory_graph.py # Public facade
|-- __init__.py # Public Python API exports
src/agents/
|-- install.py # Agent skill/instruction installers
|-- __init__.py # Agent installer exports
src/mcp/
|-- tools.py # Dependency-free MCP tool handlers
`-- server.py # stdio and HTTP JSON-RPC MCP transports
src/memory/
|-- domain/ # Pure models, constants, ids, time, exceptions
|-- storage/ # Storage/extractor protocols and public exports
| `-- adapters/ # Concrete adapters, including BlockGraphStore
|-- extraction/ # Deterministic query/source extraction and optional adapters
|-- artifacts/ # Project scanning, file classification, fingerprints
|-- engines/ # Activation and salience scoring
| |-- activation.py # Spreading activation
| `-- salience.py # Salience scoring
|-- services/ # Application orchestration
| |-- retrieval/ # Search, expansion, context projections, renderers
| |-- incremental_compilation.py
| `-- project_watch.py
|-- query/ # REQL lexer, parser, AST, and evaluator
|-- analysis/ # Communities, centrality, specificity, hubs, bridges
|-- reporting/ # Markdown reports
|-- config/ # internal defaults, project models, and loader
`-- cli.py # Command-line interface
The main entry point is MemoryGraph. The canonical public import is
from reql import MemoryGraph.
from reql import MemoryGraph
graph = MemoryGraph.open(".reql/memory.reql")
Main operations:
retrieve(query)compose_context(query)query_context(query)query_context_result(QueryContextRequest(...))query_context_payload(query)query_explore(query)query_graph(query)query_memories(query)query_memories_payload(query)locate(path)inspect_node(node_id)export_json()query(statement)compile_project(path)update_project(path)watch_project(path)project_status(path)project_history(path)project_revision(revision_id)project_report(path, output_dir=...)project_pipeline(path)cache_status(path)clear_cache(path)list_deltas()show_delta(delta_id)detect_communities(project_id=...)analyze_hubs(project_id=..., limit=...)The typed query-context API is available from the canonical package:
from reql import MemoryGraph, QueryContextRequest, QueryMode, RetrievalBudget
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)
payload = result.to_dict()
Implement memory.storage.graph_store.GraphStore and pass it to the facade:
from reql import MemoryGraph
store = MyGraphStore(...)
graph = MemoryGraph(store)
The bundled block backend is portable local persistence, not an architectural constraint.
Implement SemanticExtractor:
class MyExtractor:
def extract(self, text: str):
...
graph = MemoryGraph.open(".reql/memory.reql", extractor=MyExtractor())
The extractor is used for query seed discovery. Project document ingest is
handled by the local deterministic compiler path. The default
MemoryGraph.open() extractor is dependency-free and deterministic.
Compile mode structurally parses text document fragments and links explicit documentation mentions back to compiled code symbols where possible.
Types are strings. To keep them coherent:
domain/constants.py;MIT. See LICENSE.
See CONTRIBUTING.md for development setup, contribution guidelines, and pull
request expectations.
17 commits
Python
100.0%