Enum Class Knowledge.Type

java.lang.Object
java.lang.Enum<Knowledge.Type>
com.tnsai.annotations.Knowledge.Type
All Implemented Interfaces:
Serializable, Comparable<Knowledge.Type>, Constable
Enclosing class:
Knowledge

public static enum Knowledge.Type extends Enum<Knowledge.Type>
Kinds of corpus a loader can ingest.

Each value is a SourceLoader SPI key. FILE and HTTP/HTTPS URL have bundled loaders; DATABASE is an application extension point. MEMORY and GRAPH load nothing, and no loader serves them.

  • Enum Constant Details

    • FILE

      public static final Knowledge.Type FILE
      Documents on disk. The bundled loader handles the textual aliases registered by DocumentFormat. PDF, DOCX, XLSX, PPTX and EPUB need an optional ContentExtractor (PDFBox/POI on the classpath, or a consumer provider) and are not decoded as text.
    • URL

      public static final Knowledge.Type URL
      Documents fetched from HTTP/HTTPS through the bundled source loader.
    • DATABASE

      public static final Knowledge.Type DATABASE
      Rows ingested from a SQL or NoSQL database. No bundled loader.
    • MEMORY

      public static final Knowledge.Type MEMORY
      Chat knowledge the application supplies at runtime, through a ChatKnowledgeBinding it attaches to the agent. Nothing is loaded or indexed, and initialization resolves nothing for it.
      • Declared on @AgentSpec only; a role or an action that names it fails.
      • use is SEARCH, with no maxTokens; its search sets topK at most.
      • No location or loader member is set.
      • A chat scope holds at most one MEMORY entry; other SEARCH entries and DIRECT entries may sit beside it, and a chat turn searches the MEMORY binding and the other SEARCH entries each on its own.
      • The binding must be owned by the agent, name this entry alone and carry its topK, which is the chat default when none is set.
      • A SourceLoader that handles MEMORY fails discovery.
    • GRAPH

      public static final Knowledge.Type GRAPH
      A handle to a graph store, not a corpus. Nothing is loaded or indexed; an action that names the entry searches the graph that an installed GraphStoreProvider serves for its role.
      • use is SEARCH. DIRECT and SEQUENTIAL fail, since there are no documents to give.
      • The search strategy is GRAPH. When no Search.strategy() is set, on the entry or on the action that names it, the strategy is GRAPH. Any other strategy fails at init, whichever of the two set it.
      • No location or loader member may be set: path, connection, query, format, include, exclude, unit, chunkContext, chunkContextModel, select, refresh and maxTokens fail. enabled applies as usual.
      • An action names at most one GRAPH entry and no document entry beside it.
      • A chat turn leaves GRAPH entries out; only actions search them.
  • Method Details

    • values

      public static Knowledge.Type[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Knowledge.Type valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null