Base starter module for the Embabel Agent Framework providing core dependencies for building agentic flows on the JVM with Spring Boot integration and GOAP-based intelligent path finding.
Actions are executable operations that agents perform. GOAP planner selects and sequences actions based on preconditions, postconditions, cost, and value.
@Action(
description = "What this action does", // Required
pre = {"condition1", "condition2"}, // Preconditions
post = {"newCondition"}, // Postconditions
cost = 10.0, // Execution cost
value = 50.0, // Result value
canRerun = true, // Allow multiple executions
outputBinding = "resultVar" // Blackboard variable name
)
public ResultType actionMethod(ParamType param, @Provided Ai ai) {
return result;
}Regular Parameters: Retrieved from blackboard (agent state)
public Result processData(Dataset data, String config) {
// 'data' and 'config' must be in blackboard
}Provided Parameters: Injected by platform using @Provided
public Result useAi(Input input, @Provided Ai ai, @Provided ActionContext ctx) {
// 'ai' and 'ctx' provided by platform
}Common provided types: Ai, ActionContext, AgentPlatform, PromptRunner, OutputChannel
GOAP uses these to plan action sequences:
@Action(description = "Fetch data", post = {"dataLoaded"})
public Data fetchData(String id) { }
@Action(description = "Validate", pre = {"dataLoaded"}, post = {"dataValidated"})
public ValidationResult validate(Data data) { }
@Action(description = "Process", pre = {"dataValidated"}, post = {"processed"})
public Result process(Data data) { }Planner automatically sequences: fetch → validate → process
Static values:
@Action(description = "Quick check", cost = 1.0, value = 10.0)Dynamic computation:
@Action(description = "Complex operation", costMethod = "computeCost")
public Result operate(Input input) { }
@Cost(name = "computeCost")
public double computeCost(Input input) {
return input.isComplex() ? 100.0 : 10.0;
}Store action results in blackboard:
@Action(description = "Load config", outputBinding = "config")
public Config loadConfig() {
return configService.load();
}
@Action(description = "Use config", pre = {"config"})
public Result useConfig(Config config) {
// 'config' available from blackboard
}Actions can use tools:
@Action(
description = "Process with tools",
toolGroups = {"data-tools"},
toolGroupRequirements = {"math-tools"}
)
public Result processWithTools(Input input, @Provided Ai ai) {
return ai.withTools(tools).createObject("Process: " + input);
}Override agent-level retry:
@Action(
description = "Critical - no retry",
actionRetryPolicy = ActionRetryPolicy.NO_RETRY
)
public void criticalOp() { }
@Action(
description = "Resilient operation",
actionRetryPolicy = ActionRetryPolicy.exponential(10, 500)
)
public Result resilientOp() { }Define reusable condition checks:
@Condition(name = "hasStock", cost = ZeroToOne.of(0.1))
public boolean checkStock(String productId) {
return inventory.hasStock(productId);
}
@Action(description = "Fulfill order", pre = {"hasStock"})
public Order fulfillOrder(String productId) { }See Also: Tools | Goals | API Reference
tessl i tessl/maven-com-embabel-agent--embabel-agent-starter@0.3.1docs