Class CoreContextProvider
java.lang.Object
uno.anahata.asi.agi.context.core.CoreContextProvider
- All Implemented Interfaces:
ContextProvider
Provides the foundational system instructions and metadata awareness for the
Anahata ASI.
- Author:
- anahata
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCoreContextProvider(@NonNull Agi agi) Constructs a new CoreContextProvider for a specific agi session. -
Method Summary
Modifier and TypeMethodDescriptionGets a detailed description of what this context provider does.getId()Gets the unique identifier for this context provider.getName()Gets the human-readable name of this context provider.Gets a list of system instruction strings provided by this context provider.voidpopulateMessage(RagMessage ragMessage) Populates the givenRagMessagewith dynamic, just-in-time context parts.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContextProvider
getAgi, getChildrenProviders, getContextPosition, getFlattenedHierarchy, getFullyQualifiedId, getHeader, getIconId, getInstructionsTokenCount, getParentProvider, getRagTokenCount, isEffectivelyProviding, isProviding, setParentProvider, setProviding
-
Field Details
-
agi
The parent agi session. -
providing
private boolean providingWhether this provider is currently active.
-
-
Constructor Details
-
CoreContextProvider
Constructs a new CoreContextProvider for a specific agi session.- Parameters:
agi- The parent agi session. Must not be null.
-
-
Method Details
-
getId
Gets the unique identifier for this context provider.- Specified by:
getIdin interfaceContextProvider- Returns:
- The provider's ID.
-
getName
Gets the human-readable name of this context provider.- Specified by:
getNamein interfaceContextProvider- Returns:
- The provider's name.
-
getDescription
Gets a detailed description of what this context provider does.- Specified by:
getDescriptionin interfaceContextProvider- Returns:
- The provider's description.
-
getSystemInstructions
Gets a list of system instruction strings provided by this context provider. These are typically prepended to the conversation as high-level guidance.- Specified by:
getSystemInstructionsin interfaceContextProvider- Returns:
- A list of system instruction strings.
- Throws:
Exception- if an error occurs during instruction generation.
-
populateMessage
Populates the givenRagMessagewith dynamic, just-in-time context parts. These parts are appended to the end of the user's prompt (RAG).Populates mission-critical, live temporal and environment metadata into the RAG message on every turn. Guarantees that the AI model maintains precise awareness of time, time zone, OS, user, and runtime environment even when all tools/toolkits are disabled.
- Specified by:
populateMessagein interfaceContextProvider- Parameters:
ragMessage- The message to be augmented with context.- Throws:
Exception- if an error occurs during context generation.
-

