Chapter 3. Getting started with Kaoto


In this quickstart guide, you’ll build a Camel route that automatically summarizes text files using a local AI model. The route will monitor a folder for new text files, send their content to Ollama (running the Granite AI model), and output concise summaries.

3.1. Prerequisites

Before starting, ensure you have:

  1. VS Code installed on your system - Follow the installation guide
  2. Kaoto VS Code extension - See the installation guide for setup instructions
  3. Ollama installed and running - Follow the Ollama installation guide to set it up
  4. Granite 4 model pulled in Ollama - Run ollama pull granite4:tiny-h in your terminal (Granite 4 on Ollama))

3.2. Creating first Camel Route

3.2.2. Creating a new Camel Route

  1. In the Kaoto perspective, click Camel File in the Integrations section.

    01 new camel file
  2. Choose Camel Route as the route type.

    01 camel route item
  3. Choose between YAML DSL or XML DSL as the route type.

    01 yaml dsl item
  4. Provide a name for the new route.

    01 name
  5. A basic timer-based route will be created automatically.

    01 result

3.2.3. Running the Camel Route

  1. Click the Run: Workspace button in the Integrations panel.

    02 run workspace button
  2. The route will start executing, check the terminal output - you should see Hello Camel from route1 printed every second.

    02 run workspace output
  3. To stop the route, you can click on the Terminate button.

    02 run workspace terminate

3.3. Adding AI Summarization

This section describes how to add AI Summarization to your Camel Route using Kaoto. For this route, use Apache Camel 4.18 (or newer), make sure to select that version in the Runtime selector when creating your route.

03 select camel 4 18

For starters, instead of automatically producing empty messages with the timer component, use a file component for reading text files from a directory and place the text to summarize.

3.3.1. Adding the file component

  1. Hover over the timer node and click the replace button.

    03 replace timer
  2. In the component selection dialog, search for file and select the File component.

    03 pick file component
  3. You’ll end up having something like this, notice how hovering over the exclamation mark tells you that the directoryName configuration is missing!

    03 missing directory name
  4. Click on the file component, and fill the directoryName field with ./input.

    03 configuring directory name
  5. Click on the All toggle, and search for the noop property and enable it.

    03 enabling noop property
  6. Search for the idempotent property and enable it.

    03 enabling idempotent property
  7. Hover over the setBody node and click the delete button.

    03 delete setBody node
  8. Switch to the File explorer.

    03 file explorer
  9. Create a new folder called input with a story.txt file inside where you’ll be writing the text to summarize.

    03 folder structure
    Note

    For a text example, visit the wonderful Project Gutenberg and use a paragraph from the Alice’s Adventures in Wonderland, book by Lewis Carroll.

    You can also use the following text:

    First, she dreamed of little Alice herself, and once again the tiny hands were clasped upon her knee, and the bright eager eyes were looking up into hers—she could hear the very tones of her voice, and see that queer little toss of her head to keep back the wandering hair that would always get into her eyes—and still as she listened, or seemed to listen, the whole place around her became alive with the strange creatures of her little sister’s dream.

    The long grass rustled at her feet as the White Rabbit hurried by—the frightened Mouse splashed his way through the neighbouring pool—she could hear the rattle of the teacups as the March Hare and his friends shared their never-ending meal, and the shrill voice of the Queen ordering off her unfortunate guests to execution—once more the pig-baby was sneezing on the Duchess’s knee, while plates and dishes crashed around it—once more the shriek of the Gryphon, the squeaking of the Lizard’s slate-pencil, and the choking of the suppressed guinea-pigs, filled the air, mixed up with the distant sobs of the miserable Mock Turtle.

  10. Navigate back to the Kaoto perspective and run the route, you should get a similar output like this. Notice how you see the text as the route output.

    03 result
  11. Stop the route now. In the next step, add the OpenAI component to perform the summary.

    03 stop route

3.3.2. Adding the OpenAI component

For the summary process, use the OpenAI component to leverage our local Ollama instance with the Granite model.

  1. Hover in the edge between the file and log components, and click on the Add step button.

    04 add openai component
  2. In the component catalog, search for openai and select the OpenAI component.

    04 pick openai component
  3. Click on the newly added OpenAI component and select the All view to configure the following options:

    04 openai all configuration
    PropertyValue

    Operation

    chat-completion

    API Key

    OLLAMA-LOCAL-KEY

    Base URL

    http://localhost:11434/v1

    Model

    granite4:tiny-h

    System Message

    Summarize this text into a couple of short sentences and give it a funny twist

    Note

    To run Ollama locally, an API Key is not really needed. You can fill this field with any string, or the actual OLLAMA-LOCAL-KEY string.

    After editing the option, click on the Modified toggle to see what has changed in the route configuration.

    Note

    For the next step, make sure to run ollama run granite4:tiny-h in your terminal beforehand.

  4. Time of truth, run the route and see the summary. If everything went well, you should get a similar output like this:

    2026-03-26 13:09:37.293 INFO 592754 --- [ file://./input] demo.camel.yaml:19 : Once upon a time in Wonderland, Alice dreamt that her childhood fascination turned into a reality where she met her favorite characters from "Alice in Wonderland," but this time it’s all around her, filling her ears and eyes! Oh, and let’s not forget about the sneezing pig-baby and execution-ordered rabbit. Truly an unforgettable experience!

(Note: This is a lighthearted re-imagining of the original text.)

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat Documentation

Legal Notice

Theme

© 2026 Red Hat
Back to top