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 "tool overload" in AI agents, where providing too many tool schemas and instructions in a system prompt increases token costs and degrades model accuracy. It prevents the model from becoming confused by irrelevant options and reduces the financial cost of every API call by avoiding the need to send all available capabilities upfront.
How it works
Ratel acts as a context engineering layer that implements "progressive disclosure." Instead of loading all tools and skills into the prompt, it indexes them into catalogs. The agent uses a search_capabilities tool to find only the relevant tools and skills for the current turn.
- Retrieval: It uses BM25 (keyword search) by default for fast, deterministic retrieval based on metadata, names, and descriptions. Semantic and hybrid ranking are available as opt-in features via embedding endpoints.
- Skills: Complex instructions (playbooks) are kept out of the context until the agent explicitly loads them using a
get_skill_contenttool. - Facts: Constant grounding information (like brand voice or addresses) is registered as facts and re-injected only when not already present in the transcript.
Who it’s for
Developers building AI agents that require a large library of tools and skills but need to maintain high accuracy and low token consumption across local, open-source, or frontier models.
Highlights
- No Infrastructure Required: Works without needing a separate vector database.
- Multi-Language Support: Provides SDKs for TypeScript and Python, with a core engine written in Rust.
- Deterministic Search: Uses BM25 by default for reliable tool discovery.
- Framework Compatible: Includes adapters for the Vercel AI SDK and Mastra.
Related
- Dispatch
- Project
- Project
- Project
- Project