Claus Ibsen created CAMEL-27221:
-----------------------------------
Summary: camel-jbang - pattern recipes as Markdown in the CLI, and
recipe lookup for local models
Key: CAMEL-27221
URL: https://issues.apache.org/jira/browse/CAMEL-27221
Project: Camel
Issue Type: Improvement
Components: camel-jbang
Reporter: Claus Ibsen
Fix For: 4.24.0
Follow-up of CAMEL-23774 (pattern-level recipes catalog, PR #30345). The
recipes are aimed first at local models (14B-35B): the ticket came out of our
local-model benchmark runs, where small models found single options in the
catalog but got the composition wrong. This ticket covers how users and local
models get to the recipes.
h3. 1. One Markdown renderer
Render a recipe as Markdown once, and use it everywhere:
* title and problem
* components and EIPs
* recommended options as a table (option, value, why)
* pitfalls as a list
* the route as a {{yaml}} code block, the transport variants as extra sections
* requirements and links to the examples
h3. 2. CLI
* {{camel catalog recipe}} lists the recipes (id, name, problem)
* {{camel catalog recipe <id>}} prints one recipe as Markdown; an option writes
it to a {{.md}} file
* next to the existing {{camel catalog doc}}, {{camel catalog component}}
commands
h3. 3. Camel CLI terminal UI
* a recipe browser like the example browser: the list (name, problem) on one
side, the rendered Markdown in the doc viewer on the other
* one key copies the route into the project, or runs it (the "runnable from the
terminal" part of CAMEL-23774)
h3. 4. Local models: recipe vs camel_catalog_sample
The two tools work at different levels: {{camel_catalog_sample}} shows how to
write one named thing (an EIP, a component, a data format) and where it goes; a
recipe solves a problem with a whole route built from several of those, with
its pitfalls. Small models pick a tool by its description, and both
descriptions now talk about routes and snippets, so they get mixed up.
Options, from cheapest to boldest:
# Separate the triggers in the descriptions: a recipe when the user describes a
behaviour ("avoid duplicates", "retry then dead letter", "rate limit", "call
several services and combine"); a sample when writing a named EIP or component,
or after a schema error.
# Point between the tools in their answers (small models follow a hint in a
tool answer far better than one in a description): {{camel_catalog_sample
name=idempotentConsumer}} (also circuitBreaker, saga, throttle) ends with
"recipe available: idempotent-consumer"; a recipe answer ends with "check
options with camel_catalog_doc, validate with camel_validate_source".
# Fold the recipes into {{camel_catalog_sample}}, e.g.
{{name=recipe:idempotent-consumer}}, with the recipe ids in its list. One core
tool fewer, which matters for the small-model prompt budget, and small models
do better with fewer tools.
# One line in the system prompt: "for an integration problem, look for a recipe
first".
Proposed: 3 + 2, and the tool answer is the Markdown of point 1 (fewer tokens
and easier for a small model than escaped JSON with the YAML in a string).
h3. Measure
Benchmark prompts phrased as a problem ("don't process the same order twice
from Kafka") and as a named thing ("add an idempotentConsumer"): which tool the
model calls, and whether the route validates. Compare with and without the
recipes.
_Created by Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)