Class DemoAgent

All Implemented Interfaces:
GuardedExecution, ScopeAuthority, ArtifactRegistryAware, ConversationCarrier, Identifiable, Job<DemoAnswer>, ModelDependent, ModelDependentTool<DemoQuery, DemoAnswer>, Orchestrator<DemoQuery, DemoAnswer>, Thinker<DemoQuery, DemoAnswer>, Tool<DemoQuery, DemoAnswer>

public class DemoAgent extends SingleObjectiveThinker<DemoQuery, DemoAnswer>
The demo's one agent: a goal-directed thinker with two tools of its own, a catalog of tools it may ask for through request_tools, and a catalog of skills it may admit through request_skill. The skill catalog is everything the registry holds, which at startup is the demo's own bundle under META-INF/skills/ plus every skilljar on the classpath, the project's public one among them. Nothing here names a skill: a jar added to the classpath is on the catalog at the next start.
Since:
0.1 (2026-09-11)
Author:
Andrey Santrosyan
  • Constructor Details

  • Method Details

    • getSystemPromptText

      protected String getSystemPromptText()
      Description copied from class: SingleObjectiveThinker
      Simple-case override: return the static system-prompt text. Annotate the override with @StaticPrompt to declare the immutability contract.

      The auto-derived registry key is the subclass FQN. Pin an explicit key on the annotation (@StaticPrompt("ops.visible.key")) when ops needs a stable name for DB-stored overrides that survives class renames.

      Overrides:
      getSystemPromptText in class SingleObjectiveThinker<DemoQuery, DemoAnswer>
    • declareDefaultTools

      protected List<Class<? extends Tool>> declareDefaultTools()
      Description copied from class: AbstractThinker
      Declares the core tools this thinker always has loaded with full schemas. Called during construction to initialize the tool registry.
      Specified by:
      declareDefaultTools in class AbstractThinker<DemoQuery, DemoAnswer>
      Returns:
      List of tool classes, or empty list if no tools needed
    • declareCompatibleTools

      protected ToolSelector declareCompatibleTools()
      Description copied from class: AbstractThinker
      Declares additional tools this thinker may use, subject to admission. The catalog (name + description) appears in the system prompt. The LLM activates specific tools on demand via request_tools.

      Override to declare packages and/or individual tool classes:

      protected ToolSelector declareCompatibleTools() {
          ToolSelector sel = new ToolSelector("ai.redouble.nucleo.ext.lit");
          sel.addToolPackage("ai.redouble.nucleo.ext.patent.epo");
          sel.addClass(SomeSpecificTool.class);
          return sel;
      }
      
      Overrides:
      declareCompatibleTools in class AbstractThinker<DemoQuery, DemoAnswer>
      Returns:
      ToolSelector with compatible tools, or null if none
    • declareCompatibleSkills

      protected SkillSelector declareCompatibleSkills()
      Description copied from class: AbstractThinker
      Declares the skills this thinker's model may admit into the conversation at run time, subject to admission, the counterpart of AbstractThinker.declareCompatibleTools(). The catalog appears as the enumerated skillNames of the request_skill tool; the model admits one by name and its instructions ride every later call.

      Override to name skills, a bundle, or everything the registry holds:

      protected SkillSelector declareCompatibleSkills() {
          SkillSelector sel = new SkillSelector("delegation");
          sel.addBundle("ai.redouble.skills.");
          return sel;
      }
      
      Overrides:
      declareCompatibleSkills in class AbstractThinker<DemoQuery, DemoAnswer>
      Returns:
      SkillSelector with compatible skills, or null if none
    • palette

      public Set<String> palette()
      The palette as the model would see it this turn: every tool name on the registry. The palette depends on the input's depth, so an agent asked before it has one is given the default query.
    • offered

      public ToolProvider offered(String toolName)
      The provider behind one name on the palette, or null when the palette does not carry it.
    • skillCatalog

      public List<String> skillCatalog()
      The skills the model may admit, as the reconciled catalog stands now.