Camel Components

AI

The Camel AI components are a group of components for applying Apache Camel to various AI-related technologies.

Getting started with LLMs

New to Camel AI? Start with the LLM Integration Guide — it explains when to use LLM (OpenAI-compatible) vs LangChain4j Chat, structured JSON extraction, streaming to browsers, dynamic prompts, and prompt management patterns.

Choosing the Right AI Component

Camel offers two main paths for integrating Large Language Models (LLMs) into routes:

  • LLM (OpenAI-compatible) — uses the llm: URI scheme (with openai: as a backward-compatible alias) to talk to OpenAI and any OpenAI-compatible API (OpenRouter, Ollama, vLLM, LM Studio). Native support for streaming, structured output (outputClass / jsonSchema), MCP tool calling, conversation memory, and the Responses API. Best when you are committed to the OpenAI ecosystem or using an OpenAI-compatible gateway.

  • LangChain4j Chat — abstracts through LangChain4j so you can switch LLM providers (OpenAI, Anthropic, Google Gemini, Mistral, Ollama, and others) by swapping a dependency. Also provides prompt templates with variables, RAG integration via the Content Enricher pattern, and multi-message conversation history.

Need camel-openai camel-langchain4j-chat

OpenAI or compatible API (OpenRouter, Ollama, vLLM)

Yes

Via LangChain4j provider

Switch providers without code changes

No (OpenAI-compatible only)

Yes

Streaming responses

Yes

Manual (via StreamingChatLanguageModel)

Structured output (JSON schema)

Yes (outputClass, jsonSchema)

No

Prompt templates with variables

No (use Simple expressions)

Yes (built-in `{{variable}}` syntax)

RAG pipelines

Manual

Yes (with LangChain4jRagAggregatorStrategy)

Embeddings

Yes

Via langchain4j-embeddingstore

If you already use an OpenAI-compatible API and want the richest feature set (streaming, MCP, structured output), start with camel-openai. If multi-provider flexibility is a hard requirement, use camel-langchain4j-chat. Both can coexist in the same project. For end-to-end pipeline examples, see the LLM Integration Guide.

AI components

See the following for usage of each component:

A2A

Expose a route as an agent and call remote agents with the Agent2Agent (A2A) protocol.

AI Prompt

Expose a Camel route as a prompt that MCP clients list and get through the Camel MCP server.

AI Resource

Framework-agnostic consumer endpoint that registers a Camel route as a read-only AI resource in the shared AiResourceRegistry.

AI Tool

Expose a Camel route as a tool that a model calls through a Camel AI producer, or that MCP clients call through the Camel MCP server.

ChatScript

Chat with a ChatScript Server.

Deep Java Library

Infer Deep Learning models from message exchanges data using Deep Java Library (DJL).

Docling

Process documents using Docling library for parsing and conversion.

KServe

Provide access to AI model servers with the KServe standard to run inference with remote models

LangChain4j Agent

Send a message to an AI agent of LangChain4j, which can call Camel routes and MCP servers as tools, and return its answer.

LangChain4j Chat

LangChain4j Chat component

LangChain4j Embedding Store

Perform operations on the LangChain4jEmbeddingStores.

LangChain4j Embeddings

LangChain4j Embeddings

LangChain4j Ingest

Ingest documents into a LangChain4j EmbeddingStore: split, embed and store the message body.

LangChain4j Web Search

Search the web with a LangChain4j web search engine, such as Tavily or Google Custom Search.

LLM Integration Guide
Milvus

Create collections and indexes, and insert, upsert, delete, search and query entities in the Milvus vector database.

Neo4j

Perform operations on the Neo4j Graph Database

OpenAI

LLM endpoint for chat completion, Responses API, embeddings, audio transcription, audio translation, and text-to-speech using OpenAI-compatible APIs. The openai scheme is a supported alias.

PGVector

Store, delete and search vector embeddings in a PostgreSQL table with the pgvector extension.

Pinecone

Perform operations on the Pinecone Vector Database.

Qdrant

Perform operations on the Qdrant Vector Database.

Spring AI Chat

Perform chat operations using Spring AI.

Spring AI Embeddings

Spring AI Embeddings

Spring AI Image

Spring AI Image Generation

Spring AI Vector Store

Store, delete and search documents in a vector database with Spring AI.

TensorFlow Serving

Run inference on the models of a TensorFlow Serving model server over gRPC, and get their status and metadata.

TypeSafe AI

Evaluate text and structured state with the TypeSafe AI decision API.

weaviate

Perform operations on the Weaviate Vector Database.