Interface AgentConnector
- All Superinterfaces:
Connector<AgentRequest>
- All Known Implementing Classes:
AgentConnectorImpl
Use the connector ID "cibseven-ai-agent" in a BPMN service task. The example below
shows every supported input/output parameter; only agentName and
message are required, the rest are optional. When instruction
is empty, the bundled default system prompt from
/org/cibseven/connect/ai/agent/default-instruction.txt is used.
<camunda:connector>
<camunda:connectorId>cibseven-ai-agent</camunda:connectorId>
<camunda:inputOutput>
<!-- Core agent configuration -->
<camunda:inputParameter name="agentName">my-agent</camunda:inputParameter>
<camunda:inputParameter name="agentDescription">Customer support agent</camunda:inputParameter>
<camunda:inputParameter name="instruction">You are a helpful assistant.</camunda:inputParameter>
<camunda:inputParameter name="instructionMode">append</camunda:inputParameter>
<camunda:inputParameter name="model">gpt-5.4-nano</camunda:inputParameter>
<camunda:inputParameter name="message">${userMessage}</camunda:inputParameter>
<!-- LLM endpoint / authentication -->
<camunda:inputParameter name="baseUrl">http://localhost:11434/v1</camunda:inputParameter>
<camunda:inputParameter name="apiKey">${secrets.OPENAI_API_KEY}</camunda:inputParameter>
<camunda:inputParameter name="customHeaders">{"Authorization": "Basic dXNlcjpwYXNz", "X-Tenant": "acme"}</camunda:inputParameter>
<!-- Reasoning controls -->
<camunda:inputParameter name="reasoningEffort">medium</camunda:inputParameter>
<camunda:inputParameter name="reasoningSummary">auto</camunda:inputParameter>
<!-- Tools: Java @Tool classes -->
<camunda:inputParameter name="toolClasses">com.example.WeatherTools,com.example.CalendarTools</camunda:inputParameter>
<!-- Tools: MCP servers (JSON array) -->
<camunda:inputParameter name="mcpServers">
[
{"url": "http://server1/mcp", "headers": {"Authorization": "Bearer abc"}},
{"url": "http://server2/mcp"}
]
</camunda:inputParameter>
<!-- Chat memory (e.g. human-feedback loop) -->
<camunda:inputParameter name="useChatMemory">true</camunda:inputParameter>
<camunda:inputParameter name="memoryId">${execution.getVariable('memoryId')}</camunda:inputParameter>
<camunda:inputParameter name="chatMemoryMaxMessages">20</camunda:inputParameter>
<!-- EU AI Act audit -->
<camunda:inputParameter name="persistChatLog">true</camunda:inputParameter>
<!-- RAG / pgvector embedding store -->
<camunda:inputParameter name="pgHost">localhost</camunda:inputParameter>
<camunda:inputParameter name="pgPort">5432</camunda:inputParameter>
<camunda:inputParameter name="pgDatabase">vectors</camunda:inputParameter>
<camunda:inputParameter name="pgUser">postgres</camunda:inputParameter>
<camunda:inputParameter name="pgPassword">${secrets.PG_PASSWORD}</camunda:inputParameter>
<camunda:inputParameter name="pgTable">embeddings</camunda:inputParameter>
<camunda:inputParameter name="maxRagResults">5</camunda:inputParameter>
<camunda:inputParameter name="minRagScore">0.7</camunda:inputParameter>
<camunda:inputParameter name="embeddingDimension">384</camunda:inputParameter>
<camunda:inputParameter name="embeddingModelName">text-embedding-3-small</camunda:inputParameter>
<!-- Output -->
<camunda:outputParameter name="agentOutput">${output}</camunda:outputParameter>
<camunda:outputParameter name="agentOutput_aiMeta">${outputAiMeta}</camunda:outputParameter>
<camunda:outputParameter name="memoryId">${memoryId}</camunda:outputParameter>
</camunda:inputOutput>
</camunda:connector>
The chat log is persisted automatically into a process-scoped variable named
AGENT_CONNECTOR_LOG_PREFIX + <activityId> and updated on every
request/response/error event of the underlying chat model.
If a variable with that name already exists when the connector runs, its content
is deserialised and used as the starting point — so multiple invocations of the
same service task within one process instance accumulate into a single timeline.
The chat log is not exposed as an output parameter because its serialised form
regularly exceeds the VARCHAR(4000) limit of Camunda's TEXT_ column.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConnector ID used in<camunda:connectorId>.static final StringOptional.static final StringRequired.static final StringOptional.static final StringOptional.static final StringOptional.static final StringOptional.static final StringOptional.static final StringOptional.static final StringOptional.static final StringOptional.static final StringOptional.static final StringOptional.static final StringOptional.static final StringRequired.static final StringOptional.static final StringOptional.static final StringThe final text response produced by the agent.static final StringEU AI Act Art.static final StringOptional.static final StringOptional.static final StringOptional.static final StringOptional.static final StringOptional.static final StringOptional.static final StringOptional.static final StringOptional.static final StringOptional.static final StringOptional.static final StringOptional. -
Method Summary
Methods inherited from interface org.cibseven.connect.spi.Connector
addRequestInterceptor, addRequestInterceptors, createRequest, execute, getId, getRequestInterceptors, setRequestInterceptors
-
Field Details
-
ID
Connector ID used in<camunda:connectorId>.- See Also:
-
PARAM_NAME_AGENT_NAME
Required. Logical name of the agent (passed toLlmAgent.builder().name()).- See Also:
-
PARAM_NAME_AGENT_DESCRIPTION
Optional. Human-readable description of the agent.- See Also:
-
PARAM_NAME_INSTRUCTION
Optional. System instruction for the LLM. Whennullor empty, the connector falls back to the bundled default prompt at/org/cibseven/connect/ai/agent/default-instruction.txt, which describes the generic CIB seven agent role and its possible capabilities (tools, RAG, chat memory, reasoning). Override this parameter to specialise the agent for a concrete task. SeePARAM_NAME_INSTRUCTION_MODEfor how this value is combined with the bundled default.- See Also:
-
PARAM_NAME_INSTRUCTION_MODE
Optional. Controls how the caller-suppliedPARAM_NAME_INSTRUCTIONis combined with the bundled default system prompt. Allowed values:"replace"(default) — the bundled default is discarded and onlyinstructionis sent to the LLM. Matches the historical behaviour."append"— the bundled default is sent first, followed byinstruction, separated by a blank line."prepend"—instructionis sent first, followed by the bundled default, separated by a blank line.
instructionis empty the mode is ignored — only the bundled default is used. An unknown value causes the connector to reject the request withAgentConnectorException.- See Also:
-
PARAM_NAME_MODEL
Optional. LLM model identifier (e.g.gpt-5.4-nano,claude-opus-4.7,gemma-4-26b; on OpenRouter prefix with provider, e.g.openai/gpt-5.4-nano). Defaults to "gpt-5.4-nano".- See Also:
-
PARAM_NAME_MESSAGE
Required. The user message to send to the agent.- See Also:
-
PARAM_NAME_TOOL_CLASSES
Optional. Comma-separated list of fully qualified class names whose@Tool-annotated methods are registered with the agent. Each class must have a public no-arg constructor. Example:"com.example.WeatherTools,com.example.CalendarTools"- See Also:
-
PARAM_NAME_BASE_URL
Optional. OpenAI-compatible base URL (e.g. for Ollama:"http://localhost:11434/v1"or Azure OpenAI endpoints). When omitted, the standard OpenAI API endpoint is used.- See Also:
-
PARAM_NAME_API_KEY
Optional. Override theOPENAI_API_KEYfor this specific request. The environment variableOPENAI_API_KEYis the recommended approach.- See Also:
-
PARAM_NAME_CUSTOM_HEADERS
Optional. Custom HTTP headers attached to every request sent to the OpenAI-compatible endpoint. Format: JSON object ofString→Stringpairs. Example:{"Authorization": "Basic dXNlcjpwYXNz", "X-Tenant": "acme"}- See Also:
-
PARAM_NAME_MCP_SERVERS
Optional. JSON array describing one or more MCP (Model Context Protocol) servers, each with its own URL and (optional) custom HTTP headers. Tools exposed by each server are registered with the agent in addition to anytoolClasses.Each entry must have a
urlstring;headersis an optional object ofString→Stringpairs. Example:[ {"url": "http://server1/mcp", "headers": {"Authorization": "Bearer abc"}}, {"url": "http://server2/mcp"} ]- See Also:
-
PARAM_NAME_REASONING_EFFORT
Optional. Reasoning effort hint for reasoning-capable models (e.g."low","medium","high"). Allowed values are model-dependent and forwarded as-is to the OpenAI builder.- See Also:
-
PARAM_NAME_REASONING_SUMMARY
Optional. Enables reasoning-summary text inAiMessage.thinking()(e.g."auto","concise","detailed"). Setting this value switches the connector to the OpenAI Responses API (OpenAiResponsesChatModel), which is required for reasoning summaries. Allowed values are model-dependent and forwarded as-is to the OpenAI builder.- See Also:
-
PARAM_NAME_USE_CHAT_MEMORY
Optional. Activates the per-conversation chat memory backed byAgentChatMemoryStore. Whentrue, the agent's prior messages — keyed byPARAM_NAME_MEMORY_ID— are replayed on every invocation so a BPMN process can resume the same conversation, typically after a human-feedback user task. Defaults tofalse(stateless).- See Also:
-
PARAM_NAME_MEMORY_ID
Optional. Identifier of the chat memory entry to reuse across invocations. Used together withPARAM_NAME_USE_CHAT_MEMORY. When the flag is active and this parameter isnullor empty, the connector generates a new UUID and exposes it as thePARAM_NAME_MEMORY_IDoutput so the caller can persist it (e.g. into a process variable) and pass it back on the next invocation.- See Also:
-
PARAM_NAME_CHAT_MEMORY_MAX_MESSAGES
Optional. Sliding window size (max number of messages retained) for the chat memory of a givenPARAM_NAME_MEMORY_ID. Defaults to 20.- See Also:
-
PARAM_NAME_PERSIST_CHAT_LOG
Optional. Per-activity override for the EU AI Act chat-log audit variable (cibseven-connect-ai-agent_<activityId>). Tri-state:null/ empty / unset — fall through to the deployment-wide default (system propertycibseven.connect.ai-agent.chatLogVariable.enabledor env varCIBSEVEN_CONNECT_AI_AGENT_CHAT_LOG_VARIABLE_ENABLED; built-in defaulttruefor compliance).true— write the chat-log variable for this activity, overriding a globalfalse.false— skip the chat-log variable for this activity, overriding a globaltrue.
HistoryEventHandlerchain, so external audit sinks keep working. Disabling here without an external sink breaks EU AI Act Art. 12 / 26(6) record-keeping — the modeler is responsible for that trade-off.- See Also:
-
PARAM_NAME_PG_HOST
Optional. PostgreSQL host for the pgvector embedding store. When present, RAG is activated for this request. Example:"localhost"or"pg.internal.example.com"- See Also:
-
PARAM_NAME_PG_PORT
Optional. PostgreSQL port. Defaults to "5432".- See Also:
-
PARAM_NAME_PG_DATABASE
Optional. PostgreSQL database name.- See Also:
-
PARAM_NAME_PG_USER
Optional. PostgreSQL user.- See Also:
-
PARAM_NAME_PG_PASSWORD
Optional. PostgreSQL password.- See Also:
-
PARAM_NAME_PG_TABLE
Optional. Name of the pgvector table holding embeddings. Defaults to "langchain4j_embeddings".- See Also:
-
PARAM_NAME_MAX_RAG_RESULTS
Optional. Maximum number of documents returned by the retriever per query. Defaults to 5.- See Also:
-
PARAM_NAME_MIN_RAG_SCORE
Optional. Minimum cosine-similarity score (0.0–1.0) for retrieved documents. Defaults to 0.0.- See Also:
-
PARAM_NAME_EMBEDDING_DIMENSION
Optional. Dimension of the embedding vectors stored in pgvector. Must match the model used during ingestion. Defaults to 384 (AllMiniLmL6V2EmbeddingModel).- See Also:
-
PARAM_NAME_EMBEDDING_MODEL_NAME
Optional. Embedding model name (e.g."text-embedding-3-small"). When set,OpenAiEmbeddingModelis used with the suppliedapiKey. When empty or absent, the localAllMiniLmL6V2EmbeddingModelis used as fallback.- See Also:
-
PARAM_NAME_OUTPUT
The final text response produced by the agent.- See Also:
-
PARAM_NAME_OUTPUT_AI_META
EU AI Act Art. 50(2) machine-readable marker for AI-generated output.A
Map<String,Object>carryingaiGenerated=true, therunIdthat produced the answer, the model identity (provider,model,responseId), and ageneratedAtISO-8601 timestamp. BPMN designers map it as a sibling of the main output variable, e.g.<camunda:outputParameter name="agentOutput_aiMeta">${outputAiMeta}</camunda:outputParameter>, so downstream Human Tasks, gateways, and history consumers can distinguish AI-generated values from human-authored ones.- See Also:
-