Provider Interface
Providers supply contextual information that forms the agent’s understanding of the current situation. They are the “senses” of the agent, gathering data from various sources to build comprehensive state.Core Interface
Provider Types
- Standard Providers: Included by default in state composition
- Dynamic Providers: Only executed when explicitly requested
- Private Providers: Internal use only, not exposed in default state
Built-in Providers
Provider Summary Table
Provider Name | Dynamic | Position | Default Included | Purpose |
---|---|---|---|---|
ACTIONS | No | -1 | Yes | Lists available actions |
ACTION_STATE | No | 150 | Yes | Action execution state |
ANXIETY | No | Default | Yes | Response style guidelines |
ATTACHMENTS | Yes | Default | No | File/media attachments |
CAPABILITIES | No | Default | Yes | Service capabilities |
CHARACTER | No | Default | Yes | Agent personality |
CHOICE | No | Default | Yes | Pending user choices |
ENTITIES | Yes | Default | No | Conversation participants |
EVALUATORS | No | Default | No (private) | Post-processing options |
FACTS | Yes | Default | No | Stored knowledge |
PROVIDERS | No | Default | Yes | Available providers list |
RECENT_MESSAGES | No | 100 | Yes | Conversation history |
RELATIONSHIPS | Yes | Default | No | Social connections |
ROLES | No | Default | Yes | Server roles (groups only) |
SETTINGS | No | Default | Yes | Configuration state |
TIME | No | Default | Yes | Current UTC time |
WORLD | Yes | Default | No | Server/world context |
Provider Details
Actions Provider (ACTIONS
)
Lists all available actions the agent can execute.
- Position: -1 (runs early)
- Dynamic: No (included by default)
- Data Provided:
actionNames
: Comma-separated list of action namesactionsWithDescriptions
: Formatted action detailsactionExamples
: Example usage for each actionactionsData
: Raw action objects
Action State Provider (ACTION_STATE
)
Shares execution state between chained actions.
- Position: 150 (runs later)
- Dynamic: No (included by default)
- Data Provided:
actionResults
: Previous action execution resultsactionPlan
: Multi-step action execution planworkingMemory
: Temporary data shared between actionsrecentActionMemories
: Historical action executions
Character Provider (CHARACTER
)
Core personality and behavior definition.
- Dynamic: No (included by default)
- Data Provided:
agentName
: Character namebio
: Character backgroundtopics
: Current interestsadjective
: Current mood/statedirections
: Style guidelinesexamples
: Example conversations/posts
Recent Messages Provider (RECENT_MESSAGES
)
Provides conversation history and context.
- Position: 100 (runs later to access other data)
- Dynamic: No (included by default)
- Data Provided:
recentMessages
: Formatted conversation historyrecentInteractions
: Previous interactionsactionResults
: Results from recent actions
Facts Provider (FACTS
)
Retrieves contextually relevant stored facts.
- Dynamic: Yes (must be explicitly included)
- Behavior: Uses embedding search to find relevant facts
- Data Provided:
- Relevant facts based on context
- Fact metadata and sources
Relationships Provider (RELATIONSHIPS
)
Social graph and interaction history.
- Dynamic: Yes (must be explicitly included)
- Data Provided:
- Known entities and their relationships
- Interaction frequency
- Relationship metadata
State Composition
ThecomposeState
method aggregates data from multiple providers to create comprehensive state.
Method Signature
Parameters
- message: The current message/memory object being processed
- includeList: Array of provider names to include (optional)
- onlyInclude: If true, ONLY include providers from includeList
- skipCache: If true, bypass cache and fetch fresh data
Composition Process
- Provider Selection: Determines which providers to run based on filters
- Parallel Execution: Runs all selected providers concurrently
- Result Aggregation: Combines results from all providers
- Caching: Stores the composed state for reuse
Usage Patterns
Provider Registration
Registering a Provider
Provider Position
Position determines execution order:Custom Providers
Creating a Custom Provider
Provider Best Practices
- Return quickly: Use timeouts for external calls
- Handle errors gracefully: Return empty result on failure
- Keep data size reasonable: Don’t return excessive data
- Use appropriate flags: Set
dynamic
for optional providers - Consider position: Order matters for dependent providers