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.
FAQ
ratel is a Claude Code plugin with 1 hand-picked skill for development work, indexed on Flowy. Install it with the command on its page. It includes changelog. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
$ npx -y skills add ratel-ai/ratel --agent claude-code
Repo: ratel-ai/ratel
The context engineering layer for AI agents. Selects only the tools and skills relevant to each turn, recovering accuracy lost to tool overload and cutting what you pay per call. No vector DB, no infra.
Across local, open-source, and frontier model setups, Ratel cuts token usage and recovers accuracy lost to tool overload, with no vector DB required. Full results: benchmark.ratel.sh
Guides: Quickstart ยท TypeScript SDK ยท Python SDK
Examples: Vercel AI SDK ยท Pydantic AI
Install the SDK first:
pnpm add @ratel-ai/sdk
Then create and use your Catalogs:
import { readFile } from "node:fs/promises";
import {
SkillCatalog,
ToolCatalog,
getSkillContentTool,
invokeToolTool,
searchCapabilitiesTool,
} from "@ratel-ai/sdk";
const catalog = new ToolCatalog();
catalog.register({
id: "read_file",
name: "read_file",
description: "Read a file from local disk.",
inputSchema: { type: "object", properties: { path: { type: "string" } } },
outputSchema: { type: "object", properties: { contents: { type: "string" } } },
execute: async ({ path }) => ({ contents: await readFile(path, "utf8") }),
});
const skills = new SkillCatalog();
skills.register({
id: "inspect-local-file",
name: "inspect-local-file",
description: "Inspect a local file before answering questions about it.",
tools: ["read_file"],
body: "Read the requested file, then ground your answer in its contents.",
});
// use the following as tools in your agent framework
const search = searchCapabilitiesTool(catalog, skills);
const invoke = invokeToolTool(catalog);
const loadSkill = getSkillContentTool(skills);
Install the SDK first:
pip install ratel-ai
Then create and use your Catalogs:
from ratel_ai import (
ExecutableTool,
Skill,
SkillCatalog,
ToolCatalog,
get_skill_content_tool,
invoke_tool_tool,
search_capabilities_tool,
)
catalog = ToolCatalog()
catalog.register(ExecutableTool(
id="read_file",
name="read_file",
description="Read a file from local disk.",
input_schema={"properties": {"path": {"type": "string"}}},
execute=lambda args: {"contents": open(args["path"]).read()},
))
skills = SkillCatalog()
skills.register(Skill(
id="inspect-local-file",
name="inspect-local-file",
description="Inspect a local file before answering questions about it.",
tools=["read_file"],
body="Read the requested file, then ground your answer in its contents.",
))
# use the following as tools in your agent framework
search = search_capabilities_tool(catalog, skills)
invoke = invoke_tool_tool(catalog)
load_skill = get_skill_content_tool(skills)
When your agent needs to act, it calls search_capabilities. Ratel searches separate tool and skill indexes and returns focused results from each. Tools can be invoked by id; skill instructions stay out of context until the agent loads a relevant playbook with get_skill_content.
The indexes use BM25 by default, the same algorithm behind most search engines, applied to schema-aware tool metadata and skill names, descriptions, and tags. Retrieval is fast and deterministic. Semantic and hybrid ranking are opt-in per catalog or per call; SDK callers register (which embeds) and search dense indexes asynchronously, using either an in-process model or an OpenAI-compatible embedding endpoint.
Related open-source projects extend and validate this repository:
| Project | Repo | What it is |
|---|---|---|
| ratel-local | ratel-ai/ratel-mcp | The local distribution for your Coding Agents: Ratel in front of your MCP setup. |
| ratel-bench | ratel-ai/ratel-bench | The benchmark harness behind benchmark.ratel.sh. |
src/
โโโ core/ # ratel-ai-core โ Rust retrieval engine
โโโ sdk/ts/ # @ratel-ai/sdk โ TypeScript SDK (NAPI-bound)
โโโ sdk/python/ # ratel-ai โ Python SDK (PyO3-bound)
โโโ adapters/ts-vercel-ai-sdk/ # @ratel-ai/vercel-ai-sdk โ Vercel AI SDK adapter
โโโ adapters/ts-mastra/ # @ratel-ai/mastra โ Mastra adapter
โโโ telemetry/ # OTel conventions + helper packages
protocol/ # catalog-source wire contract
examples/ # End-to-end SDK examples
docs/
โโโ adr/ # Architecture decision records
โโโ assets/ # Images and other static assets
Prerequisites: Rust stable, Node 24+, pnpm 10.28+. Python SDK: Python 3.9+ and uv.
cargo build --workspace && cargo test --workspace # Rust
pnpm install && pnpm -r build && pnpm -r test # TypeScript
# Python: see src/sdk/python/README.md
The ratel-ai-core engine is licensed under Apache-2.0 โ an explicit patent grant for the engine others embed. Everything else (SDKs, telemetry helpers, examples) is MIT. See ADR-0009 for the rationale.
.adr-dir
.claude/
skills/
changelog/
draft.sh
SKILL.md
.github/
workflows/
build-binaries.yml
claude-code-review.yml
claude.yml
docs-rebuild.yml
markdown-links.yml
pr-gate.yml
protocol.yml
python-binaries.yml
python.yml
release.yml
rust.yml
ts.yml
verify-install.yml
.gitignore
.lycheeignore
AGENTS.md
biome.json
Cargo.lock
Cargo.toml
CLAUDE.md
cliff.toml
CODE_OF_CONDUCT.md
context7.json
CONTRIBUTING.md
docs/
adr/
0001-record-architecture-decisions.md
0002-product-split-engine-local-cloud.md
0003-catalog-source-interface.md
0004-retrieval-and-tool-selection.md
0005-first-class-skills.md
0006-native-ffi-bindings.md
0007-telemetry-two-streams.md
0008-release-engineering.md
0009-licensing.md
0010-catalog-scope-model.md
0011-selectable-retrieval-methods.md
0012-configurable-embedding-models.md
0013-framework-adapter-spi.md
0014-adaptive-usage-ranking.md
0015-whole-catalog-skill-reload.md
assets/
ratel-hero.gif
README.md
e2e/
fixtures/
catalog.json
skills.json
python/
run_e2e.py
README.md
scenario.json
ts/
run_e2e.mjs
examples/
adaptive-ranking-python/
adaptive_demo.py
main.py
model_swap.py
pyproject.toml
README.md
test_adaptive.py
tools.py
uv.lock
adaptive-ranking-ts/
package.json
README.md
src/
adaptive_demo.ts
index.ts
model-swap.ts
tools.ts
test/
adaptive.test.ts
tsconfig.json
ai-sdk/
package.json
README.md
src/
agent.ts
index.ts
tools.ts
test/
agent.test.ts
tsconfig.json
mastra/
package.json
README.md
src/
agent.ts
index.ts
tools.ts
test/
agent.test.ts
tsconfig.json
mcp-chat/
package.json
README.md
src/
chat.ts
index.ts
tools.ts
tsconfig.json
pydantic-ai/
agent.py
main.py
pyproject.toml
README.md
test_agent.py
tools.py
uv.lock
README.md
telemetry-python/
main.py
pyproject.toml
README.md
uv.lock
telemetry-ts/
package.json
README.md
src/
index.ts
tsconfig.json
LICENSE-APACHE
LICENSE.md
llms.txt
NOTICE
package.json
pnpm-lock.yaml
pnpm-workspace.yaml
protocol/
README.md
v1/
conformance/
README.md
vectors.json
verify.mjs
README.md
schema/
catalog-response.schema.json
catalog-skill.schema.json
error.schema.json
intent-graph.schema.json
README.md
RELEASING.md
rust-toolchain.toml
scripts/
check-release-tag.mjs
check-release-tag.test.mjs
inject-sdk-optional-deps.mjs
inject-sdk-optional-deps.test.mjs
publish-rc.sh
releasable.mjs
releasable.test.mjs
release-units.mjs
release-units.test.mjs
src/
adapters/
README.md
ts-mastra/
CHANGELOG.md
LICENSE.md
package.json
README.md
src/
conformance.test.ts
index.ts
mastra.integration.test.ts
mastra.test.ts
mastra.ts
mastra.type-test.ts
package-layout.test.ts
tsconfig.json
tsconfig.type-tests.json
ts-vercel-ai-sdk/
CHANGELOG.md
LICENSE.md
package.json
README.md
src/
aisdk.test.ts
aisdk.ts
aisdk.type-test.ts
coexistence.test.ts
conformance.test.ts
generate-text.test.ts
index.ts
otel.test.ts
otel.ts
package-layout.test.ts
telemetry-wiring.type-test.ts
test-support/
mock-model.ts
tsconfig.json
tsconfig.type-tests.json
core/
Cargo.toml
CHANGELOG.md
examples/
search_demo.rs
README.md
src/
dense_cache.rs
dense_search.rs
embedding_config.rs
embedding.rs
fusion.rs
indexing.rs
lib.rs
method.rs
search.rs
skill_indexing.rs
skill_registry.rs
skill.rs
tool_registry.rs
tool.rs
trace/
event.rs
mod.rs
sink.rs
usage_learner.rs
usage.rs
tests/
tool_search.rs
trace.rs
usage_ranking.rs
sdk/
python/
.gitignore
CHANGELOG.md
LICENSE.md
native/
Cargo.toml
README.md
src/
lib.rs
pyproject.toml
ratel_ai/
__init__.py
_native.pyi
capabilities.py
catalog.py
compat.py
exceptions.py
mcp.py
py.typed
skill_catalog.py
skill_tools.py
telemetry.py
README.md
tests/
conftest.py
test_adaptive_ranking.py
test_capabilities.py
test_catalog.py
test_compat.py
test_index.py
test_mcp.py
test_native.py
test_skill_catalog.py
test_skill_tools.py
test_telemetry.py
test_typing.py
typecheck/
registry_api_invalid.py
registry_api_valid.py
README.md
ts/
CHANGELOG.md
LICENSE.md
native/
build.rs
Cargo.toml
README.md
src/
lib.rs
npm/
darwin-arm64/
package.json
README.md
darwin-x64/
package.json
README.md
linux-arm64-gnu/
package.json
README.md
linux-x64-gnu/
package.json
README.md
win32-x64-msvc/
package.json
README.md
package.json
README.md
src/
adaptive-ranking.test.ts
async.ts
capabilities.test.ts
capabilities.ts
catalog.test.ts
catalog.ts
catalog.type-test.ts
compact.ts
compat.test.ts
compat.ts
errors.test.ts
errors.ts
index.test.ts
index.ts
mcp.test.ts
mcp.ts
package-resolution.test.ts
package-resolution.ts
ratel.test.ts
ratel.ts
registry.ts
skill-catalog.test.ts
skill-catalog.ts
skill-tools.test.ts
skill-tools.ts
telemetry.test.ts
telemetry.ts
test-support/
broken-adapters.ts
delayed-embedding-server.ts
evaluation-witness.mjs
testkit/
cases.ts
conformance.test.ts
harness.ts
index.ts
reference-adapter.ts
tsconfig.json
tsconfig.type-tests.json
typedoc.json
telemetry/
conformance/
fixtures.json
README.md
CONVENTIONS.md
core/
Cargo.toml
CHANGELOG.md
README.md
src/
lib.rs
python/
.gitignore
CHANGELOG.md
LICENSE.md
pyproject.toml
ratel_ai_telemetry/
__init__.py
otlp.py
py.typed
README.md
tests/
conftest.py
test_conformance.py
test_constants.py
test_import_purity.py
test_init.py
test_processor.py
README.md
ts/
CHANGELOG.md
LICENSE.md
package.json
README.md
src/
conformance.test.ts
content-capture.test.ts
content-capture.ts
index.test.ts
index.ts
package-purity.test.ts
tsconfig.jsonยฉ 2026 Flowy ยท Free and open source
Built for Claude Code ยท Not affiliated with Anthropic