ratel-ai-core 0.6.0

Tool and skill retrieval for AI agents — selectable BM25, dense (semantic), or hybrid search over catalogs. Core of the Ratel context engineering platform.
Documentation

ratel-ai-core is Ratel's Rust retrieval engine. Register tool or skill metadata once, then rank the catalog for each agent turn. BM25 is the model-free default; semantic and hybrid retrieval use either an in-process model or a configured OpenAI-compatible embedding endpoint. The retrieval engine and cache stay in-process, with no vector database or Ratel service to deploy.

This crate owns retrieval and its local trace stream. Tool execution, MCP connections, and authentication integrations live in the SDK and local distribution.

Install

cargo add ratel-ai-core

Quickstart

Add this to src/main.rs, then run cargo run:

use ratel_ai_core::{Tool, ToolRegistry};

fn main() {
    let mut registry = ToolRegistry::new();
    for (id, description) in [
        ("read_file", "Read text from a local file"),
        ("send_email", "Send an email to a recipient"),
    ] {
        registry.register(Tool {
            id: id.into(),
            name: id.into(),
            description: description.into(),
            input_schema: Default::default(),
            output_schema: Default::default(),
        });
    }

    let hits = registry.search("read a local file", 1);
    assert_eq!(hits[0].tool_id, "read_file");
    println!("best tool: {}", hits[0].tool_id);
}

Package layout: src/ holds the retrieval and trace engine, examples/ contains runnable demos, and tests/ covers integration behavior. From a repository checkout, run cargo test -p ratel-ai-core or cargo run -p ratel-ai-core --example search_demo.

Continue with tool retrieval, the Rust API reference, or the source repository. Benchmark results are maintained separately in ratel-ai/ratel-bench.