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

Expose a Camel route as a read-only resource that MCP clients list and read through the Camel MCP server.

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

Send a message to a bot on a ChatScript server and receive the reply of the bot.

Deep Java Library

Run inference with a deep learning model on the message body using Deep Java Library (DJL).

Docling

Convert documents such as PDF, Word or HTML files to Markdown, HTML, JSON or text, extract their metadata or chunk them, with the docling CLI or a docling-serve server.

KServe

Send inference requests to an AI model server over the KServe Open Inference Protocol v2 gRPC API, and check the readiness, liveness and metadata of the server and its 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

Send a message, a prompt template filled with variables, or a conversation to a chat model of LangChain4j and return its answer as text.

LangChain4j Embedding Store

Add, remove and search embeddings in a LangChain4j embedding store (a vector database).

LangChain4j Embeddings

Compute the embedding of a text, or of a List of texts, with an embedding model of LangChain4j, to store in a vector database or to search one by similarity.

LangChain4j Ingest

Ingest documents into a LangChain4j EmbeddingStore: the message body is split into text segments, or taken whole as media, embedded with an EmbeddingModel and stored.

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

Create, find and delete nodes in a Neo4j graph database, run Cypher queries, and store and search vector embeddings in a Neo4j vector index.

OpenAI

Send chat, Responses API, embeddings, audio, image, moderation and batch requests to OpenAI or an OpenAI-compatible server with the OpenAI Java SDK, and receive OpenAI webhook events.

PGVector

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

Pinecone

Create and delete indexes and collections, and upsert, update, fetch, query and delete vectors in the Pinecone vector database.

Qdrant

Create, inspect and delete collections, and upsert, retrieve, delete and search points in the Qdrant vector database.

Spring AI Chat

Send prompts to a chat model through the Spring AI ChatClient and return the answer of the model.

Spring AI Embeddings

Compute embedding vectors of text with a Spring AI EmbeddingModel.

Spring AI Image

Generate images from a text prompt with a Spring AI ImageModel.

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

Ask the TypeSafe AI decision API yes/no, choice and score questions about text or JSON data.

weaviate

Create and delete collections, and create, update, delete, fetch, search and count objects in a Weaviate vector database.