ryo-query-language 0.1.0

RyoQL - Structured code query language for AI agents
Documentation

ryo-query-language

crates.io docs.rs License: MIT OR Apache-2.0

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

cargo add ryo-query-language

Quickstart

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):

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 or MIT at your option.