Phase 1: API Foundation
Tracking issue: #284
Module: main/api
Can start: Immediately
Blocks: Phase 2, Phase 3, Phase 4, Phase 5
π Plan reference: plans/agentic-aggregates.md β Phase 1: API Foundation
Overview
Introduce the new API types in main/api that form the foundation of the AgenticAggregate concept. These types are framework-level primitives referenced by all subsequent phases.
No new dependencies are introduced β this is pure Java interfaces, annotations, and records.
Tasks
1. @AgenticAggregateInfo Annotation
Create org.elasticsoftware.akces.annotations.AgenticAggregateInfo:
- Annotated with
@Retention(RetentionPolicy.RUNTIME), @Target({ElementType.TYPE}), @Component
- Attributes:
String value() β Spring component bean name (aliased via @AliasFor(annotation = Component.class))
Class<? extends AggregateState> stateClass() β the aggregate's state class
String description() default "" β optional human-readable description
int maxMemories() default 100 β sliding window capacity for the memory system
- Intentionally omitted (vs
@AggregateInfo):
- No
generateGDPRKeyOnCreate β no PIIData support in memories
- No
indexed / indexName β singletons are not indexed
- No partition count β always 1 partition (enforced by runtime)
2. AgenticAggregate Interface
Create org.elasticsoftware.akces.aggregate.AgenticAggregate<S extends AggregateState>:
- Extends
Aggregate<S>
- Adds a default method:
default List<AgenticAggregateMemory> getMemories(S state) {
if (state instanceof MemoryAwareState memoryState) {
return memoryState.getMemories();
}
return List.of();
}
- This provides type-safe, optional access to memories without requiring all states to implement
MemoryAwareState
3. MemoryAwareState Interface
Create org.elasticsoftware.akces.aggregate.MemoryAwareState:
public interface MemoryAwareState {
List<AgenticAggregateMemory> getMemories();
}
- Implemented by user-defined aggregate state classes to enable the memory system
- Decoupled from
AgenticAggregate itself so the state model stays clean
4. AgenticAggregateMemory Record
Create org.elasticsoftware.akces.aggregate.AgenticAggregateMemory:
public record AgenticAggregateMemory(
String memoryId, // UUID
String subject, // 1β2 word topic, e.g. "naming conventions"
String fact, // The fact to remember (max 200 chars)
String citations, // Source of the fact
String reason, // Why this fact is being stored
Instant storedAt
) {}
Acceptance Criteria
Phase 1: API Foundation
Tracking issue: #284
Module:
main/apiCan start: Immediately
Blocks: Phase 2, Phase 3, Phase 4, Phase 5
π Plan reference: plans/agentic-aggregates.md β Phase 1: API Foundation
Overview
Introduce the new API types in
main/apithat form the foundation of the AgenticAggregate concept. These types are framework-level primitives referenced by all subsequent phases.No new dependencies are introduced β this is pure Java interfaces, annotations, and records.
Tasks
1.
@AgenticAggregateInfoAnnotationCreate
org.elasticsoftware.akces.annotations.AgenticAggregateInfo:@Retention(RetentionPolicy.RUNTIME),@Target({ElementType.TYPE}),@ComponentString value()β Spring component bean name (aliased via@AliasFor(annotation = Component.class))Class<? extends AggregateState> stateClass()β the aggregate's state classString description() default ""β optional human-readable descriptionint maxMemories() default 100β sliding window capacity for the memory system@AggregateInfo):generateGDPRKeyOnCreateβ no PIIData support in memoriesindexed/indexNameβ singletons are not indexed2.
AgenticAggregateInterfaceCreate
org.elasticsoftware.akces.aggregate.AgenticAggregate<S extends AggregateState>:Aggregate<S>MemoryAwareState3.
MemoryAwareStateInterfaceCreate
org.elasticsoftware.akces.aggregate.MemoryAwareState:AgenticAggregateitself so the state model stays clean4.
AgenticAggregateMemoryRecordCreate
org.elasticsoftware.akces.aggregate.AgenticAggregateMemory:Acceptance Criteria
@AgenticAggregateInfoannotation is inmain/apiand compiles cleanlyAgenticAggregateinterface extendsAggregateand providesgetMemories()default methodMemoryAwareStateinterface is inmain/apiand has a singlegetMemories()methodAgenticAggregateMemoryrecord is inmain/apiwith all 6 fieldsmain/api/pom.xmlmain/apitests still pass (mvn testinmain/api)