BaseAsyncLlmAgentWithMemory

open class BaseAsyncLlmAgentWithMemory(broker: LlmBroker, model: String, val memory: SharedWorkingMemory, behaviour: String, val instructions: String, config: CompletionConfig = CompletionConfig()) : BaseAsyncLlmAgent

LLM-backed agent that remembers facts in a SharedWorkingMemory.

Before each turn the agent injects the current memory contents into the conversation as a system-style hint. After the turn, callers may use the returned response — for the Python reference the memory is updated from a structured-output field; the Kotlin port keeps the merge explicit so callers can pull the relevant block from a structured response themselves and pass it to mergeMemory (which is just a convenience wrapper around the memory's own merge).

Constructors

Link copied to clipboard
constructor(broker: LlmBroker, model: String, memory: SharedWorkingMemory, behaviour: String, instructions: String, config: CompletionConfig = CompletionConfig())

Properties

Link copied to clipboard

the system-prompt persona / instructions.

Link copied to clipboard

the LlmBroker used for generation.

Link copied to clipboard

completion-time settings (temperature, tool budget, etc.).

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

the LLM model identifier passed to the broker.

Link copied to clipboard

Immutable snapshot of currently registered tools.

Functions

Link copied to clipboard
fun addTool(tool: LlmTool)
Link copied to clipboard
open suspend override fun generateResponse(content: String): LlmGatewayResponse

Run a single LLM turn with content appended as a user message. Returns the full LlmGatewayResponse so subclasses can inspect content, tool calls, and structured output.

Link copied to clipboard
suspend fun mergeMemory(delta: Map<String, JsonElement>)
Link copied to clipboard
open suspend override fun receiveEvent(event: Event): List<Event>

Default implementation does nothing — override to emit follow-up events.