# ryo-query-language
[](https://crates.io/crates/ryo-query-language)
[](https://docs.rs/ryo-query-language)
[](#license)
> **Status:** stable. Part of the [ryo](https://github.com/ynishi/ryo-rs) 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
```sh
cargo add ryo-query-language
```
## Quickstart
```rust
use ryo_query_language::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):
```yaml
kind: Function # Function / Struct / Enum / Trait / Impl
match: # field-level predicates
name: "process"
vis: Public
is_async: true
inner: # nested conditions
- kind: ReturnType
match: { name: "Result" }
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](https://github.com/ynishi/ryo-rs/blob/main/LICENSE-APACHE)
or [MIT](https://github.com/ynishi/ryo-rs/blob/main/LICENSE-MIT) at your option.