Ratel is a context engineering layer that decides which tools and skills an agent sees on each turn. Instead of sending every tool schema and skill into the system prompt on every call, it indexes them into catalogs that the agent searches as it works, and injects only the matching capabilities. The aim is lower token cost and fewer wrong tool picks when an agent has many tools available.
The agent gets three tools: one to search capabilities, one to invoke a tool by ID, and one to load a skill's instructions. Skill bodies stay out of context until the agent loads a relevant playbook. Grounding the agent always needs, such as a shop's address or a brand's voice, is registered as facts and re-injected only when it is no longer fresh in the transcript.
Retrieval runs in process with no vector database. Indexes use BM25 by default over tool names, descriptions, and argument names, and over skill names, descriptions, and tags. Semantic and hybrid ranking are opt-in per catalog or per call, using an in-process embedding model or an OpenAI-compatible embedding endpoint.
The retrieval engine is written in Rust, with a TypeScript SDK and a Python SDK bound to it, adapters for the Vercel AI SDK and Mastra, and OpenTelemetry conventions for telemetry. A separate local distribution places Ratel in front of a coding agent's MCP setup, and a benchmark harness publishes token and accuracy results.
Features
- Progressive disclosure: the agent searches for the tools and skills each turn needs instead of loading all of them up front
- Separate indexes: tool and skill catalogs are searched independently and return focused results from each
- Deferred skills: skill instructions stay out of context until the agent loads one
- Facts: constant grounding is pushed into context and re-injected only when it is no longer fresh
- BM25 retrieval: deterministic in-process keyword search with no vector database
- Optional semantic search: dense and hybrid ranking with an in-process model or an OpenAI-compatible embedding endpoint
- SDKs and adapters: TypeScript and Python SDKs over a Rust core, with Vercel AI SDK and Mastra adapters
- Telemetry: OpenTelemetry conventions and helper packages
