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
| Concept | Meaning |
|---|---|
| Agent | LLM loop definition with model, prompt, memory, tools, and exit condition |
| Tool | BLOGE operator-backed capability callable by the model |
| Memory | Retention strategy for messages between turns |
| Exit condition | Expression deciding when the loop stops |
| Streaming agent | Agent variant that emits incremental chunks |
DSL Shape
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 form | Behavior |
|---|---|
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_concurrencywhen tools can fan out. - Treat tool input schemas as public to the model.
- Run expensive or isolated tools as Remote Workers when needed.
Related AI Surface
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.