Skip to content

Agents ​

Agents model an LLM reasoning loop as a first-class BLOGE extension. The bloge-agent-ext module adds an agent DSL, Java builder, synchronous and streaming loop operators, tool dispatch, memory strategies, and trace integration.

Core Concepts ​

ConceptMeaning
AgentLLM loop definition with model, prompt, memory, tools, and exit condition
ToolBLOGE operator-backed capability callable by the model
MemoryRetention strategy for messages between turns
Exit conditionExpression deciding when the loop stops
Streaming agentAgent variant that emits incremental chunks

DSL Shape ​

bloge
agent customerSupport {
  model                = "gpt-6-astra"
  system_prompt        = "You are a helpful customer support agent."
  max_turns            = 6
  max_tool_concurrency = 2
  temperature          = 0.2
  memory               = sliding_window(20)

  tool searchKnowledgeBase : KBSearchOperator {
    description = "Search the knowledge base for a relevant article"
    input {
      query = tool_args.query
    }
  }

  exit_condition = finish_reason == "stop" || tool_call("escalateToHuman")
}

Runtime Contract ​

AgentLoopOperator expects an llmChat operator in the hosting registry. Each declared tool runs as its own compiled BLOGE graph, so tool execution reuses normal graph semantics rather than a separate tool runtime.

StreamingAgentLoopOperator expects llmStreamingChat and emits AgentStreamChunk values through the streaming channel.

Memory Strategies ​

DSL formBehavior
full()Keep the whole conversation
sliding_window(n)Retain recent messages
token_budget(n)Retain as much history as fits a token budget
summary(n)Summarize older history when it exceeds the limit

Tool Guidance ​

  • Keep tools narrow and observable.
  • Give tools explicit descriptions; they become part of the model-facing contract.
  • Use max_tool_concurrency when tools can fan out.
  • Treat tool input schemas as public to the model.
  • Run expensive or isolated tools as Remote Workers when needed.

Agent runtime is different from AI authoring. AI authoring generates or validates .bloge source; agents execute LLM loops inside a graph. See AI Agents & LLM Operators for the broader AI operator and authoring overview.