ratel-ai/ratel

Context engineering for AI agents. ~80% fewer tokens. Fix tool overload. Skills and memory with in-process BM25 and semantic retrieval. Progressive Disclosure. No vector DB.

What it solves

Ratel addresses the problem of "tool overload" in AI agents. When agents are given too many tools or complex instructions in their system prompt, token costs increase and model accuracy decreases because the agent may pick the wrong tool or drift off task. Ratel prevents this by ensuring the agent only receives the tools and skills relevant to the current turn of the conversation.

How it works

Instead of loading all capabilities up front, Ratel uses a context engineering layer that indexes tools and skills into a catalog. The agent uses a search_capabilities tool to find relevant capabilities and then loads specific tool or skill content as needed.

By default, it uses the BM25 search algorithm for fast, deterministic retrieval based on metadata, names, and descriptions. It also supports optional semantic and hybrid ranking via embedding endpoints or in-process models, all without requiring a separate vector database.

Who it’s for

Developers building AI agents who want to reduce token usage and improve model reliability when dealing with a large library of available tools and skills.

Highlights

  • Token Efficiency: Reduces costs by avoiding sending unused tool schemas in every call.
  • Accuracy Recovery: Improves model performance by removing irrelevant context that can often confuse LLMs.
  • No Infrastructure Overhead: Works without the need for a dedicated vector database.
  • Multi-language Support: Provides SDKs for TypeScript and Python, with a core retrieval engine written in Rust.