Quickstart

Quickstart

Overview

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.

Prerequisites

Before starting, ensure you have:

Create and Run Your First Route

  1. Open VS Code
  2. Click on the Kaoto icon in the Activity Bar (left sidebar)
  3. The Kaoto perspective will open, showing the route designer
Kaoto perspective

Kaoto perspective

Create a New Camel Route

  1. In the Kaoto perspective, click “Camel File…”

    New Camel file

    New Camel file

  2. Choose “Camel Route” as the route type

    Camel route item

    Camel route item

  3. Choose “YAML DSL” as the route type

    YAML DSL item

    YAML DSL item

  4. Give a name to the new route

    New route name

    New route name

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

Toggle Image
Expanded Image

Run the Simple Route

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

    Run workspace button

    Run workspace button

  2. The route will start executing, check the terminal output - you should see “Hello Camel from route1” printed every second

    Run workspace output

    Run workspace output

  3. To stop the route, you can click on the “Terminate” button

    Stop the route

    Stop the route

Add AI Summarization

For this route, we’re gonna use Apache Camel 4.18 (or newer), make sure to select that version in the Runtime selector

Select Camel 4.18 or newer

Select Camel 4.18 or newer

For starters, instead of automatically producing empty messages with the timer component, we’re gonna use a file component for reading text files from a directory where we’re gonna place the text to summarize

Add the File Component

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

    Replace timer

    Replace timer

  2. In the component catalog, search for “file” and select it

    Pick file component

    Pick file component

  3. You’ll end up having something like this, notice how hovering over the exclamation mark tell us that we’re missing the directoryName configuration

    Missing directoryName

    Missing directoryName

  4. Click on the file component, and fill the directoryName field with ./input

    Configuring directoryName

    Configuring directoryName

  5. Click on the All toggle, and search for the noop property and enable it

    Noop property

    Noop property

  6. Search for the idempotent property and enable it

    Idempotent property

    Idempotent property

  7. Hover over the setBody node and click the delete button

    Delete setBody

    Delete setBody

  8. Switch to the File explorer

    Navigate to file explorer

    Navigate to file explorer

  9. Create a new folder called input with a story.txt file inside where we’re gonna write the text to summarize.

    Folder structure

    Folder structure

Tip

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

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.

  1. Navigate back to the Kaoto perspective and run the route, you should get a similar output like this. Notice how we can see the text as the route output.
Toggle Image
Expanded Image
  1. We can stop the route now. In the next step, we’re gonna add the open ai component to perform the summary
    Stop route

    Stop route

Add the Open AI Component

For the summary process, we’re gonna use the Open AI 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

    Add Open AI component

    Add Open AI component

  2. In the component catalog, search for openai

    Pick Open AI component

    Pick Open AI component

  3. Once the openai component is added, click on it and pick the All view to configure the follow options:

    Select all configuration

    Select all configuration

PropertyValue
Operationchat-completion
Api KeyOLLAMA-LOCAL-KEY
Base Urlhttp://localhost:11434/v1
Modelgranite4:tiny-h
System MessageSummarize this text into a couple of short sentences and give it a funny twist
Tip

For running Ollama locally, a Api Key is not really needed, so we can fill this field with any string, or the actual “OLLAMA-LOCAL-KEY” string

Tip

After editing the option, you can click on the Modified toggle to see what has changed

Modified properties

Modified properties

Warning

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

  1. Time of truth, let’s 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 reimagining of the original text.)
Toggle Image
Expanded Image docs