ryo-query-language
Status: stable. Part of the ryo workspace — AST-centric Rust programming for AI agents.
RyoQL — a structured code query language for AI agents. Solves the two failure
modes of free-text agent prompts: (1) the cost of putting requirements into
natural language, by giving a YAML / JSON schema; and (2) dead-end behaviour
when nothing matches, by surfacing on_empty hints and suggestions in the
response.
Install
Quickstart
use execute_yaml;
let yaml = r#"
kind: Function
match:
name: process
vis: Public
view: Snippet
"#;
// Execute against an analysis context
// let response = execute_yaml(yaml, &ctx)?;
YAML query schema (excerpt):
kind: Function # Function / Struct / Enum / Trait / Impl
match: # field-level predicates
name: "process"
vis: Public
is_async: true
inner: # nested conditions
- kind: ReturnType
match:
resolve: # optional LSP-style relations
type: References
scope: # search scope
path: "src/**"
view: Snippet # Snippet / Precise / Files / Count
API Summary
| Module | Purpose |
|---|---|
schema::* |
YAML / JSON query schema types |
parser::{QueryParser, parse_view_mode} |
Text → typed query |
converter::{QueryConverter, CompositeQuery} |
Query → DiscoveryQuery |
executor::{execute_query, execute_yaml, QueryExecutor} |
Query execution |
filter::* |
Post-filter passes |
formatter::* |
Response formatting |
Status
API surface considered stable for the v0.1.0 release.
License
Licensed under either of Apache-2.0 or MIT at your option.