Custom AI Agents

Agent — a configurable entity in Citeck with a system prompt, an LLM provider, and a set of tools. Stored as a Citeck record of type emodel/ai-agent.

This article describes the agent data model, execution modes, available tools, and the procedure for creating agents and custom tools.

Data Model

The data model is defined in AgentDefinition.kt:

Field

Type

Required

Description

name

TEXT

yes

Agent display name

instruction

TEXT

yes

System prompt

aiProvider

TEXT

yes

LLM provider identifier

aiModel

TEXT

yes

Model identifier

temperature

NUMBER

no

Degree of randomness in generation: 0.0 — deterministic output (the model always picks the most probable token), 1.0 — high response variability. Values above 1.0 are allowed but increase the risk of incoherent text. Recommended range: 0.00.3 for factual tasks (summarization, data extraction), 0.60.9 for conversational agents. Default: 0.7.

tools

TEXT[]

no

List of connected tools

enabled

BOOLEAN

no

Whether the agent is enabled (default false)

Execution Modes

Stateless

One request — one response, with no memory of previous messages. Used in BPMN processes via POST /api/ai-agent/execute.

Invoked via AgentExecutionService.execute.

Warning

The stateless path has no HITL confirmation. Tool calls run under the Camunda technical user, which effectively bypasses Citeck record-level permissions. Do not add destructive tools (mutateRecord, deleteRecords) to agents without a dedicated authorization design.

Stateful / Interactive

Multi-turn dialogue with ChatMemory, requires a conversationId. Used in the AI Assistant UI.

Invoked via AgentExecutionService.executeInteractive.

REST API

Method

URL

Description

GET

/api/ai-agent/available-providers

List of connected LLM providers

GET

/api/ai-agent/available-tools

Tools available to agents

POST

/api/ai-agent/execute

Stateless call: {agentId, message, context}{response}

GET

/api/ai-agent/list

List of enabled agents

Available Tools

By default isAvailableForAgents() = true. Internal service tools override this to false and are not available to agents — SaveFormDraftTool, SaveDataTypeDraftTool, SaveEscalationTool, and similar.

Tool

Description

GetRecordAttributesTool

Record attributes

GetRecordContentTool

Document content

GetRecordContentHistoryTools

Version history

GetRecordDisplayNameTool

Display name

GetRecordTypeMetadataTool

Type metadata

GetRecordContactsTool

Record contacts

QueryRecordsTool

Record search

MutateRecordTool

Record mutation

DeleteRecordsTool

Record deletion

GetActivitiesTool

Activities

GetEcosAppContentTool

ECOS application content

GetArtifactMetadataTool

Artifact metadata

SearchDocumentationTool

Documentation search

RagSearchTool / RagGetDocumentTool

RAG search (if enabled)

DocumentAnalysisTool

Document analysis

GetCurrentTimeTool

Current time

Creating an Agent

Via UI

In the administrator workspace, navigate to the AI section and open the AI Agents journal:

  1. Fill in the Name, System prompt, select the LLM Provider and Model.

  2. Optional: add tools and set the Temperature.

  3. Check the Enabled checkbox and save.

Citeck Artifacts

Agent artifacts are located in the following files:

Artifact

Path

Type

src/main/resources/eapps/artifacts/model/type/ai-agent.yml

Journal

src/main/resources/eapps/artifacts/ui/journal/ai-agents-journal.yml

Form

src/main/resources/eapps/artifacts/ui/form/ai-agent-form.json

Creating a Custom Tool

Implement the CiteckAiTool interface and annotate the class as a Spring component:

@Component
class MyCustomTool(
    private val someService: SomeService
) : CiteckAiTool {
    companion object {
        const val NAME = "my_custom_tool"
    }

    override fun getName(): String = NAME
    override fun getDescription(): String = "Описание для LLM"

    @Tool(name = NAME, description = "Описание для LLM")
    fun myAction(param: String): String {
        return someService.doSomething(param)
    }
}

Spring DI will automatically discover the tool via List<CiteckAiTool> and add it to the list of available tools.

To hide a tool from agents (internal use only):

override fun isAvailableForAgents(): Boolean = false

Routing in the Orchestrator

AgentOrchestratorService.processRequest() — first routing priority: if an agent is bound to the conversation (resolveAgentRef), all processing is delegated to AgentExecutionService.executeInteractive(), bypassing Intent Detection and Plan-and-Execute.

Key Files

Component

File

Data Model

src/main/java/ru/citeck/ecos/ai/domain/agent/AgentDefinition.kt

Agent registry

src/main/java/ru/citeck/ecos/ai/domain/agent/AgentRegistry.kt

Execution service

src/main/java/ru/citeck/ecos/ai/domain/agent/AgentExecutionService.kt

REST controller

src/main/java/ru/citeck/ecos/ai/domain/agent/AgentController.kt

Tool interface

src/main/java/ru/citeck/ecos/ai/domain/assistant/tools/CiteckAiTool.kt

ECOS type

src/main/resources/eapps/artifacts/model/type/ai-agent.yml

ECOS journal

src/main/resources/eapps/artifacts/ui/journal/ai-agents-journal.yml

ECOS form

src/main/resources/eapps/artifacts/ui/form/ai-agent-form.json